Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/fix-sql-queryresult-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sql-js: patch
---

Fixed the QueryResult typing by marking `lastInsertId` as optional to reflect postgres-only changes made in the 2.0.0 release.
4 changes: 2 additions & 2 deletions plugins/sql/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export interface QueryResult {
/**
* The last inserted `id`.
*
* This value is always `0` when using the Postgres driver. If the
* This value is not set for Postgres databases. If the
* last inserted id is required on Postgres, the `select` function
* must be used, with a `RETURNING` clause
* (`INSERT INTO todos (title) VALUES ($1) RETURNING id`).
*/
lastInsertId: number
lastInsertId?: number
}

/**
Expand Down
Loading