Skip to content

private is a reserved keyword. Keywords need to be escaped: \"private" #9

@reebalazs

Description

@reebalazs

Describe the bug

If a table has a field named "private", and we query it as a result field, the generated rescript type will be invalid.

`private` is a reserved keyword. Keywords need to be escaped: \"private"

Expected behavior

It should escape the field name as \"private" and thus generate a valid rescript type.

There may be other reserved words, which also need to be escaped. The full list would need to be determined based on the Rescript documentation.

There is a relatively simple workaround, using private as private_ as the select field. However SELECT * has to be avoided for such tables.

In case this is hard to implement, the workaround that has to be used for reserved words should at least be documented.

Test case

Skipping this for now, creating a test would be trivial. You need a table with a field named "private", and write a SELECT * FROM my_table; query which will produce the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions