-
Notifications
You must be signed in to change notification settings - Fork 182
[Issue #50] Removes keys with undefined values. #51
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
[Issue #50] Removes keys with undefined values. #51
Conversation
Removes keys with undefined values from data before creating SQL query. This prevents sending NULL values to Postgres for undefined values, which prevents the Postgres from handling default values. (Postgre)SQL does support undefined values. If you want to use NULL values you should define them as such.
|
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
|
I know this might be a bit invasive, since this will be used on all queries, but I see no reason to add an option/switch or other way to circumvent this behavior. |
|
If accepted and agreed on sanity of behavior I wouldn't mind doing this for the mysql connector as well. |
|
Running into issues now. Added WIP label. |
|
Should be all fine now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use plain for-loop to avoid performance penalties. The closure is heavy.
|
@aars Please sign the CLA - https://cla.strongloop.com/agreements/strongloop/loopback-connector-postgresql |
|
BTW, @raymondfeng, I suppose, this issue has something to do with #44 or #45. If I'm right, may be it's better to fix the root cause instead of adding one more function? //Sorry for the braindump. I need to study the code more to make my thoughts clear ;) |
|
I went deeper, lol. A one line fix for this issue is in my last commit for #54. Seems, this one is no longer needed. Please, verify. |
1.4.0 * Remove the usage of `CREATE SCHEMA IF NOT EXISTS' for compatibility (Raymond Feng) * one-line fix for #51 (Andrey Loukhnov) * basic tests for PR #53 (Andrey Loukhnov) * basic tests for PR #54 (Andrey Loukhnov) * provide database column default values via Loopback model description (Andrey Loukhnov) * autocreate schema if it does not exist during migration/update (Andrey Loukhnov) * Use connection pooling from the driver (Raymond Feng)
|
@aol-nnov Do you think this PR is still relevant? |
|
@raymondfeng I think, no. #54 supersedes it. |
|
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
|
Can one of the admins verify this patch? |
1 similar comment
|
Can one of the admins verify this patch? |
Removes keys with undefined values from data before creating SQL query.
This prevents sending NULL values to Postgres for undefined values,
which prevents the Postgres from handling default values.
(Postgre)SQL does support undefined values. If you want to use NULL
values you should define them as such.