mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-01-31 00:45:24 +01:00
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:
5
.changes/fix-sql-queryresult-type.md
Normal file
5
.changes/fix-sql-queryresult-type.md
Normal 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.
|
||||
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user