How to return last inserted ID ?
For this example, how do I only return the last inserted ID ?
3 Replies
Did you try reading the documentation?
yes, many times, didn't find anything specifically regarding last inserted id @koskimas
i understood that by default postgres doesn't do that
but how do i make it do that ?
The ~third sentence here
https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#insertInto
The ~fift sentence here
https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#values
This example on the site
https://kysely.dev/docs/examples/INSERT/returning-data