Skip to content

Commit 2185f15

Browse files
authored
add numAffectedRows @ DataApiConnection.executeQuery. (#19)
1 parent 80a6f36 commit 2185f15

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/data-api-driver.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,14 @@ class DataApiConnection implements DatabaseConnection {
9696
includeResultMetadata: true,
9797
});
9898
if (!r.columnMetadata) {
99+
const numAffectedRows = BigInt(r.numberOfRecordsUpdated || 0)
100+
99101
return {
100-
numUpdatedOrDeletedRows: BigInt(r.numberOfRecordsUpdated || 0),
102+
// @ts-ignore replaces `QueryResult.numUpdatedOrDeletedRows` in kysely >= 0.23
103+
// following https://github.com/koskimas/kysely/pull/188
104+
numAffectedRows,
105+
// deprecated in kysely >= 0.23, keep for backward compatibility.
106+
numUpdatedOrDeletedRows: numAffectedRows,
101107
insertId: r.generatedFields && r.generatedFields.length > 0 ? r.generatedFields[0].longValue : undefined
102108
rows: [],
103109
};

0 commit comments

Comments
 (0)