Closed agoat1 closed 2 years ago
Did you check wiki? https://github.com/go-jet/jet/wiki/INSERT You can specify which values to insert.
Table.INSERT(Table.AllColumns.Except(Table.SomeColumn)).
MODEL(model).
RETURNING(Table.AllColumns)
Did you check wiki? https://github.com/go-jet/jet/wiki/INSERT You can specify which values to insert.
Table.INSERT(Table.AllColumns.Except(Table.SomeColumn)). MODEL(model). RETURNING(Table.AllColumns)
Thanks, I missed that.
Is your feature request related to a problem? Please describe. When I insert with INSERT().MODEL(...) and the primary key uses a sequence in postgresql to se the value automatically with nexval(..) as default value, go-jet still set a value of 0 for the primary key if it was not set in the model.
Describe the solution you'd like Have an way to exclude primary key column from the insert and then read the inserted value that was based on postgresql sequence.