-
Notifications
You must be signed in to change notification settings - Fork 65
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 support for inserts #84
Comments
I think this is a bug and your suggestion a potential bug fix. Could you maybe send a pull request that fixes this and also test the fix? Also wdyt @nineinchnick and @losipiuk ? |
Yeah - it looks like a bug to me. We currently do not have any DML test coverage for go client - so there is a chance that there are other bugs in code, similar to this one. @nineinchnick does proposed fix look ok to you? |
Yes, it looks good. We definitely need more tests. |
Client version: v0.312.0
I have a use case where I insert multiple records with different fields are being nullable. For example, my table schema is as follows:
order
andurl
fields are nullable so when I have 2 records:(1, "first record", nil, "url")
(2, "second record", 1, nil)
I expected to execute the following SQL query (with arguments):
However, when
ExecContext
function is called withdriver.NamedValue
that hasnil
as a value, it throws exception in type conversion function here.To support nil values, we can change the type conversion for nil to:
I am curious what your thoughts are. If this is not a desirable behaviour, is there another workaround for the problem?
The text was updated successfully, but these errors were encountered: