@starkeep/storage-sqlite 0.6.0 → 0.6.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.cjs CHANGED
@@ -370,7 +370,7 @@ var SqliteDatabaseAdapter = class {
370
370
  this.runStmt(query.sql, ...query.parameters);
371
371
  }
372
372
  async getNodeWatermarks() {
373
- const watermarksQuery = compiler.selectFrom("shared_records").select(({ fn }) => ["node_id", fn.max("updated_at").as("max_updated_at")]).groupBy("node_id").compile();
373
+ const watermarksQuery = (0, import_storage_adapter4.buildNodeWatermarks)(compiler, RECORDS);
374
374
  const rows = this.allRows(watermarksQuery.sql);
375
375
  const out = {};
376
376
  for (const row of rows) {
@@ -634,7 +634,7 @@ var SqliteDatabaseAdapter = class {
634
634
  return (0, import_storage_adapter4.paginateLabelScan)(rows, query.limit);
635
635
  }
636
636
  async getLabelNodeWatermarks() {
637
- const query = (0, import_storage_adapter4.buildLabelNodeWatermarks)(compiler, LABELS);
637
+ const query = (0, import_storage_adapter4.buildNodeWatermarks)(compiler, LABELS.table);
638
638
  const rows = this.allRows(query.sql);
639
639
  const out = {};
640
640
  for (const row of rows) out[row.node_id] = (0, import_protocol_primitives4.deserializeHLC)(row.max_updated_at);
@@ -940,7 +940,7 @@ var SqliteAppSyncableApplier = class {
940
940
  if (!this.tableExists(fullName)) return {};
941
941
  const rows = allCompiled(
942
942
  this.db,
943
- compiler.selectFrom(fullName).select(({ fn }) => ["node_id", fn.max("updated_at").as("max_updated_at")]).groupBy("node_id").compile()
943
+ (0, import_storage_adapter5.buildNodeWatermarks)(compiler, fullName)
944
944
  );
945
945
  const out = {};
946
946
  for (const row of rows) {