You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=> SELECT "user"."id", "user"."name", "user"."id" FROM "user"
Note that user.id appears twice! I definitely expected the call to fields to let me create a list of fields for the SELECT statement. Instead, it vconcats them to the default fields in entity (:fields user).
The purpose of entity-fields is to set the default fields that are always returned. As I see it, fields shouldn't change this but allow you to add more fields on top of default fields.
There has been discussion about adding functions to the API for resetting order/fields: #225
The purpose of entity-fields is to set the default fields that are always
returned. As I see it, fields shouldn't change this but allow you to add
more fields on top of default fields.
There has been discussion about adding functions to the API for resetting
order/fields: #225#225
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/231#issuecomment-44268052
.
I'm only beginning my journey with Korma so pardon me if I'm being pathetically dumb. :)
I found the following behaviour to be very counter-intuitive:
The result is:
Note that
user.id
appears twice! I definitely expected the call tofields
to let me create a list of fields for theSELECT
statement. Instead, itvconcat
s them to the default fields in entity (:fields user).Of course one can
dissoc
the defaults like this:This is a bit cumbersome and not quite something you expect to write.
So, is there a more idiomatic way to do what I need or is it something that the library could improve upon?
The text was updated successfully, but these errors were encountered: