Consider an order with an auto ID field, which can have multiple orderlines.
type Order = { Id: int64 option }
type OrderLine = { Id: int64 option; order: int64 }
Is there an example how to get the value of this generated ID in order to use it as the reference in the orderlines?
I know this can be done manually with
INSERT INTO Order(...) values(...) SELECT SCOPE_IDENTITY()
or "; SELECT last_insert_rowid()" for MSSql/Postgres
but maybe there is a more comfortable way?
And probably there is no other way than keep the ID as option, isn't it?
Consider an order with an auto ID field, which can have multiple orderlines.
Is there an example how to get the value of this generated ID in order to use it as the reference in the orderlines?
I know this can be done manually with
or "; SELECT last_insert_rowid()" for MSSql/Postgres
but maybe there is a more comfortable way?
And probably there is no other way than keep the ID as option, isn't it?