Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sql): Fix QueryResult typings #1928

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from
Open
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