-
Notifications
You must be signed in to change notification settings - Fork 639
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
Json keys no longer updating #1324
Comments
Shouldn't that patch be: |
FormatDatabaseJson handles that |
Could add output what your query now generates? |
update "example" set "data" = jsonb_set("data", '{}', '"some"', true) |
columnNameToPropertyName returns null for the prop name when generating the statement. After formatDatabaseName is called why do we need to map a col to a prop name ? |
See #1089 |
I haven't considered that use case. It worked before by accident. |
Its a large change for us. The docs for https://vincit.github.io/objection.js/api/model/instance-methods.html#formatdatabasejson are pretty clear that this method is put it into database format. As you said here #1089 (comment) An easy fix for us is columnNameToPropertyName shouldn't return null ever, just return the unmodified key |
Can you elaborate on why this was closed? Why is $formatDatabaseJson the wrong place for this? |
The fix for #1089 is a breaking change for us and I'm trying to work out whether we have been misusing the system or whether there is a bug.
Our use case is that we have a data dump field on most tables that we normalise onto the model
modelClass.columnNameToPropertyName always returns null and so the paths are empty in the call to jsonb_set
Repo:
The text was updated successfully, but these errors were encountered: