Skip to content

Commit 3e35d9d

Browse files
committed
improve insertId API documentation
1 parent fef3525 commit 3e35d9d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/query-builder/insert-result.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@
2323
*/
2424
export class InsertResult {
2525
/**
26-
* The auto incrementing primary key
26+
* The auto incrementing primary key of the inserted row.
27+
*
28+
* This property can be undefined when the query contains an `on conflict`
29+
* clause that makes the query succeed even when nothing gets inserted.
30+
*
31+
* This property is always undefined on dialects like PostgreSQL that
32+
* don't return the inserted id by default. On those dialects you need
33+
* to use the {@link ReturningInterface.returning | returning} method.
2734
*/
2835
readonly insertId: bigint | undefined
2936

0 commit comments

Comments
 (0)