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

Disable snakeCaseMappers for JSON field names #1922

Closed
wwei-flux opened this issue Nov 25, 2020 · 1 comment
Closed

Disable snakeCaseMappers for JSON field names #1922

wwei-flux opened this issue Nov 25, 2020 · 1 comment

Comments

@wwei-flux
Copy link

Hi there,

We have been using snakeCaseMappers for a long time as our DB table columns are snake cased. Recently I started trying JSON query and found JSON field names are converted to snake case, too, which is unexpected. We actually use camel case in JSON fields.

Example with a table "users" with a JSONB column "settings", and a JSON field "userAccessible".

user.$query().patch({
  'settings:userAccessible.timezone': timezone,
});

This is converted to SQL as below:

update "users" set "settings" = jsonb_set("settings", '{user_accessible,timezone}', ?, true) where "users"."id" = ?

Is there a way to disable snake case mapper for JSON fields?

Thanks

@wwei-flux
Copy link
Author

Found #1089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant