Open silane opened 8 months ago
https://github.com/ForbesLindesay/atdatabases/blob/66c0122310747935c09bb23c026006cef409242b/packages/mysql/src/types/Queryable.ts#L10
Return type of Queryable.query is declared to be Promise<any[]> but this is correct only when in SELECT query and not INSERT or DELETE or something else. When INSERT, the returned value seems to be object like follows.
Queryable.query
Promise<any[]>
SELECT
INSERT
DELETE
ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: "Records: 0 Duplicates: 0 Warnings: 0", serverStatus: 2, warningStatus: 0 }
I'm getting TypeScript error when reading affectedRows, but it actually works at runtime.
affectedRows
Using @databases/mysql, but may be the same for other DBs.
@databases/mysql
https://github.com/ForbesLindesay/atdatabases/blob/66c0122310747935c09bb23c026006cef409242b/packages/mysql/src/types/Queryable.ts#L10
Return type of
Queryable.query
is declared to bePromise<any[]>
but this is correct only when inSELECT
query and notINSERT
orDELETE
or something else. WhenINSERT
, the returned value seems to be object like follows.I'm getting TypeScript error when reading
affectedRows
, but it actually works at runtime.Using
@databases/mysql
, but may be the same for other DBs.