Skip to content
Snippets Groups Projects
Unverified Commit 6d4e2ea0 authored by WarlaxZ's avatar WarlaxZ Committed by GitHub
Browse files

fix: dynamic import cjs module pg (#685)


Co-authored-by: default avatarAlex Yang <himself65@outlook.com>
parent 3cbfa98e
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,9 @@ export class PGVectorStore implements VectorStore {
private async getDb(): Promise<pg.Client> {
if (!this.db) {
try {
const { Client } = await import("pg");
const pg = await import("pg");
const { Client } = pg.default ? pg.default : pg;
const { registerType } = await import("pgvector/pg");
// Create DB connection
// Read connection params from env - see comment block above
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment