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

How to handle null / undefined values when inserting / updating data rows? #50

Closed
the-smart-home-maker opened this issue Jul 1, 2020 · 4 comments

Comments

@the-smart-home-maker
Copy link

Dear data-api-client supporters,

I have a simple question: How to handle null / undefined values when inserting / updating data rows? No matter if I leave parameters as undefined or explicitly set them as null, I always receive an error message either saying 'field_x' is an invalid type (when passing the parameter as undefined) or Unknown column 'field_x' in 'field list' (when passing the parameter as null). How can I explicitly set a field as NULL in the database?

Thanks a lot and best regards
The Smart Home Maker

@the-smart-home-maker
Copy link
Author

I got it working - was a problem with my setup so we can close this issue

@martinpllu
Copy link

Hi @the-smart-home-maker, I'm facing the same issue - can I ask how you resolved it please?

@the-smart-home-maker
Copy link
Author

Hi @the-smart-home-maker, I'm facing the same issue - can I ask how you resolved it please?

Hi @martinpllu,

I figured you need to make sure to explicitly set missing values to null, not undefined.
That should do the trick.

@martinpllu
Copy link

martinpllu commented Sep 28, 2020 via email

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

2 participants