From 815a9cc7153594f12bf10d297f98f6981b35a7d0 Mon Sep 17 00:00:00 2001 From: Charlie Hadden Date: Fri, 14 Oct 2022 17:56:54 +0100 Subject: [PATCH] Return insertId in query result --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index 0f531a1..56f6936 100644 --- a/src/index.ts +++ b/src/index.ts @@ -125,6 +125,7 @@ class PlanetScaleConnection implements DatabaseConnection { } return { + insertId: results.insertId !== null && results.insertId.toString() !== '0' ? BigInt(results.insertId) : undefined, rows: results.rows as O[], numUpdatedOrDeletedRows: results.rowsAffected == null ? undefined : BigInt(results.rowsAffected), }