We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f6a178 commit 3195646Copy full SHA for 3195646
.changes/fix-sql-queryresult-type.md
@@ -0,0 +1,5 @@
1
+---
2
+sql-js: patch
3
4
+
5
+Fixed the QueryResult typing by marking `lastInsertId` as optional to reflect postgres-only changes made in the 2.0.0 release.
plugins/sql/guest-js/index.ts
@@ -10,12 +10,12 @@ export interface QueryResult {
10
/**
11
* The last inserted `id`.
12
*
13
- * This value is always `0` when using the Postgres driver. If the
+ * This value is not set for Postgres databases. If the
14
* last inserted id is required on Postgres, the `select` function
15
* must be used, with a `RETURNING` clause
16
* (`INSERT INTO todos (title) VALUES ($1) RETURNING id`).
17
*/
18
- lastInsertId: number
+ lastInsertId?: number
19
}
20
21
0 commit comments