Skip to content

Commit

Permalink
Update changelogs, fix .get() regression in SQLite
Browse files Browse the repository at this point in the history
  • Loading branch information
dankochetov committed May 24, 2023
1 parent bdc6b6c commit 60ec8da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/d1/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class PreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig>
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);
Expand Down
2 changes: 1 addition & 1 deletion src/libsql/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class PreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig>
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);
Expand Down

0 comments on commit 60ec8da

Please sign in to comment.