Using postgres I use "returning *" when inserting or updating data.
This allows you to get not only the primary key but also all the fields.
Is it possible to do this with linq2db?
I think in some cases this is more convenient than inserting data and then selecting them.
If you use "returning *", you get an atomic operation and you do not need to select the primary key type.
Something like
T obj = db.Insert<T>(T item);
T obj = db.Update<T>(T item);
Similar #797 & #869
This feature is in our TODO list. After CTE feature, we will start implementing this one.
What a great feature to be used if and when available.
There is already branch for this. Currently implemented functions InsertWithOutput and InsertWithOutputInto and only for SQL Server. I'll return to this soon.
Upvote for feature implementation
Most helpful comment
This feature is in our TODO list. After CTE feature, we will start implementing this one.