-
Notifications
You must be signed in to change notification settings - Fork 2
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
Null values in fields of type JSONB (Postgresql) #40
Comments
Hi fdpic, Thanks for raising this issue. We reviewed your case and attempted to reproduce the behavior. Based on our findings, DATAMIMIC is working correctly, and the observed behavior aligns with the expected handling of Key Observations
RecommendationsIf your goal is to ensure that
Let us know if you need further clarification or adjustments! Thank you and Best, |
Many thanks for the quick answer. Using an example which as far as I can tell is similar to what you did, I am still getting Maybe I missed something, will take a closer look next week. |
We are happy to help. In case the issues persist, please provide us more information and we will try to dive deeper. Best |
OK, so my mistake, what gets inserted is not the For example, given
and
Looking at the sqlalchemy doc, there is a none_as_null flag which controls how None is handled. Maybe I have misunderstood something. Or maybe you guys have a different setting somewhere that causes Many thanks in advance. |
Thanks for the clarification about the JSON null vs SQL NULL behavior. I think we can extend the existing configuration system to handle SQLAlchemy settings elegantly. Since you're already using a properties file structure for database configuration, we could extend this to include SQLAlchemy configurations in a similar pattern. Here are a few possible approaches:
This would allow users to configure SQLAlchemy behavior per database system while maintaining the current configuration pattern. Would any of these approaches work for your use case? We can discuss the implementation details once we agree on the configuration structure. |
Yes, something like that would be fantastic! |
Hello,
Given this Postgresql table:
and the following datamimic descriptor:
When data_value_json is not None, the value is correctly inserted.
However, it seems that when data_value_json is None in source_db, then the string 'null' (and not SQL NULL) is inserted in target_db.
Kind of similar to psycopg/psycopg2#1433 (although I don't know if Datamimic/sqlalchemy uses a json wrapper)
Not sure if its a bug. As pointed out in that discussion, there might be cases where 'null' is the expected behavior. But then is there any way to (conditionally) flag a key as "ignored"?
Version: last week's development branch.
The text was updated successfully, but these errors were encountered: