Skip to content

Commit

Permalink
fix(connectors): update import to work with esm
Browse files Browse the repository at this point in the history
  • Loading branch information
amandesai01 committed Mar 12, 2024
1 parent b59e7db commit 1fe3275
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/connectors/postgresql.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Client, ClientConfig } from "pg";
import pg, { ClientConfig } from "pg";

import type { Connector, Statement } from "../types";

export type ConnectorOptions = { url: string } | ClientConfig;

export default function sqliteConnector(opts: ConnectorOptions) {
let _client: undefined | Client | Promise<Client>;
let _client: undefined | pg.Client | Promise<pg.Client>;
function getClient() {
if (_client) {
return _client;
}
const client = new Client("url" in opts ? opts.url : opts);
const client = new pg.Client("url" in opts ? opts.url : opts);
_client = client.connect().then(() => {
_client = client;
return _client;
Expand Down

0 comments on commit 1fe3275

Please sign in to comment.