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>
pull/2123/head
Fabian-Lars 6 months ago committed by GitHub
parent 6f6a178ae4
commit 3195646996
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

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

Loading…
Cancel
Save