@nicia-ai/typegraph 0.57.0 → 0.57.1

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/backend/drizzle/engine/index.cjs +8 -8
  3. package/dist/backend/drizzle/engine/index.d.cts +4 -4
  4. package/dist/backend/drizzle/engine/index.d.ts +4 -4
  5. package/dist/backend/drizzle/engine/index.js +3 -3
  6. package/dist/backend/drizzle/indexes.cjs +6 -6
  7. package/dist/backend/drizzle/indexes.js +2 -2
  8. package/dist/backend/postgres/index.cjs +17 -17
  9. package/dist/backend/postgres/index.d.cts +2 -2
  10. package/dist/backend/postgres/index.d.ts +2 -2
  11. package/dist/backend/postgres/index.js +3 -3
  12. package/dist/backend/postgres/pglite-store.cjs +1 -1
  13. package/dist/backend/postgres/pglite-store.js +1 -1
  14. package/dist/backend/postgres/pglite.cjs +5 -5
  15. package/dist/backend/postgres/pglite.js +4 -4
  16. package/dist/backend/sqlite/index.cjs +16 -16
  17. package/dist/backend/sqlite/index.d.cts +2 -2
  18. package/dist/backend/sqlite/index.d.ts +2 -2
  19. package/dist/backend/sqlite/index.js +3 -3
  20. package/dist/backend/sqlite/libsql.cjs +7 -7
  21. package/dist/backend/sqlite/libsql.js +3 -3
  22. package/dist/backend/sqlite/local-store.cjs +1 -1
  23. package/dist/backend/sqlite/local-store.js +1 -1
  24. package/dist/backend/sqlite/local.cjs +5 -5
  25. package/dist/backend/sqlite/local.js +4 -4
  26. package/dist/{chunk-B2FYH5VR.cjs → chunk-2GXLAV4H.cjs} +2 -2
  27. package/dist/{chunk-B2FYH5VR.cjs.map → chunk-2GXLAV4H.cjs.map} +1 -1
  28. package/dist/{chunk-S2U4AZEO.js → chunk-3B6AEIK4.js} +3 -3
  29. package/dist/{chunk-S2U4AZEO.js.map → chunk-3B6AEIK4.js.map} +1 -1
  30. package/dist/{chunk-PZJYWJQB.cjs → chunk-C2LSQ3SJ.cjs} +6 -6
  31. package/dist/{chunk-PZJYWJQB.cjs.map → chunk-C2LSQ3SJ.cjs.map} +1 -1
  32. package/dist/{chunk-CZNYXNOY.cjs → chunk-DIVOGAPS.cjs} +90 -82
  33. package/dist/chunk-DIVOGAPS.cjs.map +1 -0
  34. package/dist/{chunk-GSRUQXYE.cjs → chunk-G72YXUND.cjs} +5 -5
  35. package/dist/{chunk-GSRUQXYE.cjs.map → chunk-G72YXUND.cjs.map} +1 -1
  36. package/dist/{chunk-DLDGDFDF.js → chunk-MPX2F64V.js} +3 -3
  37. package/dist/{chunk-DLDGDFDF.js.map → chunk-MPX2F64V.js.map} +1 -1
  38. package/dist/{chunk-AKCXD3VV.js → chunk-N7XZENEJ.js} +26 -18
  39. package/dist/chunk-N7XZENEJ.js.map +1 -0
  40. package/dist/{chunk-2EMCMUTX.js → chunk-NDLVGHQA.js} +3 -3
  41. package/dist/{chunk-2EMCMUTX.js.map → chunk-NDLVGHQA.js.map} +1 -1
  42. package/dist/{chunk-BP3ANNRA.cjs → chunk-NLLZSEHL.cjs} +8 -8
  43. package/dist/{chunk-BP3ANNRA.cjs.map → chunk-NLLZSEHL.cjs.map} +1 -1
  44. package/dist/{chunk-RWE33LCI.js → chunk-NXK2ZBVV.js} +2 -2
  45. package/dist/{chunk-RWE33LCI.js.map → chunk-NXK2ZBVV.js.map} +1 -1
  46. package/dist/{chunk-53GIRRN2.cjs → chunk-TDRZ46SF.cjs} +12 -12
  47. package/dist/{chunk-53GIRRN2.cjs.map → chunk-TDRZ46SF.cjs.map} +1 -1
  48. package/dist/{chunk-OX2NMPRS.js → chunk-UJW55GPE.js} +3 -3
  49. package/dist/{chunk-OX2NMPRS.js.map → chunk-UJW55GPE.js.map} +1 -1
  50. package/dist/graph-merge/index.cjs +9 -9
  51. package/dist/graph-merge/index.js +2 -2
  52. package/dist/index.cjs +42 -42
  53. package/dist/index.js +2 -2
  54. package/dist/indexes/index.cjs +3 -3
  55. package/dist/indexes/index.js +1 -1
  56. package/dist/{local-store-impl-HRFYR5WM.cjs → local-store-impl-EDCPRE6P.cjs} +10 -10
  57. package/dist/{local-store-impl-HRFYR5WM.cjs.map → local-store-impl-EDCPRE6P.cjs.map} +1 -1
  58. package/dist/{local-store-impl-JSXB77IJ.js → local-store-impl-GAWJELMM.js} +7 -7
  59. package/dist/{local-store-impl-JSXB77IJ.js.map → local-store-impl-GAWJELMM.js.map} +1 -1
  60. package/dist/{pglite-store-impl-Z47DA4XJ.js → pglite-store-impl-7GHPD535.js} +7 -7
  61. package/dist/{pglite-store-impl-Z47DA4XJ.js.map → pglite-store-impl-7GHPD535.js.map} +1 -1
  62. package/dist/{pglite-store-impl-OVR7CZ34.cjs → pglite-store-impl-AJ5E6PGZ.cjs} +10 -10
  63. package/dist/{pglite-store-impl-OVR7CZ34.cjs.map → pglite-store-impl-AJ5E6PGZ.cjs.map} +1 -1
  64. package/dist/{postgres-pzUsZov1.d.ts → postgres-BI8Msmji.d.ts} +1 -1
  65. package/dist/{postgres-BpGAssib.d.cts → postgres-Bj_zNOpG.d.cts} +1 -1
  66. package/dist/{profile-DBDoRSzj.d.ts → profile-DEx6nWHO.d.ts} +10 -10
  67. package/dist/{profile-D1_16oM5.d.cts → profile-DLncvbZ_.d.cts} +10 -10
  68. package/dist/{sqlite-Bg5h3Jk0.d.ts → sqlite-C7AHJCO4.d.ts} +1 -1
  69. package/dist/{sqlite-BzHm5Mc2.d.cts → sqlite-CL86_33e.d.cts} +1 -1
  70. package/package.json +1 -1
  71. package/dist/chunk-AKCXD3VV.js.map +0 -1
  72. package/dist/chunk-CZNYXNOY.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkCZNYXNOY_cjs = require('./chunk-CZNYXNOY.cjs');
3
+ var chunkDIVOGAPS_cjs = require('./chunk-DIVOGAPS.cjs');
4
4
  var chunk3DERXVTU_cjs = require('./chunk-3DERXVTU.cjs');
5
5
  var chunk4ACC3PJC_cjs = require('./chunk-4ACC3PJC.cjs');
6
6
  var chunkKD3BDZHS_cjs = require('./chunk-KD3BDZHS.cjs');
@@ -20,7 +20,7 @@ async function loadDefaultPgvectorExtension() {
20
20
  }
21
21
  }
