-
Notifications
You must be signed in to change notification settings - Fork 1
Description
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.