@deepagents/text2sql 7.8.1 → 7.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -3315,7 +3315,6 @@ var MssqlFs = class _MssqlFs {
|
|
|
3315
3315
|
};
|
|
3316
3316
|
|
|
3317
3317
|
// packages/text2sql/src/lib/fs/postgres/postgres-fs.ts
|
|
3318
|
-
import { createRequire as createRequire2 } from "node:module";
|
|
3319
3318
|
import * as path4 from "node:path";
|
|
3320
3319
|
import z8 from "zod";
|
|
3321
3320
|
import { lockSchemaDDL } from "@deepagents/context";
|
|
@@ -3379,7 +3378,6 @@ var PostgresFs = class _PostgresFs {
|
|
|
3379
3378
|
#chunkSize;
|
|
3380
3379
|
#root;
|
|
3381
3380
|
#schema;
|
|
3382
|
-
#ownsPool;
|
|
3383
3381
|
constructor(options) {
|
|
3384
3382
|
this.#chunkSize = options.chunkSize ?? 1024 * 1024;
|
|
3385
3383
|
const schema = options.schema ?? "public";
|
|
@@ -3389,24 +3387,7 @@ var PostgresFs = class _PostgresFs {
|
|
|
3389
3387
|
this.#schema = schema;
|
|
3390
3388
|
const normalizedRoot = this.#normalizeRoot(options.root);
|
|
3391
3389
|
this.#root = normalizedRoot === "/" ? "" : normalizedRoot;
|
|
3392
|
-
|
|
3393
|
-
if (options.pool instanceof pg.Pool) {
|
|
3394
|
-
this.#pool = options.pool;
|
|
3395
|
-
this.#ownsPool = false;
|
|
3396
|
-
} else {
|
|
3397
|
-
this.#pool = typeof options.pool === "string" ? new pg.Pool({ connectionString: options.pool }) : new pg.Pool(options.pool);
|
|
3398
|
-
this.#ownsPool = true;
|
|
3399
|
-
}
|
|
3400
|
-
}
|
|
3401
|
-
static #requirePg() {
|
|
3402
|
-
try {
|
|
3403
|
-
const require2 = createRequire2(import.meta.url);
|
|
3404
|
-
return require2("pg");
|
|
3405
|
-
} catch {
|
|
3406
|
-
throw new Error(
|
|
3407
|
-
'PostgresFs requires the "pg" package. Install it with: npm install pg'
|
|
3408
|
-
);
|
|
3409
|
-
}
|
|
3390
|
+
this.#pool = options.pool;
|
|
3410
3391
|
}
|
|
3411
3392
|
#t(name) {
|
|
3412
3393
|
return `"${this.#schema}"."${name}"`;
|
|
@@ -3414,12 +3395,7 @@ var PostgresFs = class _PostgresFs {
|
|
|
3414
3395
|
/** Opens the file system: creates its tables and its root directories. */
|
|
3415
3396
|
static async create(options) {
|
|
3416
3397
|
const fs = new _PostgresFs(options);
|
|
3417
|
-
|
|
3418
|
-
await fs.#initialize();
|
|
3419
|
-
} catch (error) {
|
|
3420
|
-
await fs.close();
|
|
3421
|
-
throw error;
|
|
3422
|
-
}
|
|
3398
|
+
await fs.#initialize();
|
|
3423
3399
|
return fs;
|
|
3424
3400
|
}
|
|
3425
3401
|
// The schema lock is held until this transaction commits, so concurrent
|
|
@@ -3585,11 +3561,6 @@ var PostgresFs = class _PostgresFs {
|
|
|
3585
3561
|
}
|
|
3586
3562
|
return new Uint8Array(Buffer.from(content, encoding ?? "utf8"));
|
|
3587
3563
|
}
|
|
3588
|
-
async close() {
|
|
3589
|
-
if (this.#ownsPool) {
|
|
3590
|
-
await this.#pool.end();
|
|
3591
|
-
}
|
|
3592
|
-
}
|
|
3593
3564
|
// ============================================================================
|
|
3594
3565
|
// IFileSystem Implementation
|
|
3595
3566
|
// ============================================================================
|