Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
reebalazs opened this issue Nov 19, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@reebalazs
Copy link

reebalazs commented Nov 19, 2024

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.

@reebalazs reebalazs added the bug Something isn't working label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant