@nicia-ai/typegraph 0.38.0 → 0.39.0

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 (95) hide show
  1. package/dist/backend/postgres/index.cjs +16 -16
  2. package/dist/backend/postgres/index.js +3 -3
  3. package/dist/backend/postgres/pglite-store.cjs +11 -11
  4. package/dist/backend/postgres/pglite-store.d.cts +1 -1
  5. package/dist/backend/postgres/pglite-store.d.ts +1 -1
  6. package/dist/backend/postgres/pglite-store.js +8 -8
  7. package/dist/backend/postgres/pglite.cjs +5 -5
  8. package/dist/backend/postgres/pglite.js +4 -4
  9. package/dist/backend/sqlite/index.cjs +6 -6
  10. package/dist/backend/sqlite/index.js +3 -3
  11. package/dist/backend/sqlite/libsql.cjs +5 -5
  12. package/dist/backend/sqlite/libsql.js +3 -3
  13. package/dist/backend/sqlite/local-store.cjs +11 -11
  14. package/dist/backend/sqlite/local-store.d.cts +1 -1
  15. package/dist/backend/sqlite/local-store.d.ts +1 -1
  16. package/dist/backend/sqlite/local-store.js +9 -9
  17. package/dist/backend/sqlite/local.cjs +6 -6
  18. package/dist/backend/sqlite/local.js +4 -4
  19. package/dist/{chunk-UPXDVI3T.js → chunk-3SK4SVTW.js} +3 -3
  20. package/dist/{chunk-UPXDVI3T.js.map → chunk-3SK4SVTW.js.map} +1 -1
  21. package/dist/{chunk-NU23DUSJ.cjs → chunk-3YFDFOYB.cjs} +7 -7
  22. package/dist/{chunk-NU23DUSJ.cjs.map → chunk-3YFDFOYB.cjs.map} +1 -1
  23. package/dist/{chunk-NWYCOFEZ.cjs → chunk-5ELKD2FQ.cjs} +4 -4
  24. package/dist/chunk-5ELKD2FQ.cjs.map +1 -0
  25. package/dist/{chunk-2SL7OGPR.cjs → chunk-6SRLCSAV.cjs} +478 -338
  26. package/dist/chunk-6SRLCSAV.cjs.map +1 -0
  27. package/dist/{chunk-A2FGSWMQ.js → chunk-CBK2IVI2.js} +167 -27
  28. package/dist/chunk-CBK2IVI2.js.map +1 -0
  29. package/dist/{chunk-TE5ZA4VX.js → chunk-DOKUXLFH.js} +14 -10
  30. package/dist/chunk-DOKUXLFH.js.map +1 -0
  31. package/dist/{chunk-KCLZHYPU.cjs → chunk-E2Q7SP2K.cjs} +52 -52
  32. package/dist/{chunk-KCLZHYPU.cjs.map → chunk-E2Q7SP2K.cjs.map} +1 -1
  33. package/dist/{chunk-YLINFV7Z.cjs → chunk-GKQU44SQ.cjs} +67 -63
  34. package/dist/chunk-GKQU44SQ.cjs.map +1 -0
  35. package/dist/{chunk-O5H62ZWJ.cjs → chunk-HP6LWBLB.cjs} +14 -2
  36. package/dist/chunk-HP6LWBLB.cjs.map +1 -0
  37. package/dist/{chunk-7VLCN3JB.cjs → chunk-HTQOBY75.cjs} +59 -59
  38. package/dist/{chunk-7VLCN3JB.cjs.map → chunk-HTQOBY75.cjs.map} +1 -1
  39. package/dist/{chunk-RQPRCEIO.js → chunk-IFDXG2YJ.js} +3 -3
  40. package/dist/chunk-IFDXG2YJ.js.map +1 -0
  41. package/dist/{chunk-YJDSPA5E.js → chunk-IFRPHG7O.js} +4 -4
  42. package/dist/{chunk-YJDSPA5E.js.map → chunk-IFRPHG7O.js.map} +1 -1
  43. package/dist/{chunk-LZ3TVJY4.cjs → chunk-JD2YC62H.cjs} +17 -17
  44. package/dist/{chunk-LZ3TVJY4.cjs.map → chunk-JD2YC62H.cjs.map} +1 -1
  45. package/dist/{chunk-XD6X7O5R.js → chunk-KAFXPB2L.js} +4 -4
  46. package/dist/{chunk-XD6X7O5R.js.map → chunk-KAFXPB2L.js.map} +1 -1
  47. package/dist/{chunk-ZHX4KEM7.cjs → chunk-KIZSHRUI.cjs} +7 -7
  48. package/dist/{chunk-ZHX4KEM7.cjs.map → chunk-KIZSHRUI.cjs.map} +1 -1
  49. package/dist/{chunk-G32AO634.js → chunk-KXFUQNF2.js} +3 -3
  50. package/dist/{chunk-G32AO634.js.map → chunk-KXFUQNF2.js.map} +1 -1
  51. package/dist/{chunk-E6YZRKMM.js → chunk-NQBYTLPW.js} +4 -4
  52. package/dist/{chunk-E6YZRKMM.js.map → chunk-NQBYTLPW.js.map} +1 -1
  53. package/dist/{chunk-VBH7ZXSZ.js → chunk-SU7VQOJ3.js} +3 -3
  54. package/dist/{chunk-VBH7ZXSZ.js.map → chunk-SU7VQOJ3.js.map} +1 -1
  55. package/dist/{chunk-KFLXWVUJ.js → chunk-UUIBACKJ.js} +14 -3
  56. package/dist/chunk-UUIBACKJ.js.map +1 -0
  57. package/dist/{chunk-CQC6VBAF.cjs → chunk-VXAFOF6Z.cjs} +5 -5
  58. package/dist/{chunk-CQC6VBAF.cjs.map → chunk-VXAFOF6Z.cjs.map} +1 -1
  59. package/dist/{chunk-XFY73JWD.cjs → chunk-Y6UA55YS.cjs} +5 -5
  60. package/dist/{chunk-XFY73JWD.cjs.map → chunk-Y6UA55YS.cjs.map} +1 -1
  61. package/dist/{chunk-6G5CQ6JX.js → chunk-YPUNPG2T.js} +4 -4
  62. package/dist/{chunk-6G5CQ6JX.js.map → chunk-YPUNPG2T.js.map} +1 -1
  63. package/dist/graph-merge/index.cjs +30 -32
  64. package/dist/graph-merge/index.cjs.map +1 -1
  65. package/dist/graph-merge/index.d.cts +10 -5
  66. package/dist/graph-merge/index.d.ts +10 -5
  67. package/dist/graph-merge/index.js +9 -11
  68. package/dist/graph-merge/index.js.map +1 -1
  69. package/dist/index.cjs +68 -68
  70. package/dist/index.d.cts +2 -2
  71. package/dist/index.d.ts +2 -2
  72. package/dist/index.js +5 -5
  73. package/dist/interchange/index.cjs +23 -23
  74. package/dist/interchange/index.d.cts +1 -1
  75. package/dist/interchange/index.d.ts +1 -1
  76. package/dist/interchange/index.js +4 -4
  77. package/dist/profiler/index.d.cts +1 -1
  78. package/dist/profiler/index.d.ts +1 -1
  79. package/dist/provenance/index.cjs +11 -11
  80. package/dist/provenance/index.d.cts +1 -1
  81. package/dist/provenance/index.d.ts +1 -1
  82. package/dist/provenance/index.js +2 -2
  83. package/dist/schema/index.cjs +22 -22
  84. package/dist/schema/index.js +3 -3
  85. package/dist/{store-view-BoHqdHjB.d.cts → store-view-BJd6Vwpt.d.cts} +39 -17
  86. package/dist/{store-view-Ctq-3OHy.d.ts → store-view-CLIhwMMX.d.ts} +39 -17
  87. package/package.json +1 -1
  88. package/dist/chunk-2SL7OGPR.cjs.map +0 -1
  89. package/dist/chunk-A2FGSWMQ.js.map +0 -1
  90. package/dist/chunk-KFLXWVUJ.js.map +0 -1
  91. package/dist/chunk-NWYCOFEZ.cjs.map +0 -1
  92. package/dist/chunk-O5H62ZWJ.cjs.map +0 -1
  93. package/dist/chunk-RQPRCEIO.js.map +0 -1
  94. package/dist/chunk-TE5ZA4VX.js.map +0 -1
  95. package/dist/chunk-YLINFV7Z.cjs.map +0 -1
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkXFY73JWD_cjs = require('./chunk-XFY73JWD.cjs');
3
+ var chunkY6UA55YS_cjs = require('./chunk-Y6UA55YS.cjs');
4
4
  var chunkEOJFGECD_cjs = require('./chunk-EOJFGECD.cjs');
