Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sqlite-proxy run behaviour #2038

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion changelogs/drizzle-orm/0.30.3.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- 🐛 Fixed `@neondatabase/serverless` HTTP driver types issue (#1945, neondatabase/serverless#66)
- 🎉 Added raw query support (`db.execute(...)`) to batch API in Neon HTTP driver
- 🐛 Fixed `@neondatabase/serverless` HTTP driver types issue (#1945, neondatabase/serverless#66)
- 🐛 Fixed sqlite-proxy driver `.run()` result
2 changes: 1 addition & 1 deletion drizzle-orm/src/sqlite-proxy/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class RemotePreparedQuery<T extends PreparedQueryConfig = PreparedQueryCo
run(placeholderValues?: Record<string, unknown>): Promise<SqliteRemoteResult> {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
return (this.client as AsyncRemoteCallback)(this.query.sql, params, 'run').then((t) => t.rows) as Promise<
return (this.client as AsyncRemoteCallback)(this.query.sql, params, 'run') as Promise<
SqliteRemoteResult
>;
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/sqlite-proxy-batch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ test('findMany + findOne api example', async () => {
id: 1,
}]);

expect(insertRes).toEqual({ changes: 1, lastInsertRowid: 2 });
expect(insertRes).toEqual({ rows: { changes: 1, lastInsertRowid: 2 } });

expect(manyUsers).toEqual([
{ id: 1, name: 'John', verified: 0, invitedBy: null },
Expand Down
Loading