We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b705c25 commit c5e3457Copy full SHA for c5e3457
drizzle-orm/src/node-mssql/session.ts
@@ -244,7 +244,11 @@ export class NodeMsSqlSession<
244
transaction: (tx: NodeMsSqlTransaction<TFullSchema, TSchema>) => Promise<T>,
245
config?: MsSqlTransactionConfig,
246
): Promise<T> {
247
- const mssqlTransaction = (this.client as ConnectionPool).transaction();
+ let queryClient = this.client as ConnectionPool;
248
+ if (is(this.client, AutoPool)) {
249
+ queryClient = await this.client.$instance();
250
+ }
251
+ const mssqlTransaction = queryClient.transaction();
252
const session = new NodeMsSqlSession(
253
mssqlTransaction,
254
this.dialect,
0 commit comments