22
22
  async function createLocalPgliteBackend(options = {}) {
23
- const tables2 = options.tables ?? chunkCZNYXNOY_cjs.tables;
23
+ const tables2 = options.tables ?? chunkDIVOGAPS_cjs.tables;
24
24
  const vectorExtension = options.vector === false ? void 0 : options.vector ?? await loadDefaultPgvectorExtension();
25
25
  const vectorEnabled = vectorExtension !== void 0;
26
26
  const client = await pglite.PGlite.create({
@@ -28,10 +28,10 @@ async function createLocalPgliteBackend(options = {}) {
28
28
  ...vectorExtension === void 0 ? {} : { extensions: { vector: vectorExtension } }
29
29
  });
30
30
  try {
31
- const migrationSql = vectorEnabled ? chunkCZNYXNOY_cjs.generatePostgresMigrationSQL(tables2, options.fulltext) : chunkCZNYXNOY_cjs.generateVectorlessPostgresMigrationSQL(tables2, options.fulltext);
31
+ const migrationSql = vectorEnabled ? chunkDIVOGAPS_cjs.generatePostgresMigrationSQL(tables2, options.fulltext) : chunkDIVOGAPS_cjs.generateVectorlessPostgresMigrationSQL(tables2, options.fulltext);
32
32
  await client.exec(migrationSql);
33
33
  const db = pglite$1.drizzle(client);
34
- const backend = chunkCZNYXNOY_cjs.createPostgresBackend(db, {
34
+ const backend = chunkDIVOGAPS_cjs.createPostgresBackend(db, {
35
35
  tables: tables2,
36
36
  ...vectorEnabled ? {} : { vector: false },
37
37
  ...options.fulltext === void 0 ? {} : { fulltext: options.fulltext }
@@ -50,5 +50,5 @@ async function createLocalPgliteBackend(options = {}) {
50
50
  }
51
51
 
52
52
  exports.createLocalPgliteBackend = createLocalPgliteBackend;
53
- //# sourceMappingURL=chunk-PZJYWJQB.cjs.map
54
- //# sourceMappingURL=chunk-PZJYWJQB.cjs.map
53
+ //# sourceMappingURL=chunk-C2LSQ3SJ.cjs.map
54
+ //# sourceMappingURL=chunk-C2LSQ3SJ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/backend/postgres/pglite.ts"],"names":["ConfigurationError","tables","PGlite","generatePostgresMigrationSQL","generateVectorlessPostgresMigrationSQL","drizzle","createPostgresBackend","wrapWithManagedClose","markBundledRootAutocommitEligible","closeAfterFailure"],"mappings":";;;;;;;;;AAgJA,eAAe,4BAAA,GAAmD;AAChE,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAU,MAAM,OAAO,+BAA+B,CAAA;AAC5D,IAAA,OAAO,OAAA,CAAQ,MAAA;AAAA,EACjB,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,IAAIA,oCAAA;AAAA,MACR,2PAAA;AAAA,MAIA,EAAE,OAAA,EAAS,QAAA,EAAU,UAAA,EAAY,+BAAA,EAAgC;AAAA,MACjE,EAAE,OAAO,KAAA;AAAM,KACjB;AAAA,EACF;AACF;AAoBA,eAAsB,wBAAA,CACpB,OAAA,GAAqC,EAAC,EACH;AACnC,EAAA,MAAMC,OAAAA,GAAS,QAAQ,MAAA,IAAUA,wBAAA;AAMjC,EAAA,MAAM,eAAA,GACJ,QAAQ,MAAA,KAAW,KAAA,GACjB,SACC,OAAA,CAAQ,MAAA,IAAW,MAAM,4BAAA,EAA6B;AAC3D,EAAA,MAAM,gBAAgB,eAAA,KAAoB,MAAA;AAO1C,EAAA,MAAM,MAAA,GAAS,MAAMC,aAAA,CAAO,MAAA,CAAO;AAAA,IACjC,GAAI,QAAQ,OAAA,KAAY,MAAA,GAAY,EAAC,GAAI,EAAE,OAAA,EAAS,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACpE,GAAI,eAAA,KAAoB,MAAA,GACtB,EAAC,GACD,EAAE,UAAA,EAAY,EAAE,MAAA,EAAQ,eAAA,EAAgB;AAAE,GAC7C,CAAA;AAED,EAAA,IAAI;AAGF,IAAA,MAAM,YAAA,GACJ,aAAA,GACEC,8CAAA,CAA6BF,OAAAA,EAAQ,OAAA,CAAQ,QAAQ,CAAA,GACrDG,wDAAA,CAAuCH,OAAAA,EAAQ,OAAA,CAAQ,QAAQ,CAAA;AACnE,IAAA,MAAM,MAAA,CAAO,KAAK,YAAY,CAAA;AAE9B,IAAA,MAAM,EAAA,GAAKI,iBAAQ,MAAM,CAAA;AACzB,IAAA,MAAM,OAAA,GAAUC,wCAAsB,EAAA,EAAI;AAAA,MACxC,MAAA,EAAAL,OAAAA;AAAA,MACA,GAAI,aAAA,GAAgB,EAAC,GAAI,EAAE,QAAQ,KAAA,EAAM;AAAA,MACzC,GAAI,QAAQ,QAAA,KAAa,KAAA,CAAA,GAAY,EAAC,GAAI,EAAE,QAAA,EAAU,OAAA,CAAQ,QAAA;AAAS,KACxE,CAAA;AACD,IAAA,MAAM,cAAA,GAAiBM,sCAAA,CAAqB,OAAA,EAAS,YAAY;AAC/D,MAAA,MAAM,OAAO,KAAA,EAAM;AAAA,IACrB,CAAC,CAAA;AAED,IAAA,OAAO;AAAA,MACL,OAAA,EAASC,oDAAkC,cAAc,CAAA;AAAA,MACzD,EAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,OAAOC,mCAAA,CAAkB,QAAQ,KAAK,CAAA;AAAA,EACxC;AACF","file":"chunk-PZJYWJQB.cjs","sourcesContent":["/**\n * Local PGlite backend — Postgres-in-WASM, running in-process.\n *\n * [PGlite](https://pglite.dev/) is a full Postgres compiled to WebAssembly\n * that runs inside the Node/Bun/Deno/browser process with no server and no\n * native addon. This is the batteries-included Postgres analog of\n * `createLocalSqliteBackend`: it constructs a PGlite instance, loads the\n * pgvector extension, runs the schema DDL, and returns a ready\n * `{ backend, db }` pair whose `close()` disposes the engine.\n *\n * `@electric-sql/pglite` is an optional peer dependency. Vector support\n * additionally needs `@electric-sql/pglite-pgvector` (PGlite ≥ 0.5 ships\n * pgvector as a separate package). Install what you need:\n *\n * ```bash\n * pnpm add @electric-sql/pglite @electric-sql/pglite-pgvector\n * ```\n *\n * @example In-memory database (default, vector enabled)\n * ```typescript\n * import { createLocalPgliteBackend } from \"@nicia-ai/typegraph/adapters/drizzle/postgres/pglite\";\n *\n * const { backend } = await createLocalPgliteBackend();\n * const store = createStore(graph, backend);\n * ```\n *\n * @example Persistent on-disk database\n * ```typescript\n * const { backend, db } = await createLocalPgliteBackend({ dataDir: \"./pgdata\" });\n * ```\n *\n * @example No vector support (skip the pgvector extension)\n * ```typescript\n * const { backend } = await createLocalPgliteBackend({ vector: false });\n * ```\n *\n * PGlite is single-connection and serial: there is no pooling, so concurrent\n * `store.transaction()` calls queue rather than run in parallel.\n */\nimport { type Extension, PGlite } from \"@electric-sql/pglite\";\nimport { drizzle, type PgliteDatabase } from \"drizzle-orm/pglite\";\n\nimport { ConfigurationError } from \"../../errors\";\nimport { type FulltextStrategy } from \"../../query/dialect/fulltext-strategy\";\nimport { markBundledRootAutocommitEligible } from \"../capabilities/autocommit-single-statement\";\nimport { wrapWithManagedClose } from \"../derive-backend\";\nexport type { GraphIdentityConfig } from \"../../core/define-graph\";\nimport {\n generatePostgresMigrationSQL,\n generateVectorlessPostgresMigrationSQL,\n} from \"../drizzle/ddl\";\nimport { type AnyPgTransaction } from \"../drizzle/execution\";\nexport type { AnyPgDatabase, AnyPgTransaction } from \"../drizzle/execution\";\nimport {\n createPostgresBackend,\n type PostgresTables,\n tables as defaultTables,\n} from \"../drizzle/postgres\";\nimport { type AdapterBackend, closeAfterFailure } from \"../types\";\nexport type {\n ContributionDiagnostic,\n ContributionDiagnosticState,\n ContributionRepairEntry,\n ContributionRepairResult,\n} from \"../types\";\n\n// ============================================================\n// Types\n// ============================================================\n\n/**\n * Options for creating a local PGlite backend.\n */\nexport type LocalPgliteBackendOptions = Readonly<{\n /**\n * PGlite data directory. Omit for an in-memory database (the default).\n * Accepts any PGlite data-dir spec: a filesystem path (`\"./pgdata\"`),\n * `\"memory://\"`, or a browser/runtime-specific scheme such as\n * `\"idb://my-db\"`.\n */\n dataDir?: string;\n\n /**\n * Custom table definitions. Defaults to standard TypeGraph table names.\n */\n tables?: PostgresTables;\n\n /**\n * Controls the pgvector stack:\n *\n * - **omitted (default)** — load pgvector from `@electric-sql/pglite-pgvector`\n * and run `CREATE EXTENSION vector`, so embedding fields work out of the\n * box. Throws a {@link ConfigurationError} if the package isn't installed.\n * - **`false`** — skip the extension entirely; the backend advertises no\n * vector capability (mirroring a SQLite connection without sqlite-vec).\n * Use when a graph carries no embeddings, or to avoid the extension dep.\n * - **a PGlite `Extension`** — bring your own pgvector build or custom\n * extension packaging. Decouples this helper from a specific pgvector\n * package version.\n */\n vector?: false | Extension;\n\n /**\n * Override the fulltext strategy. Defaults to `tsvectorStrategy`. Pass\n * `false` to disable fulltext support entirely — the backend then\n * advertises no `capabilities.fulltext` and omits the fulltext CRUD/search\n * methods, and the installation DDL never creates the fulltext table,\n * mirroring `vector: false`.\n */\n fulltext?: FulltextStrategy | false;\n}>;\n\n/**\n * Result of creating a local PGlite backend.\n */\nexport type LocalPgliteBackendResult = Readonly<{\n /**\n * The GraphBackend instance for use with createStore. Its `close()`\n * disposes the underlying PGlite engine.\n */\n backend: AdapterBackend<AnyPgTransaction>;\n\n /**\n * The underlying Drizzle database instance. Useful for direct SQL access.\n */\n db: PgliteDatabase;\n\n /**\n * The raw PGlite instance, for engine-specific operations such as\n * `dumpDataDir()` / `clone()` not surfaced through Drizzle.\n */\n client: PGlite;\n}>;\n\n// ============================================================\n// Vector extension loading\n// ============================================================\n\n/**\n * Dynamically loads the default pgvector extension from\n * `@electric-sql/pglite-pgvector`. Kept as a runtime import so the package\n * stays an optional peer dependency — callers using `vector: false` or\n * supplying their own extension never need it installed.\n */\nasync function loadDefaultPgvectorExtension(): Promise<Extension> {\n try {\n const module_ = await import(\"@electric-sql/pglite-pgvector\");\n return module_.vector;\n } catch (error) {\n throw new ConfigurationError(\n \"createLocalPgliteBackend needs the pgvector extension but \" +\n \"`@electric-sql/pglite-pgvector` could not be loaded. Install it \" +\n \"(`pnpm add @electric-sql/pglite-pgvector`), pass your own `vector` \" +\n \"extension, or set `vector: false` to disable vector support.\",\n { backend: \"pglite\", dependency: \"@electric-sql/pglite-pgvector\" },\n { cause: error },\n );\n }\n}\n\n// ============================================================\n// Factory Function\n// ============================================================\n\n/**\n * Creates a TypeGraph backend backed by an in-process PGlite database.\n *\n * Constructs the PGlite engine (loading pgvector unless disabled), executes\n * the schema DDL, and wires the standard Postgres backend. The returned\n * backend owns the engine: call `backend.close()` to dispose it.\n *\n * For production Postgres, or a PGlite instance you construct yourself,\n * use `createPostgresBackend` directly with your own Drizzle database — the\n * execution fast path detects PGlite and routes it correctly.\n *\n * @param options - Configuration options\n * @returns Backend, Drizzle database, and raw PGlite client\n */\nexport async function createLocalPgliteBackend(\n options: LocalPgliteBackendOptions = {},\n): Promise<LocalPgliteBackendResult> {\n const tables = options.tables ?? defaultTables;\n\n // pgvector lives in the WASM instance, so the extension must be passed at\n // construction — `CREATE EXTENSION vector` alone can't pull it in. An\n // explicitly supplied extension wins; `false` disables; otherwise load the\n // default package.\n const vectorExtension =\n options.vector === false ?\n undefined\n : (options.vector ?? (await loadDefaultPgvectorExtension()));\n const vectorEnabled = vectorExtension !== undefined;\n\n // Construct via the single options-object form (passing `dataDir` as a\n // field), not the positional `create(dataDir, options)` overload: with a\n // leading `undefined` dataDir, that overload silently drops `extensions`\n // (\"extension vector is not available\"). The options form loads them for\n // both the in-memory and on-disk cases.\n const client = await PGlite.create({\n ...(options.dataDir === undefined ? {} : { dataDir: options.dataDir }),\n ...(vectorExtension === undefined ?\n {}\n : { extensions: { vector: vectorExtension } }),\n });\n\n try {\n // `exec` runs a multi-statement batch (DDL + the pgvector `CREATE\n // EXTENSION` when enabled) in one round trip.\n const migrationSql =\n vectorEnabled ?\n generatePostgresMigrationSQL(tables, options.fulltext)\n : generateVectorlessPostgresMigrationSQL(tables, options.fulltext);\n await client.exec(migrationSql);\n\n const db = drizzle(client);\n const backend = createPostgresBackend(db, {\n tables,\n ...(vectorEnabled ? {} : { vector: false }),\n ...(options.fulltext === undefined ? {} : { fulltext: options.fulltext }),\n });\n const managedBackend = wrapWithManagedClose(backend, async () => {\n await client.close();\n });\n\n return {\n backend: markBundledRootAutocommitEligible(managedBackend),\n db,\n client,\n };\n } catch (error) {\n return closeAfterFailure(client, error);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/backend/postgres/pglite.ts"],"names":["ConfigurationError","tables","PGlite","generatePostgresMigrationSQL","generateVectorlessPostgresMigrationSQL","drizzle","createPostgresBackend","wrapWithManagedClose","markBundledRootAutocommitEligible","closeAfterFailure"],"mappings":";;;;;;;;;AAgJA,eAAe,4BAAA,GAAmD;AAChE,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAU,MAAM,OAAO,+BAA+B,CAAA;AAC5D,IAAA,OAAO,OAAA,CAAQ,MAAA;AAAA,EACjB,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,IAAIA,oCAAA;AAAA,MACR,2PAAA;AAAA,MAIA,EAAE,OAAA,EAAS,QAAA,EAAU,UAAA,EAAY,+BAAA,EAAgC;AAAA,MACjE,EAAE,OAAO,KAAA;AAAM,KACjB;AAAA,EACF;AACF;AAoBA,eAAsB,wBAAA,CACpB,OAAA,GAAqC,EAAC,EACH;AACnC,EAAA,MAAMC,OAAAA,GAAS,QAAQ,MAAA,IAAUA,wBAAA;AAMjC,EAAA,MAAM,eAAA,GACJ,QAAQ,MAAA,KAAW,KAAA,GACjB,SACC,OAAA,CAAQ,MAAA,IAAW,MAAM,4BAAA,EAA6B;AAC3D,EAAA,MAAM,gBAAgB,eAAA,KAAoB,MAAA;AAO1C,EAAA,MAAM,MAAA,GAAS,MAAMC,aAAA,CAAO,MAAA,CAAO;AAAA,IACjC,GAAI,QAAQ,OAAA,KAAY,MAAA,GAAY,EAAC,GAAI,EAAE,OAAA,EAAS,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACpE,GAAI,eAAA,KAAoB,MAAA,GACtB,EAAC,GACD,EAAE,UAAA,EAAY,EAAE,MAAA,EAAQ,eAAA,EAAgB;AAAE,GAC7C,CAAA;AAED,EAAA,IAAI;AAGF,IAAA,MAAM,YAAA,GACJ,aAAA,GACEC,8CAAA,CAA6BF,OAAAA,EAAQ,OAAA,CAAQ,QAAQ,CAAA,GACrDG,wDAAA,CAAuCH,OAAAA,EAAQ,OAAA,CAAQ,QAAQ,CAAA;AACnE,IAAA,MAAM,MAAA,CAAO,KAAK,YAAY,CAAA;AAE9B,IAAA,MAAM,EAAA,GAAKI,iBAAQ,MAAM,CAAA;AACzB,IAAA,MAAM,OAAA,GAAUC,wCAAsB,EAAA,EAAI;AAAA,MACxC,MAAA,EAAAL,OAAAA;AAAA,MACA,GAAI,aAAA,GAAgB,EAAC,GAAI,EAAE,QAAQ,KAAA,EAAM;AAAA,MACzC,GAAI,QAAQ,QAAA,KAAa,KAAA,CAAA,GAAY,EAAC,GAAI,EAAE,QAAA,EAAU,OAAA,CAAQ,QAAA;AAAS,KACxE,CAAA;AACD,IAAA,MAAM,cAAA,GAAiBM,sCAAA,CAAqB,OAAA,EAAS,YAAY;AAC/D,MAAA,MAAM,OAAO,KAAA,EAAM;AAAA,IACrB,CAAC,CAAA;AAED,IAAA,OAAO;AAAA,MACL,OAAA,EAASC,oDAAkC,cAAc,CAAA;AAAA,MACzD,EAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,OAAOC,mCAAA,CAAkB,QAAQ,KAAK,CAAA;AAAA,EACxC;AACF","file":"chunk-C2LSQ3SJ.cjs","sourcesContent":["/**\n * Local PGlite backend — Postgres-in-WASM, running in-process.\n *\n * [PGlite](https://pglite.dev/) is a full Postgres compiled to WebAssembly\n * that runs inside the Node/Bun/Deno/browser process with no server and no\n * native addon. This is the batteries-included Postgres analog of\n * `createLocalSqliteBackend`: it constructs a PGlite instance, loads the\n * pgvector extension, runs the schema DDL, and returns a ready\n * `{ backend, db }` pair whose `close()` disposes the engine.\n *\n * `@electric-sql/pglite` is an optional peer dependency. Vector support\n * additionally needs `@electric-sql/pglite-pgvector` (PGlite ≥ 0.5 ships\n * pgvector as a separate package). Install what you need:\n *\n * ```bash\n * pnpm add @electric-sql/pglite @electric-sql/pglite-pgvector\n * ```\n *\n * @example In-memory database (default, vector enabled)\n * ```typescript\n * import { createLocalPgliteBackend } from \"@nicia-ai/typegraph/adapters/drizzle/postgres/pglite\";\n *\n * const { backend } = await createLocalPgliteBackend();\n * const store = createStore(graph, backend);\n * ```\n *\n * @example Persistent on-disk database\n * ```typescript\n * const { backend, db } = await createLocalPgliteBackend({ dataDir: \"./pgdata\" });\n * ```\n *\n * @example No vector support (skip the pgvector extension)\n * ```typescript\n * const { backend } = await createLocalPgliteBackend({ vector: false });\n * ```\n *\n * PGlite is single-connection and serial: there is no pooling, so concurrent\n * `store.transaction()` calls queue rather than run in parallel.\n */\nimport { type Extension, PGlite } from \"@electric-sql/pglite\";\nimport { drizzle, type PgliteDatabase } from \"drizzle-orm/pglite\";\n\nimport { ConfigurationError } from \"../../errors\";\nimport { type FulltextStrategy } from \"../../query/dialect/fulltext-strategy\";\nimport { markBundledRootAutocommitEligible } from \"../capabilities/autocommit-single-statement\";\nimport { wrapWithManagedClose } from \"../derive-backend\";\nexport type { GraphIdentityConfig } from \"../../core/define-graph\";\nimport {\n generatePostgresMigrationSQL,\n generateVectorlessPostgresMigrationSQL,\n} from \"../drizzle/ddl\";\nimport { type AnyPgTransaction } from \"../drizzle/execution\";\nexport type { AnyPgDatabase, AnyPgTransaction } from \"../drizzle/execution\";\nimport {\n createPostgresBackend,\n type PostgresTables,\n tables as defaultTables,\n} from \"../drizzle/postgres\";\nimport { type AdapterBackend, closeAfterFailure } from \"../types\";\nexport type {\n ContributionDiagnostic,\n ContributionDiagnosticState,\n ContributionRepairEntry,\n ContributionRepairResult,\n} from \"../types\";\n\n// ============================================================\n// Types\n// ============================================================\n\n/**\n * Options for creating a local PGlite backend.\n */\nexport type LocalPgliteBackendOptions = Readonly<{\n /**\n * PGlite data directory. Omit for an in-memory database (the default).\n * Accepts any PGlite data-dir spec: a filesystem path (`\"./pgdata\"`),\n * `\"memory://\"`, or a browser/runtime-specific scheme such as\n * `\"idb://my-db\"`.\n */\n dataDir?: string;\n\n /**\n * Custom table definitions. Defaults to standard TypeGraph table names.\n */\n tables?: PostgresTables;\n\n /**\n * Controls the pgvector stack:\n *\n * - **omitted (default)** — load pgvector from `@electric-sql/pglite-pgvector`\n * and run `CREATE EXTENSION vector`, so embedding fields work out of the\n * box. Throws a {@link ConfigurationError} if the package isn't installed.\n * - **`false`** — skip the extension entirely; the backend advertises no\n * vector capability (mirroring a SQLite connection without sqlite-vec).\n * Use when a graph carries no embeddings, or to avoid the extension dep.\n * - **a PGlite `Extension`** — bring your own pgvector build or custom\n * extension packaging. Decouples this helper from a specific pgvector\n * package version.\n */\n vector?: false | Extension;\n\n /**\n * Override the fulltext strategy. Defaults to `tsvectorStrategy`. Pass\n * `false` to disable fulltext support entirely — the backend then\n * advertises no `capabilities.fulltext` and omits the fulltext CRUD/search\n * methods, and the installation DDL never creates the fulltext table,\n * mirroring `vector: false`.\n */\n fulltext?: FulltextStrategy | false;\n}>;\n\n/**\n * Result of creating a local PGlite backend.\n */\nexport type LocalPgliteBackendResult = Readonly<{\n /**\n * The GraphBackend instance for use with createStore. Its `close()`\n * disposes the underlying PGlite engine.\n */\n backend: AdapterBackend<AnyPgTransaction>;\n\n /**\n * The underlying Drizzle database instance. Useful for direct SQL access.\n */\n db: PgliteDatabase;\n\n /**\n * The raw PGlite instance, for engine-specific operations such as\n * `dumpDataDir()` / `clone()` not surfaced through Drizzle.\n */\n client: PGlite;\n}>;\n\n// ============================================================\n// Vector extension loading\n// ============================================================\n\n/**\n * Dynamically loads the default pgvector extension from\n * `@electric-sql/pglite-pgvector`. Kept as a runtime import so the package\n * stays an optional peer dependency — callers using `vector: false` or\n * supplying their own extension never need it installed.\n */\nasync function loadDefaultPgvectorExtension(): Promise<Extension> {\n try {\n const module_ = await import(\"@electric-sql/pglite-pgvector\");\n return module_.vector;\n } catch (error) {\n throw new ConfigurationError(\n \"createLocalPgliteBackend needs the pgvector extension but \" +\n \"`@electric-sql/pglite-pgvector` could not be loaded. Install it \" +\n \"(`pnpm add @electric-sql/pglite-pgvector`), pass your own `vector` \" +\n \"extension, or set `vector: false` to disable vector support.\",\n { backend: \"pglite\", dependency: \"@electric-sql/pglite-pgvector\" },\n { cause: error },\n );\n }\n}\n\n// ============================================================\n// Factory Function\n// ============================================================\n\n/**\n * Creates a TypeGraph backend backed by an in-process PGlite database.\n *\n * Constructs the PGlite engine (loading pgvector unless disabled), executes\n * the schema DDL, and wires the standard Postgres backend. The returned\n * backend owns the engine: call `backend.close()` to dispose it.\n *\n * For production Postgres, or a PGlite instance you construct yourself,\n * use `createPostgresBackend` directly with your own Drizzle database — the\n * execution fast path detects PGlite and routes it correctly.\n *\n * @param options - Configuration options\n * @returns Backend, Drizzle database, and raw PGlite client\n */\nexport async function createLocalPgliteBackend(\n options: LocalPgliteBackendOptions = {},\n): Promise<LocalPgliteBackendResult> {\n const tables = options.tables ?? defaultTables;\n\n // pgvector lives in the WASM instance, so the extension must be passed at\n // construction — `CREATE EXTENSION vector` alone can't pull it in. An\n // explicitly supplied extension wins; `false` disables; otherwise load the\n // default package.\n const vectorExtension =\n options.vector === false ?\n undefined\n : (options.vector ?? (await loadDefaultPgvectorExtension()));\n const vectorEnabled = vectorExtension !== undefined;\n\n // Construct via the single options-object form (passing `dataDir` as a\n // field), not the positional `create(dataDir, options)` overload: with a\n // leading `undefined` dataDir, that overload silently drops `extensions`\n // (\"extension vector is not available\"). The options form loads them for\n // both the in-memory and on-disk cases.\n const client = await PGlite.create({\n ...(options.dataDir === undefined ? {} : { dataDir: options.dataDir }),\n ...(vectorExtension === undefined ?\n {}\n : { extensions: { vector: vectorExtension } }),\n });\n\n try {\n // `exec` runs a multi-statement batch (DDL + the pgvector `CREATE\n // EXTENSION` when enabled) in one round trip.\n const migrationSql =\n vectorEnabled ?\n generatePostgresMigrationSQL(tables, options.fulltext)\n : generateVectorlessPostgresMigrationSQL(tables, options.fulltext);\n await client.exec(migrationSql);\n\n const db = drizzle(client);\n const backend = createPostgresBackend(db, {\n tables,\n ...(vectorEnabled ? {} : { vector: false }),\n ...(options.fulltext === undefined ? {} : { fulltext: options.fulltext }),\n });\n const managedBackend = wrapWithManagedClose(backend, async () => {\n await client.close();\n });\n\n return {\n backend: markBundledRootAutocommitEligible(managedBackend),\n db,\n client,\n };\n } catch (error) {\n return closeAfterFailure(client, error);\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkGSRUQXYE_cjs = require('./chunk-GSRUQXYE.cjs');
3
+ var chunkG72YXUND_cjs = require('./chunk-G72YXUND.cjs');
4
4
  var chunkYKFKW6BC_cjs = require('./chunk-YKFKW6BC.cjs');
5
5
  var chunkD2U6E77Y_cjs = require('./chunk-D2U6E77Y.cjs');
6
6
  var chunk3DERXVTU_cjs = require('./chunk-3DERXVTU.cjs');
@@ -11,7 +11,7 @@ var chunk6XJBQIWQ_cjs = require('./chunk-6XJBQIWQ.cjs');
11
11
  var chunk4ACC3PJC_cjs = require('./chunk-4ACC3PJC.cjs');
12
12
  var chunkA2NZH6JQ_cjs = require('./chunk-A2NZH6JQ.cjs');
13
13
  var chunkRAN6YI6S_cjs = require('./chunk-RAN6YI6S.cjs');
14
- var chunkB2FYH5VR_cjs = require('./chunk-B2FYH5VR.cjs');
14
+ var chunk2GXLAV4H_cjs = require('./chunk-2GXLAV4H.cjs');
15
15
  var chunkZY4GXIVN_cjs = require('./chunk-ZY4GXIVN.cjs');
16
16
  var chunk7LGA7PK2_cjs = require('./chunk-7LGA7PK2.cjs');
17
17
  var chunkBBKTJ427_cjs = require('./chunk-BBKTJ427.cjs');
@@ -460,7 +460,7 @@ var DEFAULT_TABLE_NAMES = {
460
460
  function createPostgresTables(names = {}, options = {}) {
461
461
  const n = { ...DEFAULT_TABLE_NAMES, ...names };
462
462
  const indexes = options.indexes ?? [];
463
- chunkB2FYH5VR_cjs.assertNoSystemIndexNameCollision(indexes, n);
463
+ chunk2GXLAV4H_cjs.assertNoSystemIndexNameCollision(indexes, n);
464
464
  const nodes3 = pgCore.pgTable(
465
465
  n.nodes,
466
466
  {
@@ -479,8 +479,8 @@ function createPostgresTables(names = {}, options = {}) {
479
479
  pgCore.primaryKey({ columns: [t.graphId, t.kind, t.id] }),
480
480
  // System indexes come from SYSTEM_INDEX_DECLARATIONS (single source
481
481
  // for both dialects + the runtime materializer).
482
- ...chunkGSRUQXYE_cjs.buildPostgresSystemIndexBuilders("nodes", n.nodes, t),
483
- ...chunkGSRUQXYE_cjs.buildPostgresNodeIndexBuilders(t, indexes)
482
+ ...chunkG72YXUND_cjs.buildPostgresSystemIndexBuilders("nodes", n.nodes, t),
483
+ ...chunkG72YXUND_cjs.buildPostgresNodeIndexBuilders(t, indexes)
484
484
  ]
485
485
  );
486
486
  const edges3 = pgCore.pgTable(
@@ -504,18 +504,18 @@ function createPostgresTables(names = {}, options = {}) {
504
504
  },
505
505
  (t) => [
506
506
  pgCore.primaryKey({ columns: [t.graphId, t.id] }),
507
- pgCore.uniqueIndex(chunkB2FYH5VR_cjs.systemIndexName(n.edges, "match_identity_uq")).on(
507
+ pgCore.uniqueIndex(chunk2GXLAV4H_cjs.systemIndexName(n.edges, "match_identity_uq")).on(
508
508
  t.graphId,
509
509
  t.kind,
510
510
  t.matchIdentityName,
511
511
  t.matchIdentityKey
512
512
  ),
513
513
  pgCore.check(
514
- chunkB2FYH5VR_cjs.systemIndexName(n.edges, "match_identity_pair_check"),
514
+ chunk2GXLAV4H_cjs.systemIndexName(n.edges, "match_identity_pair_check"),
515
515
  drizzleOrm.sql`(${t.matchIdentityName} IS NULL) = (${t.matchIdentityKey} IS NULL)`
516
516
  ),
517
- ...chunkGSRUQXYE_cjs.buildPostgresSystemIndexBuilders("edges", n.edges, t),
518
- ...chunkGSRUQXYE_cjs.buildPostgresEdgeIndexBuilders(t, indexes)
517
+ ...chunkG72YXUND_cjs.buildPostgresSystemIndexBuilders("edges", n.edges, t),
518
+ ...chunkG72YXUND_cjs.buildPostgresEdgeIndexBuilders(t, indexes)
519
519
  ]
520
520
  );
521
521
  const recordedNodes3 = pgCore.pgTable(
@@ -541,7 +541,7 @@ function createPostgresTables(names = {}, options = {}) {
541
541
  },
542
542
  (t) => [
543
543
  pgCore.primaryKey({ columns: [t.historyId] }),
544
- ...chunkGSRUQXYE_cjs.buildPostgresSystemIndexBuilders("recordedNodes", n.recordedNodes, t)
544
+ ...chunkG72YXUND_cjs.buildPostgresSystemIndexBuilders("recordedNodes", n.recordedNodes, t)
545
545
  ]
546
546
  );
547
547
  const recordedEdges3 = pgCore.pgTable(
@@ -570,7 +570,7 @@ function createPostgresTables(names = {}, options = {}) {
570
570
  },
571
571
  (t) => [
572
572
  pgCore.primaryKey({ columns: [t.historyId] }),
573
- ...chunkGSRUQXYE_cjs.buildPostgresSystemIndexBuilders("recordedEdges", n.recordedEdges, t)
573
+ ...chunkG72YXUND_cjs.buildPostgresSystemIndexBuilders("recordedEdges", n.recordedEdges, t)
574
574
  ]
575
575
  );
576
576
  const recordedClock3 = pgCore.pgTable(
@@ -681,7 +681,7 @@ function createPostgresTables(names = {}, options = {}) {
681
681
  // `a_idx`/`b_idx` all lead with an endpoint, not `recorded_from`
682
682
  // alone, so none can serve `changesSince`'s per-revision completeness
683
683
  // scan (`store/recorded-capture/lineage.ts`) without a full table scan.
684
- pgCore.index(chunkB2FYH5VR_cjs.systemIndexName(n.recordedIdentityAssertions, "since_idx")).on(
684
+ pgCore.index(chunk2GXLAV4H_cjs.systemIndexName(n.recordedIdentityAssertions, "since_idx")).on(
685
685
  t.graphId,
686
686
  t.recordedFrom
687
687
  )
@@ -771,7 +771,7 @@ function createPostgresTables(names = {}, options = {}) {
771
771
  (t) => [
772
772
  pgCore.primaryKey({ columns: [t.installation] }),
773
773
  pgCore.check(
774
- chunkB2FYH5VR_cjs.systemIndexName(n.baseSchemaVersions, "singleton_check"),
774
+ chunk2GXLAV4H_cjs.systemIndexName(n.baseSchemaVersions, "singleton_check"),
775
775
  drizzleOrm.sql`${t.installation} = 1`
776
776
  )
777
777
  ]
@@ -958,7 +958,7 @@ var DEFAULT_TABLE_NAMES2 = {
958
958
  function createSqliteTables(names = {}, options = {}) {
959
959
  const n = { ...DEFAULT_TABLE_NAMES2, ...names };
960
960
  const indexes = options.indexes ?? [];
961
- chunkB2FYH5VR_cjs.assertNoSystemIndexNameCollision(indexes, n);
961
+ chunk2GXLAV4H_cjs.assertNoSystemIndexNameCollision(indexes, n);
962
962
  const nodes3 = sqliteCore.sqliteTable(
963
963
  n.nodes,
964
964
  {
@@ -977,8 +977,8 @@ function createSqliteTables(names = {}, options = {}) {
977
977
  sqliteCore.primaryKey({ columns: [t.graphId, t.kind, t.id] }),
978
978
  // System indexes come from SYSTEM_INDEX_DECLARATIONS (single source
979
979
  // for both dialects + the runtime materializer).
980
- ...chunkGSRUQXYE_cjs.buildSqliteSystemIndexBuilders("nodes", n.nodes, t),
981
- ...chunkGSRUQXYE_cjs.buildSqliteNodeIndexBuilders(t, indexes)
980
+ ...chunkG72YXUND_cjs.buildSqliteSystemIndexBuilders("nodes", n.nodes, t),
981
+ ...chunkG72YXUND_cjs.buildSqliteNodeIndexBuilders(t, indexes)
982
982
  ]
983
983
  );
984
984
  const edges3 = sqliteCore.sqliteTable(
@@ -1002,18 +1002,18 @@ function createSqliteTables(names = {}, options = {}) {
1002
1002
  },
1003
1003
  (t) => [
1004
1004
  sqliteCore.primaryKey({ columns: [t.graphId, t.id] }),
1005
- sqliteCore.uniqueIndex(chunkB2FYH5VR_cjs.systemIndexName(n.edges, "match_identity_uq")).on(
1005
+ sqliteCore.uniqueIndex(chunk2GXLAV4H_cjs.systemIndexName(n.edges, "match_identity_uq")).on(
1006
1006
  t.graphId,
1007
1007
  t.kind,
1008
1008
  t.matchIdentityName,
1009
1009
  t.matchIdentityKey
1010
1010
  ),
1011
1011
  sqliteCore.check(
1012
- chunkB2FYH5VR_cjs.systemIndexName(n.edges, "match_identity_pair_check"),
1012
+ chunk2GXLAV4H_cjs.systemIndexName(n.edges, "match_identity_pair_check"),
1013
1013
  drizzleOrm.sql`(${t.matchIdentityName} IS NULL) = (${t.matchIdentityKey} IS NULL)`
1014
1014
  ),
1015
- ...chunkGSRUQXYE_cjs.buildSqliteSystemIndexBuilders("edges", n.edges, t),
1016
- ...chunkGSRUQXYE_cjs.buildSqliteEdgeIndexBuilders(t, indexes)
1015
+ ...chunkG72YXUND_cjs.buildSqliteSystemIndexBuilders("edges", n.edges, t),
1016
+ ...chunkG72YXUND_cjs.buildSqliteEdgeIndexBuilders(t, indexes)
1017
1017
  ]
1018
1018
  );
1019
1019
  const recordedNodes3 = sqliteCore.sqliteTable(
@@ -1039,7 +1039,7 @@ function createSqliteTables(names = {}, options = {}) {
1039
1039
  },
1040
1040
  (t) => [
1041
1041
  sqliteCore.primaryKey({ columns: [t.historyId] }),
1042
- ...chunkGSRUQXYE_cjs.buildSqliteSystemIndexBuilders("recordedNodes", n.recordedNodes, t)
1042
+ ...chunkG72YXUND_cjs.buildSqliteSystemIndexBuilders("recordedNodes", n.recordedNodes, t)
1043
1043
  ]
1044
1044
  );
1045
1045
  const recordedEdges3 = sqliteCore.sqliteTable(
@@ -1068,7 +1068,7 @@ function createSqliteTables(names = {}, options = {}) {
1068
1068
  },
1069
1069
  (t) => [
1070
1070
  sqliteCore.primaryKey({ columns: [t.historyId] }),
1071
- ...chunkGSRUQXYE_cjs.buildSqliteSystemIndexBuilders("recordedEdges", n.recordedEdges, t)
1071
+ ...chunkG72YXUND_cjs.buildSqliteSystemIndexBuilders("recordedEdges", n.recordedEdges, t)
1072
1072
  ]
1073
1073
  );
1074
1074
  const recordedClock3 = sqliteCore.sqliteTable(
@@ -1179,7 +1179,7 @@ function createSqliteTables(names = {}, options = {}) {
1179
1179
  // `a_idx`/`b_idx` all lead with an endpoint, not `recorded_from`
1180
1180
  // alone, so none can serve `changesSince`'s per-revision completeness
1181
1181
  // scan (`store/recorded-capture/lineage.ts`) without a full table scan.
1182
- sqliteCore.index(chunkB2FYH5VR_cjs.systemIndexName(n.recordedIdentityAssertions, "since_idx")).on(
1182
+ sqliteCore.index(chunk2GXLAV4H_cjs.systemIndexName(n.recordedIdentityAssertions, "since_idx")).on(
1183
1183
  t.graphId,
1184
1184
  t.recordedFrom
1185
1185
  )
@@ -1269,7 +1269,7 @@ function createSqliteTables(names = {}, options = {}) {
1269
1269
  (t) => [
1270
1270
  sqliteCore.primaryKey({ columns: [t.installation] }),
1271
1271
  sqliteCore.check(
1272
- chunkB2FYH5VR_cjs.systemIndexName(n.baseSchemaVersions, "singleton_check"),
1272
+ chunk2GXLAV4H_cjs.systemIndexName(n.baseSchemaVersions, "singleton_check"),
1273
1273
  drizzleOrm.sql`${t.installation} = 1`
1274
1274
  )
1275
1275
  ]
@@ -1423,10 +1423,10 @@ function postgresIdentifierRegclassName(identifier) {
1423
1423
  return quoteDdlIdentifier(identifier);
1424
1424
  }
1425
1425
  function edgeMatchIdentityUniqueIndexName(tableName) {
1426
- return chunkB2FYH5VR_cjs.systemIndexName(tableName, "match_identity_uq");
1426
+ return chunk2GXLAV4H_cjs.systemIndexName(tableName, "match_identity_uq");
1427
1427
  }
1428
1428
  function edgeMatchIdentityPairCheckName(tableName) {
1429
- return chunkB2FYH5VR_cjs.systemIndexName(tableName, "match_identity_pair_check");
1429
+ return chunk2GXLAV4H_cjs.systemIndexName(tableName, "match_identity_pair_check");
1430
1430
  }
1431
1431
  function generatePostgresEdgeMatchIdentityUpgradeDDL(tableName) {
1432
1432
  const table = quoteDdlIdentifier(tableName);
@@ -2976,12 +2976,12 @@ function buildLockSchemaVersionAndGraphWrite(tables3, params, advisoryLockNamesp
2976
2976
  FOR SHARE
2977
2977
  ),
2978
2978
  "graph_write_lock" AS MATERIALIZED (
2979
- SELECT ${chunkGSRUQXYE_cjs.toDrizzleSql(advisoryLockExpression(advisoryLockNamespace, params.graphId), "postgres")} AS "lock_token"
2979
+ SELECT ${chunkG72YXUND_cjs.toDrizzleSql(advisoryLockExpression(advisoryLockNamespace, params.graphId), "postgres")} AS "lock_token"
2980
2980
  FROM "schema_fence"
2981
2981
  )
2982
2982
  SELECT
2983
2983
  TRUE AS "fence_acquired",
2984
- ${chunkGSRUQXYE_cjs.toDrizzleSql(isolationFactExpression(), "postgres")} AS "transaction_isolation"
2984
+ ${chunkG72YXUND_cjs.toDrizzleSql(isolationFactExpression(), "postgres")} AS "transaction_isolation"
2985
2985
  FROM "graph_write_lock"
2986
2986
  `;
2987
2987
  }
@@ -3031,7 +3031,7 @@ function existingColumn(dialect, tableName, columnName) {
3031
3031
  return EXISTING_COLUMN_QUALIFIERS[dialect](tableName, columnName);
3032
3032
  }
3033
3033
  function codePointOrderKey(column, dialect) {
3034
- return chunkGSRUQXYE_cjs.toDrizzleSql(chunk7LGA7PK2_cjs.getDialect(dialect).binaryText(column), dialect);
3034
+ return chunkG72YXUND_cjs.toDrizzleSql(chunk7LGA7PK2_cjs.getDialect(dialect).binaryText(column), dialect);
3035
3035
  }
3036
3036
  function liveNodeIdsSubquery(nodes3, graphId, nodeKind, nowIso2) {
3037
3037
  return drizzleOrm.sql`SELECT ${nodes3.id} AS node_id FROM ${nodes3} WHERE ${nodes3.graphId} = ${graphId} AND ${nodes3.kind} = ${nodeKind} AND ${nodes3.deletedAt} IS NULL AND (${nodes3.validFrom} IS NULL OR ${nodes3.validFrom} <= ${nowIso2}) AND (${nodes3.validTo} IS NULL OR ${nodes3.validTo} > ${nowIso2})`;
@@ -5211,11 +5211,11 @@ function buildFulltextSearch(tableName, params, strategy, dialect, candidates) {
5211
5211
  assertValidSearchParams(params);
5212
5212
  const mode = resolveMode(params.mode);
5213
5213
  const table = quotedTableName(tableName);
5214
- const matchCondition = chunkGSRUQXYE_cjs.toDrizzleSql(
5214
+ const matchCondition = chunkG72YXUND_cjs.toDrizzleSql(
5215
5215
  strategy.matchCondition(tableName, params.query, mode, params.language),
5216
5216
  dialect
5217
5217
  );
5218
- const rankExpression = chunkGSRUQXYE_cjs.toDrizzleSql(
5218
+ const rankExpression = chunkG72YXUND_cjs.toDrizzleSql(
5219
5219
  strategy.rankExpression(tableName, params.query, mode, params.language),
5220
5220
  dialect
5221
5221
  );
@@ -5228,10 +5228,10 @@ function buildFulltextSearch(tableName, params, strategy, dialect, candidates) {
5228
5228
  conditions.push(drizzleOrm.sql`${rankExpression} >= ${params.minScore}`);
5229
5229
  }
5230
5230
  if (candidates !== void 0) {
5231
- const candidateSql = chunkXOKNPHQR_cjs.isSqlFragment(candidates) ? chunkGSRUQXYE_cjs.toDrizzleSql(candidates, dialect) : candidates;
5231
+ const candidateSql = chunkXOKNPHQR_cjs.isSqlFragment(candidates) ? chunkG72YXUND_cjs.toDrizzleSql(candidates, dialect) : candidates;
5232
5232
  conditions.push(drizzleOrm.sql`"node_id" IN (${candidateSql})`);
5233
5233
  }
5234
- const snippetExpr = params.includeSnippets === true && strategy.supportsSnippets ? chunkGSRUQXYE_cjs.toDrizzleSql(
5234
+ const snippetExpr = params.includeSnippets === true && strategy.supportsSnippets ? chunkG72YXUND_cjs.toDrizzleSql(
5235
5235
  strategy.snippetExpression(
5236
5236
  tableName,
5237
5237
  params.query,
@@ -6014,7 +6014,7 @@ function buildNodeExpectationPredicate(adapter, propsColumn, property, expectati
6014
6014
  function buildUpdateNodeSet(tables3, dialect, params, timestamp2) {
6015
6015
  const { nodes: nodes3 } = tables3;
6016
6016
  const adapter = chunk7LGA7PK2_cjs.getDialect(dialect);
6017
- const patchedProps = chunkGSRUQXYE_cjs.toDrizzleSql(
6017
+ const patchedProps = chunkG72YXUND_cjs.toDrizzleSql(
6018
6018
  adapter.jsonSetProperties(
6019
6019
  chunkXOKNPHQR_cjs.sql.identifier(nodes3.props.name),
6020
6020
  params.patch,
@@ -6022,14 +6022,14 @@ function buildUpdateNodeSet(tables3, dialect, params, timestamp2) {
6022
6022
  ),
6023
6023
  dialect
6024
6024
  );
6025
- const candidateIds = chunkGSRUQXYE_cjs.toDrizzleSql(params.candidateIds, dialect);
6026
- const candidateIdColumn = chunkGSRUQXYE_cjs.toDrizzleSql(
6025
+ const candidateIds = chunkG72YXUND_cjs.toDrizzleSql(params.candidateIds, dialect);
6026
+ const candidateIdColumn = chunkG72YXUND_cjs.toDrizzleSql(
6027
6027
  chunkXOKNPHQR_cjs.sql.identifier(params.candidateIdColumn),
6028
6028
  dialect
6029
6029
  );
6030
6030
  const propsColumn = chunkXOKNPHQR_cjs.sql.identifier(nodes3.props.name);
6031
6031
  const expectedPredicates = params.operation === "compareAndSet" ? Object.entries(params.expected).map(
6032
- ([property, expectation]) => chunkGSRUQXYE_cjs.toDrizzleSql(
6032
+ ([property, expectation]) => chunkG72YXUND_cjs.toDrizzleSql(
6033
6033
  buildNodeExpectationPredicate(
6034
6034
  adapter,
6035
6035
  propsColumn,
@@ -6539,7 +6539,7 @@ function buildAtomicNodeProjectionStatements(creates, updates, timestamp2, diale
6539
6539
  fulltextTableName,
6540
6540
  { graphId: group.graphId, nodeKind: group.nodeKind, rows },
6541
6541
  timestamp2
6542
- ) ?? []).map((statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect))
6542
+ ) ?? []).map((statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect))
6543
6543
  );
6544
6544
  }
6545
6545
  for (const nodeIds of chunk6XJBQIWQ_cjs.chunk(group.deletes, chunkSize)) {
@@ -6548,7 +6548,7 @@ function buildAtomicNodeProjectionStatements(creates, updates, timestamp2, diale
6548
6548
  graphId: group.graphId,
6549
6549
  nodeKind: group.nodeKind,
6550
6550
  nodeIds
6551
- }) ?? []).map((statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect))
6551
+ }) ?? []).map((statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect))
6552
6552
  );
6553
6553
  }
6554
6554
  }
@@ -6570,7 +6570,7 @@ function buildAtomicNodeProjectionStatements(creates, updates, timestamp2, diale
6570
6570
  timestamp2
6571
6571
  );
6572
6572
  statements.push(
6573
- ...fragments.map((statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect))
6573
+ ...fragments.map((statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect))
6574
6574
  );
6575
6575
  }
6576
6576
  for (const nodeIds of chunk6XJBQIWQ_cjs.chunk(group.deletes, chunkSize)) {
@@ -6578,7 +6578,7 @@ function buildAtomicNodeProjectionStatements(creates, updates, timestamp2, diale
6578
6578
  ...(vectorStrategy?.buildDeleteBatch(group.slot, {
6579
6579
  ...group.slot,
6580
6580
  nodeIds
6581
- }) ?? []).map((statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect))
6581
+ }) ?? []).map((statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect))
6582
6582
  );
6583
6583
  }
6584
6584
  }
@@ -7036,7 +7036,7 @@ function buildProjectionSql(params, plan, timestamp2, dialect, fulltextTableName
7036
7036
  case "fulltext": {
7037
7037
  if (fulltextBuilder === void 0) return;
7038
7038
  projectionSql.push(
7039
- chunkGSRUQXYE_cjs.toDrizzleSql(
7039
+ chunkG72YXUND_cjs.toDrizzleSql(
7040
7040
  fulltextBuilder(
7041
7041
  fulltextTableName,
7042
7042
  INSERTED_NODE_PROJECTION_CTE_ALIAS,
@@ -7051,7 +7051,7 @@ function buildProjectionSql(params, plan, timestamp2, dialect, fulltextTableName
7051
7051
  case "embedding": {
7052
7052
  if (vectorStrategy === void 0 || vectorBuilder === void 0) return;
7053
7053
  projectionSql.push(
7054
- chunkGSRUQXYE_cjs.toDrizzleSql(
7054
+ chunkG72YXUND_cjs.toDrizzleSql(
7055
7055
  vectorBuilder(
7056
7056
  {
7057
7057
  graphId: params.graphId,
@@ -7302,19 +7302,19 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy, vecto
7302
7302
  chunkSize
7303
7303
  ),
7304
7304
  buildUpsertFulltext: (params, timestamp2) => (fulltextStrategy?.buildUpsert(fulltextTable, params, timestamp2) ?? []).map(
7305
- (statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect)
7305
+ (statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect)
7306
7306
  ),
7307
7307
  buildDeleteFulltext: (params) => (fulltextStrategy?.buildDelete(fulltextTable, params) ?? []).map(
7308
- (statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect)
7308
+ (statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect)
7309
7309
  ),
7310
7310
  buildDeleteFulltextByNode: (graphId, nodeKind, nodeId) => (fulltextStrategy?.buildDelete(fulltextTable, {
7311
7311
  graphId,
7312
7312
  nodeKind,
7313
7313
  nodeId
7314
- }) ?? []).map((statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect)),
7315
- buildUpsertFulltextBatch: (params, timestamp2) => (fulltextStrategy?.buildBatchUpsert(fulltextTable, params, timestamp2) ?? []).map((statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect)),
7314
+ }) ?? []).map((statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect)),
7315
+ buildUpsertFulltextBatch: (params, timestamp2) => (fulltextStrategy?.buildBatchUpsert(fulltextTable, params, timestamp2) ?? []).map((statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect)),
7316
7316
  buildDeleteFulltextBatch: (params) => (fulltextStrategy?.buildBatchDelete(fulltextTable, params) ?? []).map(
7317
- (statement) => chunkGSRUQXYE_cjs.toDrizzleSql(statement, dialect)
7317
+ (statement) => chunkG72YXUND_cjs.toDrizzleSql(statement, dialect)
7318
7318
  ),
7319
7319
  buildFulltextSearch: (params) => buildFulltextSearch(
7320
7320
  fulltextTable,
@@ -7362,7 +7362,7 @@ function createCommonOperationStrategy(tables3, dialect, fulltextStrategy, vecto
7362
7362
  hybridCandidatesRef()
7363
7363
  );
7364
7364
  return buildHybridSearchStatement({
7365
- candidatesSql: chunkXOKNPHQR_cjs.isSqlFragment(candidates) ? chunkGSRUQXYE_cjs.toDrizzleSql(candidates, dialect) : candidates,
7365
+ candidatesSql: chunkXOKNPHQR_cjs.isSqlFragment(candidates) ? chunkG72YXUND_cjs.toDrizzleSql(candidates, dialect) : candidates,
7366
7366
  vectorSql,
7367
7367
  vectorScoreDescending,
7368
7368
  fulltextSql,
@@ -13066,7 +13066,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
13066
13066
  );
13067
13067
  const canOpenInteractiveAtomicBatch = options.interactiveAtomicBatch === true && neonHttpClient === void 0 && pgClient !== void 0 && options.useTransactionClient !== true && isRecognizedInteractivePostgresDatabase(db) && hasFunctionProperty(db, "transaction");
13068
13068
  function compile(query) {
13069
- return chunkGSRUQXYE_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
13069
+ return chunkG72YXUND_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
13070
13070
  }
13071
13071
  function assertCompiledWithinBindParameterLimit(compiledQuery) {
13072
13072
  assertWithinBindParameterLimit(
@@ -13127,7 +13127,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
13127
13127
  assertCompiledWithinBindParameterLimit(compile(query));
13128
13128
  return executeDrizzleQuery(
13129
13129
  db,
13130
- chunkXOKNPHQR_cjs.isSqlFragment(query) ? chunkGSRUQXYE_cjs.toDrizzleSql(query, "postgres") : query
13130
+ chunkXOKNPHQR_cjs.isSqlFragment(query) ? chunkG72YXUND_cjs.toDrizzleSql(query, "postgres") : query
13131
13131
  );
13132
13132
  },
13133
13133
  ...executeAtomicBatch === void 0 ? {} : { executeAtomicBatch }
@@ -14062,7 +14062,7 @@ function buildPostgresEngineProfile(db, options = {}) {
14062
14062
  drizzleOrm.getTableName(tables3.uniques),
14063
14063
  ...fulltextStrategy === void 0 ? [] : [tableNames.fulltext]
14064
14064
  ].map(
14065
- (name) => chunkGSRUQXYE_cjs.toDrizzleSql(
14065
+ (name) => chunkG72YXUND_cjs.toDrizzleSql(
14066
14066
  chunkXOKNPHQR_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkXOKNPHQR_cjs.sql.identifier(name)}`,
14067
14067
  "postgres"
14068
14068
  )
@@ -14118,7 +14118,7 @@ function buildPostgresEngineProfile(db, options = {}) {
14118
14118
  await withConcurrentCreateRetry(async () => {
14119
14119
  await db.transaction(async (tx) => {
14120
14120
  await tx.execute(
14121
- chunkGSRUQXYE_cjs.toDrizzleSql(
14121
+ chunkG72YXUND_cjs.toDrizzleSql(
14122
14122
  fencePlan.sql.acquireKeyed(extensionDdlLockKey(validated), 0),
14123
14123
  "postgres"
14124
14124
  )
@@ -14362,13 +14362,17 @@ function buildPostgresEngineProfile(db, options = {}) {
14362
14362
  writeVersion: writeBaseSchemaVersion,
14363
14363
  ensureEdgeMatchIdentityStorage,
14364
14364
  fencesTableDdl: generatePgCreateTableSQL(tables3.fences),
14365
- sinceIndexDdl: chunkB2FYH5VR_cjs.sinceIndexAdoptionDdl({
14366
- recordedNodes: drizzleOrm.getTableName(tables3.recordedNodes),
14367
- recordedEdges: drizzleOrm.getTableName(tables3.recordedEdges),
14368
- recordedIdentityAssertions: drizzleOrm.getTableName(
14369
- tables3.recordedIdentityAssertions
14370
- )
14371
- })
14365
+ sinceIndexDdl: [
14366
+ generatePgCreateTableSQL(tables3.recordedIdentityAssertions),
14367
+ ...generatePgCreateIndexSQL(tables3.recordedIdentityAssertions),
14368
+ ...chunk2GXLAV4H_cjs.sinceIndexAdoptionDdl({
14369
+ recordedNodes: drizzleOrm.getTableName(tables3.recordedNodes),
14370
+ recordedEdges: drizzleOrm.getTableName(tables3.recordedEdges),
14371
+ recordedIdentityAssertions: drizzleOrm.getTableName(
14372
+ tables3.recordedIdentityAssertions
14373
+ )
14374
+ })
14375
+ ]
14372
14376
  };
14373
14377
  const indexMaterializationRuntime = {
14374
14378
  indexMaterializationsTableDdl: generatePgCreateTableSQL(
@@ -14436,7 +14440,7 @@ function buildPostgresEngineProfile(db, options = {}) {
14436
14440
  switch (plan.kind) {
14437
14441
  case "lock": {
14438
14442
  await tx.execute(
14439
- chunkGSRUQXYE_cjs.toDrizzleSql(
14443
+ chunkG72YXUND_cjs.toDrizzleSql(
14440
14444
  chunkXOKNPHQR_cjs.sql`SELECT ${chunk6XJBQIWQ_cjs.advisoryLockSingleExpression(graphId)}`,
14441
14445
  "postgres"
14442
14446
  )
@@ -14452,7 +14456,7 @@ function buildPostgresEngineProfile(db, options = {}) {
14452
14456
  }
14453
14457
  case "row": {
14454
14458
  await tx.execute(
14455
- chunkGSRUQXYE_cjs.toDrizzleSql(
14459
+ chunkG72YXUND_cjs.toDrizzleSql(
14456
14460
  plan.sql.acquireKeyed(SCHEMA_COMMIT_FENCE_NAMESPACE, graphId),
14457
14461
  "postgres"
14458
14462
  )
@@ -14623,7 +14627,7 @@ function buildPostgresEngineProfile(db, options = {}) {
14623
14627
  const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
14624
14628
  for (const tableName of presentGuardedTables) {
14625
14629
  await db.execute(
14626
- chunkGSRUQXYE_cjs.toDrizzleSql(
14630
+ chunkG72YXUND_cjs.toDrizzleSql(
14627
14631
  chunkXOKNPHQR_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkXOKNPHQR_cjs.sql.identifier(tableName)}`,
14628
14632
  "postgres"
14629
14633
  )
@@ -15081,7 +15085,7 @@ function createPostgresOperationBackend(options) {
15081
15085
  );
15082
15086
  const statement = operationStrategy.buildHybridSearch(
15083
15087
  { ...params, candidates },
15084
- chunkGSRUQXYE_cjs.toDrizzleSql(vectorSql, "postgres"),
15088
+ chunkG72YXUND_cjs.toDrizzleSql(vectorSql, "postgres"),
15085
15089
  params.vector.metric === "cosine"
15086
15090
  );
15087
15091
  const gucOverrides = await vectorSearchGucOverrides({
@@ -15109,7 +15113,7 @@ function createPostgresOperationBackend(options) {
15109
15113
  );
15110
15114
  if (plan.kind === "row") {
15111
15115
  await execRun(
15112
- chunkGSRUQXYE_cjs.toDrizzleSql(
15116
+ chunkG72YXUND_cjs.toDrizzleSql(
15113
15117
  plan.sql.acquireKeyed(SCHEMA_COMMIT_FENCE_NAMESPACE, graphId),
15114
15118
  "postgres"
15115
15119
  )
@@ -15503,7 +15507,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
15503
15507
  supportsCompiledExecution: sqliteClient !== void 0,
15504
15508
  transactionMode
15505
15509
  };
15506
- const compile = (query) => chunkGSRUQXYE_cjs.compileQueryWithDialect(db, query, "SQLite");
15510
+ const compile = (query) => chunkG72YXUND_cjs.compileQueryWithDialect(db, query, "SQLite");
15507
15511
  const executeAtomicBatch = atomicBatchClient === void 0 ? void 0 : (async function executeSqliteAtomicBatch(statements) {
15508
15512
  for (const statement of statements) {
15509
15513
  assertBatchStatementWithinBindLimit(statement, maxBindParameters);
@@ -15596,7 +15600,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
15596
15600
  execute(query) {
15597
15601
  return executeDrizzleQuery2(
15598
15602
  db,
15599
- chunkXOKNPHQR_cjs.isSqlFragment(query) ? chunkGSRUQXYE_cjs.toDrizzleSql(query, "sqlite") : query
15603
+ chunkXOKNPHQR_cjs.isSqlFragment(query) ? chunkG72YXUND_cjs.toDrizzleSql(query, "sqlite") : query
15600
15604
  );
15601
15605
  },
15602
15606
  ...executeAtomicBatch === void 0 ? {} : { executeAtomicBatch },
@@ -15845,7 +15849,7 @@ function createSqliteOperationBackend(options) {
15845
15849
  return runWithSerializedQueue(serializedQueue, async () => {
15846
15850
  if (compiledRun === void 0) {
15847
15851
  await db.run(
15848
- chunkXOKNPHQR_cjs.isSqlFragment(query) ? chunkGSRUQXYE_cjs.toDrizzleSql(query, "sqlite") : query
15852
+ chunkXOKNPHQR_cjs.isSqlFragment(query) ? chunkG72YXUND_cjs.toDrizzleSql(query, "sqlite") : query
15849
15853
  );
15850
15854
  return;
15851
15855
  }
@@ -15969,7 +15973,7 @@ function createSqliteOperationBackend(options) {
15969
15973
  );
15970
15974
  const statement = operationStrategy.buildHybridSearch(
15971
15975
  { ...params, candidates },
15972
- chunkGSRUQXYE_cjs.toDrizzleSql(vectorSql, "sqlite"),
15976
+ chunkG72YXUND_cjs.toDrizzleSql(vectorSql, "sqlite"),
15973
15977
  params.vector.metric === "cosine"
15974
15978
  );
15975
15979
  let raw;
@@ -15999,7 +16003,7 @@ function createSqliteOperationBackend(options) {
15999
16003
  );
16000
16004
  if (plan.kind === "row") {
16001
16005
  await execRun(
16002
- chunkGSRUQXYE_cjs.toDrizzleSql(
16006
+ chunkG72YXUND_cjs.toDrizzleSql(
16003
16007
  plan.sql.acquireKeyed(SCHEMA_COMMIT_FENCE_NAMESPACE2, params.graphId),
16004
16008
  "sqlite"
16005
16009
  )
@@ -16330,13 +16334,17 @@ function buildSqliteEngineProfile(db, options = {}) {
16330
16334
  writeVersion: writeBaseSchemaVersion,
16331
16335
  ensureEdgeMatchIdentityStorage,
16332
16336
  fencesTableDdl: generateSqliteCreateTableSQL(tables3.fences),
16333
- sinceIndexDdl: chunkB2FYH5VR_cjs.sinceIndexAdoptionDdl({
16334
- recordedNodes: drizzleOrm.getTableName(tables3.recordedNodes),
16335
- recordedEdges: drizzleOrm.getTableName(tables3.recordedEdges),
16336
- recordedIdentityAssertions: drizzleOrm.getTableName(
16337
- tables3.recordedIdentityAssertions
16338
- )
16339
- })
16337
+ sinceIndexDdl: [
16338
+ generateSqliteCreateTableSQL(tables3.recordedIdentityAssertions),
16339
+ ...generateSqliteCreateIndexSQL(tables3.recordedIdentityAssertions),
16340
+ ...chunk2GXLAV4H_cjs.sinceIndexAdoptionDdl({
16341
+ recordedNodes: drizzleOrm.getTableName(tables3.recordedNodes),
16342
+ recordedEdges: drizzleOrm.getTableName(tables3.recordedEdges),
16343
+ recordedIdentityAssertions: drizzleOrm.getTableName(
16344
+ tables3.recordedIdentityAssertions
16345
+ )
16346
+ })
16347
+ ]
16340
16348
  };
16341
16349
  const indexMaterializationRuntime = {
16342
16350
  indexMaterializationsTableDdl: generateSqliteCreateTableSQL(
@@ -16643,7 +16651,7 @@ function buildSqliteEngineProfile(db, options = {}) {
16643
16651
  async refreshStatistics() {
16644
16652
  try {
16645
16653
  await db.run(
16646
- chunkGSRUQXYE_cjs.toDrizzleSql(
16654
+ chunkG72YXUND_cjs.toDrizzleSql(
16647
16655
  chunkXOKNPHQR_cjs.sql`PRAGMA analysis_limit = ${chunkXOKNPHQR_cjs.sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`,
16648
16656
  "sqlite"
16649
16657
  )
@@ -16653,7 +16661,7 @@ function buildSqliteEngineProfile(db, options = {}) {
16653
16661
  }
16654
16662
  for (const tableName of coreAnalyzeTables) {
16655
16663
  await db.run(
16656
- chunkGSRUQXYE_cjs.toDrizzleSql(
16664
+ chunkG72YXUND_cjs.toDrizzleSql(
16657
16665
  chunkXOKNPHQR_cjs.sql`ANALYZE ${chunkXOKNPHQR_cjs.sql.identifier(tableName)}`,
16658
16666
  "sqlite"
16659
16667
  )
@@ -16662,7 +16670,7 @@ function buildSqliteEngineProfile(db, options = {}) {
16662
16670
  for (const tableName of guardedAnalyzeTables) {
16663
16671
  try {
16664
16672
  await db.run(
16665
- chunkGSRUQXYE_cjs.toDrizzleSql(
16673
+ chunkG72YXUND_cjs.toDrizzleSql(
16666
16674
  chunkXOKNPHQR_cjs.sql`ANALYZE ${chunkXOKNPHQR_cjs.sql.identifier(tableName)}`,
16667
16675
  "sqlite"
16668
16676
  )
@@ -16784,5 +16792,5 @@ exports.tables = tables;
16784
16792
  exports.tables2 = tables2;
16785
16793
  exports.uniques = uniques;
16786
16794
  exports.uniques2 = uniques2;
16787
- //# sourceMappingURL=chunk-CZNYXNOY.cjs.map
16788
- //# sourceMappingURL=chunk-CZNYXNOY.cjs.map
16795
+ //# sourceMappingURL=chunk-DIVOGAPS.cjs.map
16796
+ //# sourceMappingURL=chunk-DIVOGAPS.cjs.map