gen: expose table's primary key and/or constraint names for use in im.OnConflict()
/im.OnConflictOnConstraint()
#315
Labels
enhancement
New feature or request
The recent
0.29.0
release made some pretty substantial changes to the generated code's API (and I hope for the good), one of which was the deprecation ofUpsert()
in favor ofInsert()
with some mods.Assuming that one now has to use
im.OnConflict()
orim.OnConflictOnConstraint()
to achieve the same behavior, the table's primary key and/or constraint names needs to be specified explicitly for use in these mods.Whereas before this was handled automatically by the
Upsert()
, when passingconflictCols
equal tonil
:bob/dialect/sqlite/table.go
Lines 205 to 207 in 09c8491
As a result, one now has to type these constraints by hand, which makes things more error-prone than they were before.
The text was updated successfully, but these errors were encountered: