fix: supports vercel bundling (#1509)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
Madarco
2024-11-19 17:52:56 +00:00
committed by GitHub
parent 0aa61db547
commit 02b22da384
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
fix: supports Vercel bundling
@@ -176,7 +176,12 @@ export class PGVectorStore extends BaseVectorStore {
if ("clientConfig" in config) {
this.clientConfig = config.clientConfig;
} else {
if (config.client.constructor.name.includes("Vercel")) {
if (
config.client.constructor.name.includes("Vercel") ||
(!!(config.client as VercelPool).connect &&
!!(config.client as VercelPool).query &&
!(config.client as Sql).unsafe)
) {
this.isDBConnected = true;
this.db = fromVercelPool(config.client as unknown as VercelPool);
} else if (typeof config.client === "function") {