5
5
  var chunkE6TXEISH_cjs = require('./chunk-E6TXEISH.cjs');
6
6
  var chunkDOVMTPKE_cjs = require('./chunk-DOVMTPKE.cjs');
7
7
  var chunkZDH3DX3C_cjs = require('./chunk-ZDH3DX3C.cjs');
8
8
  var chunkGNPGGLAE_cjs = require('./chunk-GNPGGLAE.cjs');
9
- var chunkO5H62ZWJ_cjs = require('./chunk-O5H62ZWJ.cjs');
9
+ var chunkHP6LWBLB_cjs = require('./chunk-HP6LWBLB.cjs');
10
10
  var chunkZKZAIX42_cjs = require('./chunk-ZKZAIX42.cjs');
11
11
  var chunkX6RDQ5NB_cjs = require('./chunk-X6RDQ5NB.cjs');
12
12
  var chunkSAFZ6JTI_cjs = require('./chunk-SAFZ6JTI.cjs');
@@ -129,7 +129,7 @@ function resolveSqliteClient(db) {
129
129
  return sqliteClient;
130
130
  }
131
131
  function getOrCreatePreparedStatement(cache, sqliteClient, sqlText, cacheMax) {
132
- return chunkXFY73JWD_cjs.getOrCreateLru(
132
+ return chunkY6UA55YS_cjs.getOrCreateLru(
133
133
  cache,
134
134
  sqlText,
135
135
  cacheMax,
@@ -279,7 +279,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
279
279
  ),
280
280
  embeddingUpsertBatchSize: Math.max(
281
281
  1,
282
- Math.floor(maxBindParameters / chunkXFY73JWD_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
282
+ Math.floor(maxBindParameters / chunkY6UA55YS_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
283
283
  ),
284
284
  fulltextUpsertBatchSize: Math.max(
285
285
  1,
@@ -467,7 +467,7 @@ function createSqliteOperationBackend(options) {
467
467
  const batchConfig = computeSqliteBatchChunkSizes(
468
468
  capabilities.maxBindParameters ?? chunkGNPGGLAE_cjs.SQLITE_MAX_BIND_PARAMETERS
469
469
  );
470
- const commonBackend = chunkXFY73JWD_cjs.createCommonOperationBackend({
470
+ const commonBackend = chunkY6UA55YS_cjs.createCommonOperationBackend({
471
471
  batchConfig,
472
472
  execution: {
473
473
  execAll,
@@ -494,7 +494,7 @@ function createSqliteOperationBackend(options) {
494
494
  };
495
495
  const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
496
496
  async upsertEmbedding(params) {
497
- const slot = chunkXFY73JWD_cjs.vectorSlotFromParams(params);
497
+ const slot = chunkY6UA55YS_cjs.vectorSlotFromParams(params);
498
498
  await contributionMaterializer.assertVectorSlot(slot);
499
499
  const statements = vectorStrategy.buildUpsert(slot, params, chunkE6TXEISH_cjs.nowIso());
500
500
  try {
@@ -502,12 +502,12 @@ function createSqliteOperationBackend(options) {
502
502
  await execRun(statement);
503
503
  }
504
504
  } catch (error) {
505
- throw chunkXFY73JWD_cjs.mapVectorWriteError(error, params);
505
+ throw chunkY6UA55YS_cjs.mapVectorWriteError(error, params);
506
506
  }
507
507
  },
508
508
  async upsertEmbeddingBatch(params) {
509
509
  if (params.rows.length === 0) return;
510
- const slot = chunkXFY73JWD_cjs.vectorSlotFromParams(params);
510
+ const slot = chunkY6UA55YS_cjs.vectorSlotFromParams(params);
511
511
  await contributionMaterializer.assertVectorSlot(slot);
512
512
  const rowsById = new Map(
513
513
  params.rows.map((row) => [row.nodeId, row])
@@ -544,11 +544,11 @@ function createSqliteOperationBackend(options) {
544
544
  }
545
545
  }
546
546
  } catch (error) {
547
- throw chunkXFY73JWD_cjs.mapVectorWriteError(error, params);
547
+ throw chunkY6UA55YS_cjs.mapVectorWriteError(error, params);
548
548
  }
549
549
  },
550
550
  async deleteEmbedding(params) {
551
- const slot = chunkXFY73JWD_cjs.vectorSlotFromParams(params);
551
+ const slot = chunkY6UA55YS_cjs.vectorSlotFromParams(params);
552
552
  await contributionMaterializer.assertVectorSlot(slot);
553
553
  const statements = vectorStrategy.buildDelete(slot, params);
554
554
  for (const statement of statements) {
@@ -557,13 +557,13 @@ function createSqliteOperationBackend(options) {
557
557
  },
558
558
  async vectorSearch(params) {
559
559
  chunkZKZAIX42_cjs.assertVectorSearchLimit(params.limit);
560
- const slot = chunkXFY73JWD_cjs.vectorSlotFromParams(params);
560
+ const slot = chunkY6UA55YS_cjs.vectorSlotFromParams(params);
561
561
  const query = vectorStrategy.buildSearch(
562
562
  slot,
563
563
  params,
564
564
  // Store-compiled candidates (predicates + subclass + currency)
565
565
  // take precedence; the live-node default covers direct backend use.
566
- params.candidates ?? chunkXFY73JWD_cjs.buildLiveNodeCandidates(
566
+ params.candidates ?? chunkY6UA55YS_cjs.buildLiveNodeCandidates(
567
567
  tableNames.nodes,
568
568
  params.graphId,
569
569
  params.nodeKind,
@@ -574,7 +574,7 @@ function createSqliteOperationBackend(options) {
574
574
  try {
575
575
  rows = await execAll(query);
576
576
  } catch (error) {
577
- throw chunkXFY73JWD_cjs.mapVectorWriteError(error, params);
577
+ throw chunkY6UA55YS_cjs.mapVectorWriteError(error, params);
578
578
  }
579
579
  return rows.map((row) => ({
580
580
  nodeId: row.node_id,
@@ -588,7 +588,7 @@ function createSqliteOperationBackend(options) {
588
588
  async hybridSearch(params) {
589
589
  chunkZKZAIX42_cjs.assertVectorSearchLimit(params.limit);
590
590
  chunkZKZAIX42_cjs.assertVectorSearchLimit(params.vector.k);
591
- const slot = chunkXFY73JWD_cjs.vectorSlotFromParams({
591
+ const slot = chunkY6UA55YS_cjs.vectorSlotFromParams({
592
592
  graphId: params.graphId,
593
593
  nodeKind: params.nodeKind,
594
594
  fieldPath: params.vector.fieldPath,
@@ -596,7 +596,7 @@ function createSqliteOperationBackend(options) {
596
596
  metric: params.vector.metric,
597
597
  indexType: params.vector.indexType
598
598
  });
599
- const candidates = params.candidates ?? chunkXFY73JWD_cjs.buildLiveNodeCandidates(
599
+ const candidates = params.candidates ?? chunkY6UA55YS_cjs.buildLiveNodeCandidates(
600
600
  tableNames.nodes,
601
601
  params.graphId,
602
602
  params.nodeKind,
@@ -627,9 +627,9 @@ function createSqliteOperationBackend(options) {
627
627
  try {
628
628
  raw = await execAll(statement);
629
629
  } catch (error) {
630
- throw chunkXFY73JWD_cjs.mapVectorWriteError(error, vectorParams);
630
+ throw chunkY6UA55YS_cjs.mapVectorWriteError(error, vectorParams);
631
631
  }
632
- return raw.map((row) => chunkXFY73JWD_cjs.mapHybridSearchRow(row, toNodeRow));
632
+ return raw.map((row) => chunkY6UA55YS_cjs.mapHybridSearchRow(row, toNodeRow));
633
633
  }
634
634
  } : {}
635
635
  };
@@ -644,7 +644,7 @@ function createSqliteOperationBackend(options) {
644
644
  ...vectorStrategy === void 0 ? {} : { vectorStrategy },
645
645
  async createVectorIndex(params) {
646
646
  if (vectorStrategy === void 0) return;
647
- const slot = chunkXFY73JWD_cjs.vectorSlotFromCreateIndexParams(params);
647
+ const slot = chunkY6UA55YS_cjs.vectorSlotFromCreateIndexParams(params);
648
648
  await contributionMaterializer.ensureVectorSlot(slot);
649
649
  const indexStatement = vectorStrategy.buildCreateIndex?.(slot);
650
650
  if (indexStatement !== void 0) {
@@ -653,13 +653,13 @@ function createSqliteOperationBackend(options) {
653
653
  },
654
654
  async dropVectorIndex(params) {
655
655
  if (vectorStrategy === void 0) return;
656
- const slot = chunkXFY73JWD_cjs.vectorSlotFromDropIndexParams(params);
656
+ const slot = chunkY6UA55YS_cjs.vectorSlotFromDropIndexParams(params);
657
657
  const dropStatement = vectorStrategy.buildDropIndex?.(slot);
658
658
  if (dropStatement === void 0) return;
659
659
  try {
660
660
  await execRun(dropStatement);
661
661
  } catch (error) {
662
- if (!chunkO5H62ZWJ_cjs.isMissingTableError(error)) throw error;
662
+ if (!chunkHP6LWBLB_cjs.isMissingTableError(error)) throw error;
663
663
  }
664
664
  },
665
665
  // === Fulltext Operations ===
@@ -779,14 +779,14 @@ function createSqliteBackend(db, options = {}) {
779
779
  tableNames.recordedEdges,
780
780
  tableNames.recordedClock
781
781
  ];
782
- const operationStrategy = chunkXFY73JWD_cjs.createSqliteOperationStrategy(
782
+ const operationStrategy = chunkY6UA55YS_cjs.createSqliteOperationStrategy(
783
783
  tables2,
784
784
  fulltextStrategy
785
785
  );
786
786
  const serializedQueue = transactionMode === "none" ? void 0 : createSerializedExecutionQueue();
787
787
  const matTable = tables2.contributionMaterializations;
788
788
  async function ensureContributionMaterializationsTableImpl() {
789
- await db.run(drizzleOrm.sql.raw(chunkXFY73JWD_cjs.generateSqliteCreateTableSQL(matTable)));
789
+ await db.run(drizzleOrm.sql.raw(chunkY6UA55YS_cjs.generateSqliteCreateTableSQL(matTable)));
790
790
  }
791
791
  async function getContributionMaterializationRow(identity) {
792
792
  const rows = await db.select().from(matTable).where(
@@ -799,25 +799,25 @@ function createSqliteBackend(db, options = {}) {
799
799
  );
800
800
  const row = rows[0];
801
801
  if (row === void 0) return void 0;
802
- return chunkXFY73JWD_cjs.mapContributionMaterializationRow(
802
+ return chunkY6UA55YS_cjs.mapContributionMaterializationRow(
803
803
  row,
804
- chunkXFY73JWD_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
804
+ chunkY6UA55YS_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
805
805
  );
806
806
  }
807
807
  async function getContributionMaterializationRows(graphId) {
808
808
  const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
809
809
  return rows.map(
810
- (row) => chunkXFY73JWD_cjs.mapContributionMaterializationRow(
810
+ (row) => chunkY6UA55YS_cjs.mapContributionMaterializationRow(
811
811
  row,
812
- chunkXFY73JWD_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
812
+ chunkY6UA55YS_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
813
813
  )
814
814
  );
815
815
  }
816
816
  async function recordContributionMaterializationRow(params) {
817
817
  await db.insert(matTable).values(
818
- chunkXFY73JWD_cjs.buildContributionInsertValues(
818
+ chunkY6UA55YS_cjs.buildContributionInsertValues(
819
819
  params,
820
- chunkXFY73JWD_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
820
+ chunkY6UA55YS_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
821
821
  )
822
822
  ).onConflictDoUpdate({
823
823
  target: [
@@ -826,7 +826,7 @@ function createSqliteBackend(db, options = {}) {
826
826
  matTable.owner,
827
827
  matTable.tableName
828
828
  ],
829
- set: chunkXFY73JWD_cjs.buildContributionOnConflictSet(
829
+ set: chunkY6UA55YS_cjs.buildContributionOnConflictSet(
830
830
  matTable.materializedAt,
831
831
  params.materializedAt
832
832
  )
@@ -842,7 +842,7 @@ function createSqliteBackend(db, options = {}) {
842
842
  )
843
843
  );
844
844
  }
845
- const contributionMaterializer = chunkXFY73JWD_cjs.createContributionMaterializer({
845
+ const contributionMaterializer = chunkY6UA55YS_cjs.createContributionMaterializer({
846
846
  dialect: "sqlite",
847
847
  fulltextStrategy,
848
848
  fulltextTableName: tables2.fulltextTableName,
@@ -962,36 +962,36 @@ function createSqliteBackend(db, options = {}) {
962
962
  vectorStrategy,
963
963
  contributionMaterializer
964
964
  });
965
- return chunkXFY73JWD_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
965
+ return chunkY6UA55YS_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
966
966
  }
967
967
  const backend = {
968
968
  ...operations,
969
969
  ...isSync && transactionMode === "sql" && executionAdapter.executePreparedRunBatch !== void 0 ? {
970
970
  async trustedImport(fn) {
971
971
  return backend.transaction(async (tx) => {
972
- await chunkXFY73JWD_cjs.assertTrustedImportDatabaseEmpty(tx, tableNames);
973
- const indexDefinitions = await chunkXFY73JWD_cjs.suspendSqliteSecondaryIndexes(
972
+ await chunkY6UA55YS_cjs.assertTrustedImportDatabaseEmpty(tx, tableNames);
973
+ const indexDefinitions = await chunkY6UA55YS_cjs.suspendSqliteSecondaryIndexes(
974
974
  tx,
975
975
  tableNames
976
976
  );
977
977
  const result = await fn(
978
- chunkXFY73JWD_cjs.createSqliteTrustedImportSession(executionAdapter, tableNames)
978
+ chunkY6UA55YS_cjs.createSqliteTrustedImportSession(executionAdapter, tableNames)
979
979
  );
980
- await chunkXFY73JWD_cjs.restoreSecondaryIndexes(tx, indexDefinitions);
981
- await chunkXFY73JWD_cjs.analyzeImportedTables(tx, tableNames);
980
+ await chunkY6UA55YS_cjs.restoreSecondaryIndexes(tx, indexDefinitions);
981
+ await chunkY6UA55YS_cjs.analyzeImportedTables(tx, tableNames);
982
982
  return result;
983
983
  });
984
984
  }
985
985
  } : {},
986
986
  async bootstrapTables() {
987
- const statements = chunkXFY73JWD_cjs.generateSqliteDDL(tables2, fulltextStrategy);
987
+ const statements = chunkY6UA55YS_cjs.generateSqliteDDL(tables2, fulltextStrategy);
988
988
  for (const statement of statements) {
989
989
  await db.run(drizzleOrm.sql.raw(statement));
990
990
  }
991
991
  },
992
992
  async ensureRevisionOriginsTable() {
993
993
  await db.run(
994
- drizzleOrm.sql.raw(chunkXFY73JWD_cjs.generateSqliteCreateTableSQL(tables2.revisionOrigins))
994
+ drizzleOrm.sql.raw(chunkY6UA55YS_cjs.generateSqliteCreateTableSQL(tables2.revisionOrigins))
995
995
  );
996
996
  },
997
997
  // Every fulltext-touching method asserts the durable marker instead
@@ -999,7 +999,7 @@ function createSqliteBackend(db, options = {}) {
999
999
  // uninitialized database throws `StoreNotInitializedError` rather
1000
1000
  // than self-healing (#135). Shared verbatim with the tx-scoped gate
1001
1001
  // via `gateFulltextMethods`.
1002
- ...chunkXFY73JWD_cjs.gateFulltextMethods(
1002
+ ...chunkY6UA55YS_cjs.gateFulltextMethods(
1003
1003
  operations,
1004
1004
  contributionMaterializer.assertInitialized
1005
1005
  ),
@@ -1008,7 +1008,7 @@ function createSqliteBackend(db, options = {}) {
1008
1008
  },
1009
1009
  async ensureIndexMaterializationsTable() {
1010
1010
  await db.run(
1011
- drizzleOrm.sql.raw(chunkXFY73JWD_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
1011
+ drizzleOrm.sql.raw(chunkY6UA55YS_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
1012
1012
  );
1013
1013
  },
1014
1014
  async getIndexMaterialization(indexName) {
@@ -1016,26 +1016,26 @@ function createSqliteBackend(db, options = {}) {
1016
1016
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
1017
1017
  const row = rows[0];
1018
1018
  if (row === void 0) return void 0;
1019
- return chunkXFY73JWD_cjs.mapMaterializationRow(row, chunkXFY73JWD_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
1019
+ return chunkY6UA55YS_cjs.mapMaterializationRow(row, chunkY6UA55YS_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
1020
1020
  },
1021
1021
  async getIndexMaterializations(statusKeys) {
1022
1022
  if (statusKeys.length === 0) return [];
1023
1023
  const t = tables2.indexMaterializations;
1024
1024
  const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
1025
1025
  return rows.map(
1026
- (row) => chunkXFY73JWD_cjs.mapMaterializationRow(row, chunkXFY73JWD_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
1026
+ (row) => chunkY6UA55YS_cjs.mapMaterializationRow(row, chunkY6UA55YS_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
1027
1027
  );
1028
1028
  },
1029
1029
  async recordIndexMaterialization(params) {
1030
1030
  const t = tables2.indexMaterializations;
1031
1031
  await db.insert(t).values(
1032
- chunkXFY73JWD_cjs.buildMaterializationInsertValues(
1032
+ chunkY6UA55YS_cjs.buildMaterializationInsertValues(
1033
1033
  params,
1034
- chunkXFY73JWD_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
1034
+ chunkY6UA55YS_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
1035
1035
  )
1036
1036
  ).onConflictDoUpdate({
1037
1037
  target: t.indexName,
1038
- set: chunkXFY73JWD_cjs.buildMaterializationOnConflictSet(params.materializedAt)
1038
+ set: chunkY6UA55YS_cjs.buildMaterializationOnConflictSet(params.materializedAt)
1039
1039
  });
1040
1040
  },
1041
1041
  async ensureContributionMaterializationsTable() {
@@ -1051,37 +1051,37 @@ function createSqliteBackend(db, options = {}) {
1051
1051
  await contributionMaterializer.assertInitialized(graphId);
1052
1052
  },
1053
1053
  async ensureKindRemovalsTable() {
1054
- await db.run(drizzleOrm.sql.raw(chunkXFY73JWD_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
1054
+ await db.run(drizzleOrm.sql.raw(chunkY6UA55YS_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
1055
1055
  },
1056
1056
  async getPendingKindRemovals(graphId) {
1057
1057
  const t = tables2.kindRemovals;
1058
1058
  const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
1059
1059
  return rows.map(
1060
- (row) => chunkXFY73JWD_cjs.mapKindRemovalRow(row, chunkXFY73JWD_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
1060
+ (row) => chunkY6UA55YS_cjs.mapKindRemovalRow(row, chunkY6UA55YS_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
1061
1061
  );
1062
1062
  },
1063
1063
  async getAllKindRemovals(graphId) {
1064
1064
  const t = tables2.kindRemovals;
1065
1065
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
1066
1066
  return rows.map(
1067
- (row) => chunkXFY73JWD_cjs.mapKindRemovalRow(row, chunkXFY73JWD_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
1067
+ (row) => chunkY6UA55YS_cjs.mapKindRemovalRow(row, chunkY6UA55YS_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
1068
1068
  );
1069
1069
  },
1070
1070
  async recordKindRemoval(params) {
1071
1071
  const t = tables2.kindRemovals;
1072
1072
  await db.insert(t).values(
1073
- chunkXFY73JWD_cjs.buildKindRemovalInsertValues(
1073
+ chunkY6UA55YS_cjs.buildKindRemovalInsertValues(
1074
1074
  params,
1075
- chunkXFY73JWD_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
1075
+ chunkY6UA55YS_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
1076
1076
  )
1077
1077
  ).onConflictDoUpdate({
1078
1078
  target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
1079
- set: chunkXFY73JWD_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
1079
+ set: chunkY6UA55YS_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
1080
1080
  });
1081
1081
  },
1082
1082
  async ensureReconciliationMarkersTable() {
1083
1083
  await db.run(
1084
- drizzleOrm.sql.raw(chunkXFY73JWD_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
1084
+ drizzleOrm.sql.raw(chunkY6UA55YS_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
1085
1085
  );
1086
1086
  },
1087
1087
  async ensureRuntimeContributions(graphId) {
@@ -1129,12 +1129,16 @@ function createSqliteBackend(db, options = {}) {
1129
1129
  });
1130
1130
  },
1131
1131
  async refreshStatistics() {
1132
- await db.run(
1133
- chunkDOVMTPKE_cjs.toDrizzleSql(
1134
- chunkX6RDQ5NB_cjs.sql`PRAGMA analysis_limit = ${chunkX6RDQ5NB_cjs.sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`,
1135
- "sqlite"
1136
- )
1137
- );
1132
+ try {
1133
+ await db.run(
1134
+ chunkDOVMTPKE_cjs.toDrizzleSql(
1135
+ chunkX6RDQ5NB_cjs.sql`PRAGMA analysis_limit = ${chunkX6RDQ5NB_cjs.sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`,
1136
+ "sqlite"
1137
+ )
1138
+ );
1139
+ } catch (error) {
1140
+ if (!chunkHP6LWBLB_cjs.isSqliteNotAuthorizedError(error)) throw error;
1141
+ }
1138
1142
  for (const tableName of coreAnalyzeTables) {
1139
1143
  await db.run(
1140
1144
  chunkDOVMTPKE_cjs.toDrizzleSql(
@@ -1152,7 +1156,7 @@ function createSqliteBackend(db, options = {}) {
1152
1156
  )
1153
1157
  );
1154
1158
  } catch (error) {
1155
- if (!chunkO5H62ZWJ_cjs.isMissingTableError(error)) throw error;
1159
+ if (!chunkHP6LWBLB_cjs.isMissingTableError(error)) throw error;
1156
1160
  }
1157
1161
  }
1158
1162
  },
@@ -1200,7 +1204,7 @@ function createSqliteBackend(db, options = {}) {
1200
1204
  );
1201
1205
  try {
1202
1206
  const result = await fn(
1203
- chunkXFY73JWD_cjs.gateFulltext(
1207
+ chunkY6UA55YS_cjs.gateFulltext(
1204
1208
  txBackend,
1205
1209
  contributionMaterializer.assertInitialized
1206
1210
  ),
@@ -1232,7 +1236,7 @@ function createSqliteBackend(db, options = {}) {
1232
1236
  "Cross-store atomicity is unavailable on this SQLite backend: transactions are disabled (transactionMode: 'none'). Adopting an external transaction here would let the caller's relational write commit with no way to roll back the graph write. Configure a driver that supports transactions (better-sqlite3, libsql, bun:sqlite)."
1233
1237
  );
1234
1238
  }
1235
- chunkXFY73JWD_cjs.assertAdoptedDialect(
1239
+ chunkY6UA55YS_cjs.assertAdoptedDialect(
1236
1240
  externalTx,
1237
1241
  sqliteCore.BaseSQLiteDatabase,
1238
1242
  "sqlite"
@@ -1263,5 +1267,5 @@ function createTransactionBackend(options) {
1263
1267
  }
1264
1268
 
1265
1269
  exports.createSqliteBackend = createSqliteBackend;
1266
- //# sourceMappingURL=chunk-YLINFV7Z.cjs.map
1267
- //# sourceMappingURL=chunk-YLINFV7Z.cjs.map
1270
+ //# sourceMappingURL=chunk-GKQU44SQ.cjs.map
1271
+ //# sourceMappingURL=chunk-GKQU44SQ.cjs.map