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
I am on PostgreSQL, and have a table with 2 auto increment columns along with other columns. One of those auto increment columns is PK.
What I was expecting is, calling SetKeys on PK and then setting autoincrement tag on 2nd auto increment column should make it work properly - i.e. insert should insert nextvals in both those columns and object that I am inserting should get those values reflected. But it looks like
This is probably an artifact of trying to support a bunch of databases, many of which don't conform well to the SQL standard. For example: MySQL does not have a returning clause.
If you would like to make a PR to fix it, you're welcome to!
Looking more into the code I realised that above approach will only modify the query to return multiple values. But I will also need to update insert and handle cases like TargetQueryInserter, TargetedAutoIncrInserter, IntegerAutoIncrInserter etc. which are currently written to handle single autoincrement field.
I am on PostgreSQL, and have a table with 2 auto increment columns along with other columns. One of those auto increment columns is PK.
What I was expecting is, calling SetKeys on PK and then setting
autoincrement
tag on 2nd auto increment column should make it work properly - i.e. insert should insert nextvals in both those columns and object that I am inserting should get those values reflected. But it looks likegorp/table_bindings.go
Line 160 in f3677d4
returning
clause with latestautoincrement
column.Any specific reason to not include all
autoincrement
columns as part ofreturning
clause?The text was updated successfully, but these errors were encountered: