From 9114df8699e56a89ca88dc9c1ca5121bea2daee2 Mon Sep 17 00:00:00 2001 From: amandesai01 Date: Wed, 13 Mar 2024 02:46:58 +0530 Subject: [PATCH 1/2] fix(connectors): update import to work with esm --- src/connectors/postgresql.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connectors/postgresql.ts b/src/connectors/postgresql.ts index bd85989..f583877 100644 --- a/src/connectors/postgresql.ts +++ b/src/connectors/postgresql.ts @@ -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; + let _client: undefined | pg.Client | Promise; 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; From 61ad6e6940e5a93f8b453de99cf86db74dae3591 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 9 Oct 2024 20:32:41 +0200 Subject: [PATCH 2/2] update type import --- src/connectors/postgresql.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connectors/postgresql.ts b/src/connectors/postgresql.ts index 3594054..485444f 100644 --- a/src/connectors/postgresql.ts +++ b/src/connectors/postgresql.ts @@ -1,8 +1,8 @@ -import pg, { ClientConfig } from "pg"; +import pg from "pg"; import type { Connector, Statement } from "../types"; -export type ConnectorOptions = { url: string } | ClientConfig; +export type ConnectorOptions = { url: string } | pg.ClientConfig; export default function postgresqlConnector(opts: ConnectorOptions) { let _client: undefined | pg.Client | Promise;