-
Notifications
You must be signed in to change notification settings - Fork 213
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
No means of omitting zero values, generating useless INSERT queries #234
Comments
@AlbinoGeek is this a case where you can use Internally we use that tag as we know what fields we want to skip when inserting. |
This seems inconsistent, why when Not to mention, this needs to be in some of the three places documentation is available. I am trying this now... Alright, that works! With the exception of the documentation issue, this is solved. Also worth noting, the link doesn't show the tag you mention. It says |
Various Documentation Sources
Broken, Outdated or Unofficial?
( Why did I even mention the SO? They have higher Google SER than the official docs when looking for issues. ) If you prefer we'd discuss documentation of the issue in another issue, feel free to close this one as solved. |
Issue Summary
Dialect:
sqlite3
: However, this issue is not related to the dialect.Using the
struct
format ofgoqu
forINSERT
s lead to... unusable queries, should you be (DRY) using the same struct as you wouldSELECT
ing. This results in the following error on the second insert:This is because of the very visibly erroneous SQL statement as generated:
Notice the
profile_id
field set to0
?Sample Reproduction
Expectation
I would expect
goqu
to support eitheromitempty
or some other tag when it comes to avoiding the inclusion of a parameter in anINSERT
statement. Such, that I wonder how anyone is using this package forINSERT
s given this issue existing. (Perhaps I have missed something? I checked the documentation available in 3+ places however, and did not see it mentioned.)Maybe related to #174 -- but not strictly a duplicate, unless you plan to make nullable IDs a standard... (eww.)
The text was updated successfully, but these errors were encountered: