Skip to content

Bug: added a table using the class as a bind fails to exec query if : is included #562

@ShadowWolf308

Description

@ShadowWolf308

Describe the bug

If i init a table class with : inside the table name, then it will throw an error when i interpolate it into my query using surql and execute said query.

Steps to reproduce

const table = new Table("namespace:table_name");

surreal.query(
  surql`
    DEFINE TABLE OVERWRITE ${table} SCHEMALESS TYPE NORMAL
  `
);

Expected behaviour

To create the table namespace:table_name and have the table name itself be escaped

SurrealDB version

3.0.1 for linux on x86_64

JavaScript SDK version

2.0.0

Contact Details

discord: astrolaxis

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct (repository /surrealdb.js)

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions