Closed morseton closed 1 year ago
GROUP
is a reserved keyword, hence your query fails. @BobdenOs do we have a smart quoting mechanism in place which should escape the GROUP
in this case?
I have added some more reserved words in #178
@morseton with the next @cap-js/postres release, the group
identifier will be automatically quoted for you.
Thanks for reporting.
@patricebender Thanks for the quick fix. Will wait for the release.
Closing this, fix available with the new version
Description of erroneous behaviour
Hello, I've noticed that using some specific names on the elements of an entity will generate query errors. I will send an example of a simple project below, with two entities: The entity Person will generate an error on the PG query whenever we expand to either "user" or "group". The other entity "PersonFixed" will not have the error, even when they are the same (the only difference being that the "user" and "group" associations have an underscore on their name).
Detailed steps to reproduce
In the other hand, the following expands work (for entity PersonFixed): http://localhost:4006/odata/v4/srv/PersonFixed?$expand=_user http://localhost:4006/odata/v4/srv/PersonFixed?$expand=_group
This gives the impression that it's not possible to use "user" or "group" as an element name.
Details about your project
Thanks in advance.