From 60ec8dad85421229d21cdb96ace145240225cf5b Mon Sep 17 00:00:00 2001 From: Dan Kochetov Date: Wed, 24 May 2023 22:40:50 +0300 Subject: [PATCH] Update changelogs, fix .get() regression in SQLite --- src/d1/session.ts | 2 +- src/libsql/session.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d1/session.ts b/src/d1/session.ts index 1c6fc811c..66b9f903d 100644 --- a/src/d1/session.ts +++ b/src/d1/session.ts @@ -124,7 +124,7 @@ export class PreparedQuery if (!fields && !customResultMapper) { const params = fillPlaceholders(this.params, placeholderValues ?? {}); logger.logQuery(queryString, params); - return stmt.bind(...params).all().then(({ results }) => results!); + return stmt.bind(...params).all().then(({ results }) => results![0]); } const rows = await this.values(placeholderValues); diff --git a/src/libsql/session.ts b/src/libsql/session.ts index 5f028f591..9f707b3c1 100644 --- a/src/libsql/session.ts +++ b/src/libsql/session.ts @@ -142,7 +142,7 @@ export class PreparedQuery const params = fillPlaceholders(this.params, placeholderValues ?? {}); logger.logQuery(queryString, params); const stmt: InStatement = { sql: queryString, args: params as InArgs }; - return (tx ? tx.execute(stmt) : client.execute(stmt)).then(({ rows }) => rows.map((row) => normalizeRow(row))); + return (tx ? tx.execute(stmt) : client.execute(stmt)).then(({ rows }) => normalizeRow(rows[0])); } const rows = await this.values(placeholderValues);