private
is a reserved keyword. Keywords need to be escaped: \"private"
#9
Labels
bug
Something isn't working
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.
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. HoweverSELECT *
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.The text was updated successfully, but these errors were encountered: