fix(sql): Fix QueryResult typings (#1928)

* fix(sql): Fix QueryResult typings

closes #1893

* Create fix-sql-queryresult-type.md

---------

Co-authored-by: Tillmann <28728469+tweidinger@users.noreply.github.com>
This commit is contained in:
Fabian-Lars
2024-12-02 14:49:06 +01:00
committed by GitHub
parent 6f6a178ae4
commit 3195646996
2 changed files with 7 additions and 2 deletions

View File

@@ -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.

View File

@@ -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
}
/**