Skip to content

Commit

Permalink
Interim
Browse files Browse the repository at this point in the history
  • Loading branch information
benmerckx committed May 8, 2024
1 parent c62e0f0 commit aff676c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/driver/pg.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {Pool, type Client, type PoolClient} from 'pg'
import pg, {type Client, type PoolClient} from 'pg'
import {AsyncDatabase, type TransactionOptions} from '../core/Database.ts'
import type {AsyncDriver, AsyncStatement} from '../core/Driver.ts'
import {postgresDialect} from '../postgres/PostgresDialect.ts'

type Queryable = Client | Pool | PoolClient
type Queryable = Client | pg.Pool | PoolClient

class PreparedStatement implements AsyncStatement {
constructor(
Expand Down Expand Up @@ -73,7 +73,7 @@ export class PgDriver implements AsyncDriver {
depth: number
): Promise<T> {
const client =
this.client instanceof Pool ? await this.client.connect() : this.client
this.client instanceof pg.Pool ? await this.client.connect() : this.client
try {
await client.query(depth > 0 ? `savepoint d${depth}` : 'begin')
const result = await run(new PgDriver(client))
Expand Down

0 comments on commit aff676c

Please sign in to comment.