You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.values() Only Affects First Row in Multi-row Insert — Bug or Intended? #138
Thank you for creating and maintaining sql-bricks — it's a concise and flexible SQL builder that we’ve enjoyed using in our project.
We’ve encountered what appears to be a bug when using .values() to append fields after an initial multi-row insert. Specifically, the appended field is only applied to the first row, while subsequent rows receive null for that field.
INSERT INTO test (type, create_time) VALUES ('cat', 3), ('dog', null)
Expected:
INSERT INTO test (type, create_time) VALUES ('cat', 3), ('dog', 3)
In our use case, this causes inconsistent data and runtime errors. Based on the chaining design of sql-bricks, it would be reasonable to expect .values() to apply to all rows uniformly.
Questions
Is this behavior considered a bug or working as designed?
If it’s a bug, is there a recommended workaround or fix?
Are there any plans to publish a new release that addresses this issue?
We’d be happy to contribute or assist in debugging this further if needed. Thank you again for the great tool!
Activity