For an insert
, sometimes you want default
instead of null
for nil
/missing columns
#366
Labels
insert
, sometimes you want default
instead of null
for nil
/missing columns
#366
From Slack:
Yes, my issue was with the sql generated by honeysql. If I take the data:
Where the first field has an id (already exists in the database) and the second one has no id (yet to be created) I give those fields to honeysql through:
The generated insert statement creates
Where the
NULL
leads to an error due to a missing value for the primary key. If it was insteadDEFAULT
theid
would instead be created by the database.This does not happen if I have only new fields (fields without ids) because the id field is omitted and the default will be used
The text was updated successfully, but these errors were encountered: