@slatedb/uniffi 0.12.0 → 0.13.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.
package/slatedb.js CHANGED
@@ -486,6 +486,34 @@ export const LogLevel = Object.freeze({
486
486
  "Trace": "Trace",
487
487
  });
488
488
 
489
+ /**
490
+ * Compaction lifecycle state.
491
+ */
492
+ export const CompactionStatus = Object.freeze({
493
+ "Submitted": "Submitted",
494
+ "Running": "Running",
495
+ "Completed": "Completed",
496
+ "Failed": "Failed",
497
+ });
498
+
499
+ /**
500
+ * Compression codec used for an SSTable.
501
+ */
502
+ export const CompressionCodec = Object.freeze({
503
+ "Snappy": "Snappy",
504
+ "Zlib": "Zlib",
505
+ "Lz4": "Lz4",
506
+ "Zstd": "Zstd",
507
+ });
508
+
509
+ /**
510
+ * Filter block format stored in SST metadata.
511
+ */
512
+ export const FilterFormat = Object.freeze({
513
+ "Legacy": "Legacy",
514
+ "Composite": "Composite",
515
+ });
516
+
489
517
  /**
490
518
  * Kind of row entry stored in WAL iteration results.
491
519
  */
@@ -504,6 +532,14 @@ export const RowEntryKind = Object.freeze({
504
532
  "Merge": "Merge",
505
533
  });
506
534
 
535
+ /**
536
+ * Physical SSTable type.
537
+ */
538
+ export const SstType = Object.freeze({
539
+ "Compacted": "Compacted",
540
+ "Wal": "Wal",
541
+ });
542
+
507
543
  /**
508
544
  * Time-to-live policy applied to an inserted value or merge operand.
509
545
  */
@@ -586,6 +622,94 @@ export const MetricValue = Object.freeze({
586
622
  },
587
623
  });
588
624
 
625
+ /**
626
+ * Cache content that [`crate::Db::warm_sst`] should populate.
627
+ */
628
+ export const CacheTarget = Object.freeze({
629
+ /**
630
+ * Warm all filters on the SST, if any exist.
631
+ */
632
+ Filters() {
633
+ return Object.freeze({
634
+ tag: "Filters",
635
+ });
636
+ },
637
+ /**
638
+ * Warm the SST index.
639
+ */
640
+ Index() {
641
+ return Object.freeze({
642
+ tag: "Index",
643
+ });
644
+ },
645
+ /**
646
+ * Warm the SST stats block, if one exists.
647
+ */
648
+ Stats() {
649
+ return Object.freeze({
650
+ tag: "Stats",
651
+ });
652
+ },
653
+ /**
654
+ * Warm the SST data blocks that overlap `range`. Also warms the index,
655
+ * since block planning depends on it.
656
+ */
657
+ Data(range) {
658
+ return Object.freeze({
659
+ tag: "Data",
660
+ "range": range,
661
+ });
662
+ },
663
+ });
664
+
665
+ /**
666
+ * Compaction input source identifier.
667
+ */
668
+ export const SourceId = Object.freeze({
669
+ /**
670
+ * Existing sorted run ID.
671
+ */
672
+ SortedRun(_) {
673
+ return Object.freeze({
674
+ tag: "SortedRun",
675
+ "": _,
676
+ });
677
+ },
678
+ /**
679
+ * L0 SST view ULID string.
680
+ */
681
+ SstView(_) {
682
+ return Object.freeze({
683
+ tag: "SstView",
684
+ "": _,
685
+ });
686
+ },
687
+ });
688
+
689
+ /**
690
+ * SSTable identifier.
691
+ */
692
+ export const SsTableId = Object.freeze({
693
+ /**
694
+ * WAL SST identified by numeric WAL ID.
695
+ */
696
+ Wal(_) {
697
+ return Object.freeze({
698
+ tag: "Wal",
699
+ "": _,
700
+ });
701
+ },
702
+ /**
703
+ * Compacted SST identified by ULID string.
704
+ */
705
+ Compacted(_) {
706
+ return Object.freeze({
707
+ tag: "Compacted",
708
+ "": _,
709
+ });
710
+ },
711
+ });
712
+
589
713
  /**
590
714
  * Error type returned by the UniFFI bindings.
591
715
  */
@@ -825,6 +949,46 @@ const FfiConverterWriteOptions = new (class extends AbstractFfiConverterByteArra
825
949
  };
826
950
  }
827
951
  })();
952
+ const FfiConverterFoyerCacheOptions = new (class extends AbstractFfiConverterByteArray {
953
+ allocationSize(value) {
954
+ const recordValue = uniffiRequireRecordObject("FoyerCacheOptions", value);
955
+ return FfiConverterUInt64.allocationSize(recordValue["max_capacity"]) + FfiConverterUInt64.allocationSize(recordValue["shards"]);
956
+ }
957
+
958
+ write(value, writer) {
959
+ const recordValue = uniffiRequireRecordObject("FoyerCacheOptions", value);
960
+ FfiConverterUInt64.write(recordValue["max_capacity"], writer);
961
+ FfiConverterUInt64.write(recordValue["shards"], writer);
962
+ }
963
+
964
+ read(reader) {
965
+ return {
966
+ "max_capacity": FfiConverterUInt64.read(reader),
967
+ "shards": FfiConverterUInt64.read(reader),
968
+ };
969
+ }
970
+ })();
971
+ const FfiConverterMokaCacheOptions = new (class extends AbstractFfiConverterByteArray {
972
+ allocationSize(value) {
973
+ const recordValue = uniffiRequireRecordObject("MokaCacheOptions", value);
974
+ return FfiConverterUInt64.allocationSize(recordValue["max_capacity"]) + uniffiOptionalConverter(FfiConverterUInt64).allocationSize(recordValue["time_to_live"]) + uniffiOptionalConverter(FfiConverterUInt64).allocationSize(recordValue["time_to_idle"]);
975
+ }
976
+
977
+ write(value, writer) {
978
+ const recordValue = uniffiRequireRecordObject("MokaCacheOptions", value);
979
+ FfiConverterUInt64.write(recordValue["max_capacity"], writer);
980
+ uniffiOptionalConverter(FfiConverterUInt64).write(recordValue["time_to_live"], writer);
981
+ uniffiOptionalConverter(FfiConverterUInt64).write(recordValue["time_to_idle"], writer);
982
+ }
983
+
984
+ read(reader) {
985
+ return {
986
+ "max_capacity": FfiConverterUInt64.read(reader),
987
+ "time_to_live": uniffiOptionalConverter(FfiConverterUInt64).read(reader),
988
+ "time_to_idle": uniffiOptionalConverter(FfiConverterUInt64).read(reader),
989
+ };
990
+ }
991
+ })();
828
992
  const FfiConverterLogRecord = new (class extends AbstractFfiConverterByteArray {
829
993
  allocationSize(value) {
830
994
  const recordValue = uniffiRequireRecordObject("LogRecord", value);
@@ -921,6 +1085,100 @@ const FfiConverterMetricLabel = new (class extends AbstractFfiConverterByteArray
921
1085
  };
922
1086
  }
923
1087
  })();
1088
+ const FfiConverterCheckpoint = new (class extends AbstractFfiConverterByteArray {
1089
+ allocationSize(value) {
1090
+ const recordValue = uniffiRequireRecordObject("Checkpoint", value);
1091
+ return FfiConverterString.allocationSize(recordValue["id"]) + FfiConverterUInt64.allocationSize(recordValue["manifest_id"]) + uniffiOptionalConverter(FfiConverterInt64).allocationSize(recordValue["expire_time_secs"]) + FfiConverterInt64.allocationSize(recordValue["create_time_secs"]) + uniffiOptionalConverter(FfiConverterString).allocationSize(recordValue["name"]);
1092
+ }
1093
+
1094
+ write(value, writer) {
1095
+ const recordValue = uniffiRequireRecordObject("Checkpoint", value);
1096
+ FfiConverterString.write(recordValue["id"], writer);
1097
+ FfiConverterUInt64.write(recordValue["manifest_id"], writer);
1098
+ uniffiOptionalConverter(FfiConverterInt64).write(recordValue["expire_time_secs"], writer);
1099
+ FfiConverterInt64.write(recordValue["create_time_secs"], writer);
1100
+ uniffiOptionalConverter(FfiConverterString).write(recordValue["name"], writer);
1101
+ }
1102
+
1103
+ read(reader) {
1104
+ return {
1105
+ "id": FfiConverterString.read(reader),
1106
+ "manifest_id": FfiConverterUInt64.read(reader),
1107
+ "expire_time_secs": uniffiOptionalConverter(FfiConverterInt64).read(reader),
1108
+ "create_time_secs": FfiConverterInt64.read(reader),
1109
+ "name": uniffiOptionalConverter(FfiConverterString).read(reader),
1110
+ };
1111
+ }
1112
+ })();
1113
+ const FfiConverterCompaction = new (class extends AbstractFfiConverterByteArray {
1114
+ allocationSize(value) {
1115
+ const recordValue = uniffiRequireRecordObject("Compaction", value);
1116
+ return FfiConverterString.allocationSize(recordValue["id"]) + FfiConverterCompactionSpec.allocationSize(recordValue["spec"]) + FfiConverterUInt64.allocationSize(recordValue["bytes_processed"]) + FfiConverterCompactionStatus.allocationSize(recordValue["status"]) + uniffiArrayConverter(FfiConverterSsTableHandle).allocationSize(recordValue["output_ssts"]) + FfiConverterBool.allocationSize(recordValue["active"]);
1117
+ }
1118
+
1119
+ write(value, writer) {
1120
+ const recordValue = uniffiRequireRecordObject("Compaction", value);
1121
+ FfiConverterString.write(recordValue["id"], writer);
1122
+ FfiConverterCompactionSpec.write(recordValue["spec"], writer);
1123
+ FfiConverterUInt64.write(recordValue["bytes_processed"], writer);
1124
+ FfiConverterCompactionStatus.write(recordValue["status"], writer);
1125
+ uniffiArrayConverter(FfiConverterSsTableHandle).write(recordValue["output_ssts"], writer);
1126
+ FfiConverterBool.write(recordValue["active"], writer);
1127
+ }
1128
+
1129
+ read(reader) {
1130
+ return {
1131
+ "id": FfiConverterString.read(reader),
1132
+ "spec": FfiConverterCompactionSpec.read(reader),
1133
+ "bytes_processed": FfiConverterUInt64.read(reader),
1134
+ "status": FfiConverterCompactionStatus.read(reader),
1135
+ "output_ssts": uniffiArrayConverter(FfiConverterSsTableHandle).read(reader),
1136
+ "active": FfiConverterBool.read(reader),
1137
+ };
1138
+ }
1139
+ })();
1140
+ const FfiConverterCompactionSpec = new (class extends AbstractFfiConverterByteArray {
1141
+ allocationSize(value) {
1142
+ const recordValue = uniffiRequireRecordObject("CompactionSpec", value);
1143
+ return uniffiArrayConverter(FfiConverterSourceId).allocationSize(recordValue["sources"]) + uniffiOptionalConverter(FfiConverterUInt32).allocationSize(recordValue["destination"]) + FfiConverterBool.allocationSize(recordValue["has_l0_sources"]) + FfiConverterBool.allocationSize(recordValue["has_sr_sources"]);
1144
+ }
1145
+
1146
+ write(value, writer) {
1147
+ const recordValue = uniffiRequireRecordObject("CompactionSpec", value);
1148
+ uniffiArrayConverter(FfiConverterSourceId).write(recordValue["sources"], writer);
1149
+ uniffiOptionalConverter(FfiConverterUInt32).write(recordValue["destination"], writer);
1150
+ FfiConverterBool.write(recordValue["has_l0_sources"], writer);
1151
+ FfiConverterBool.write(recordValue["has_sr_sources"], writer);
1152
+ }
1153
+
1154
+ read(reader) {
1155
+ return {
1156
+ "sources": uniffiArrayConverter(FfiConverterSourceId).read(reader),
1157
+ "destination": uniffiOptionalConverter(FfiConverterUInt32).read(reader),
1158
+ "has_l0_sources": FfiConverterBool.read(reader),
1159
+ "has_sr_sources": FfiConverterBool.read(reader),
1160
+ };
1161
+ }
1162
+ })();
1163
+ const FfiConverterCompactorStateView = new (class extends AbstractFfiConverterByteArray {
1164
+ allocationSize(value) {
1165
+ const recordValue = uniffiRequireRecordObject("CompactorStateView", value);
1166
+ return uniffiOptionalConverter(FfiConverterVersionedCompactions).allocationSize(recordValue["compactions"]) + FfiConverterVersionedManifest.allocationSize(recordValue["manifest"]);
1167
+ }
1168
+
1169
+ write(value, writer) {
1170
+ const recordValue = uniffiRequireRecordObject("CompactorStateView", value);
1171
+ uniffiOptionalConverter(FfiConverterVersionedCompactions).write(recordValue["compactions"], writer);
1172
+ FfiConverterVersionedManifest.write(recordValue["manifest"], writer);
1173
+ }
1174
+
1175
+ read(reader) {
1176
+ return {
1177
+ "compactions": uniffiOptionalConverter(FfiConverterVersionedCompactions).read(reader),
1178
+ "manifest": FfiConverterVersionedManifest.read(reader),
1179
+ };
1180
+ }
1181
+ })();
924
1182
  const FfiConverterDbStatus = new (class extends AbstractFfiConverterByteArray {
925
1183
  allocationSize(value) {
926
1184
  const recordValue = uniffiRequireRecordObject("DbStatus", value);
@@ -940,6 +1198,29 @@ const FfiConverterDbStatus = new (class extends AbstractFfiConverterByteArray {
940
1198
  };
941
1199
  }
942
1200
  })();
1201
+ const FfiConverterExternalDb = new (class extends AbstractFfiConverterByteArray {
1202
+ allocationSize(value) {
1203
+ const recordValue = uniffiRequireRecordObject("ExternalDb", value);
1204
+ return FfiConverterString.allocationSize(recordValue["path"]) + FfiConverterString.allocationSize(recordValue["source_checkpoint_id"]) + uniffiOptionalConverter(FfiConverterString).allocationSize(recordValue["final_checkpoint_id"]) + uniffiArrayConverter(FfiConverterSsTableId).allocationSize(recordValue["sst_ids"]);
1205
+ }
1206
+
1207
+ write(value, writer) {
1208
+ const recordValue = uniffiRequireRecordObject("ExternalDb", value);
1209
+ FfiConverterString.write(recordValue["path"], writer);
1210
+ FfiConverterString.write(recordValue["source_checkpoint_id"], writer);
1211
+ uniffiOptionalConverter(FfiConverterString).write(recordValue["final_checkpoint_id"], writer);
1212
+ uniffiArrayConverter(FfiConverterSsTableId).write(recordValue["sst_ids"], writer);
1213
+ }
1214
+
1215
+ read(reader) {
1216
+ return {
1217
+ "path": FfiConverterString.read(reader),
1218
+ "source_checkpoint_id": FfiConverterString.read(reader),
1219
+ "final_checkpoint_id": uniffiOptionalConverter(FfiConverterString).read(reader),
1220
+ "sst_ids": uniffiArrayConverter(FfiConverterSsTableId).read(reader),
1221
+ };
1222
+ }
1223
+ })();
943
1224
  const FfiConverterKeyRange = new (class extends AbstractFfiConverterByteArray {
944
1225
  allocationSize(value) {
945
1226
  const recordValue = uniffiRequireRecordObject("KeyRange", value);
@@ -1015,6 +1296,176 @@ const FfiConverterRowEntry = new (class extends AbstractFfiConverterByteArray {
1015
1296
  };
1016
1297
  }
1017
1298
  })();
1299
+ const FfiConverterSortedRun = new (class extends AbstractFfiConverterByteArray {
1300
+ allocationSize(value) {
1301
+ const recordValue = uniffiRequireRecordObject("SortedRun", value);
1302
+ return FfiConverterUInt32.allocationSize(recordValue["id"]) + uniffiArrayConverter(FfiConverterSsTableView).allocationSize(recordValue["sst_views"]) + FfiConverterUInt64.allocationSize(recordValue["estimated_size_bytes"]);
1303
+ }
1304
+
1305
+ write(value, writer) {
1306
+ const recordValue = uniffiRequireRecordObject("SortedRun", value);
1307
+ FfiConverterUInt32.write(recordValue["id"], writer);
1308
+ uniffiArrayConverter(FfiConverterSsTableView).write(recordValue["sst_views"], writer);
1309
+ FfiConverterUInt64.write(recordValue["estimated_size_bytes"], writer);
1310
+ }
1311
+
1312
+ read(reader) {
1313
+ return {
1314
+ "id": FfiConverterUInt32.read(reader),
1315
+ "sst_views": uniffiArrayConverter(FfiConverterSsTableView).read(reader),
1316
+ "estimated_size_bytes": FfiConverterUInt64.read(reader),
1317
+ };
1318
+ }
1319
+ })();
1320
+ const FfiConverterSsTableHandle = new (class extends AbstractFfiConverterByteArray {
1321
+ allocationSize(value) {
1322
+ const recordValue = uniffiRequireRecordObject("SsTableHandle", value);
1323
+ return FfiConverterSsTableId.allocationSize(recordValue["id"]) + FfiConverterSsTableInfo.allocationSize(recordValue["info"]) + FfiConverterUInt64.allocationSize(recordValue["estimated_size_bytes"]);
1324
+ }
1325
+
1326
+ write(value, writer) {
1327
+ const recordValue = uniffiRequireRecordObject("SsTableHandle", value);
1328
+ FfiConverterSsTableId.write(recordValue["id"], writer);
1329
+ FfiConverterSsTableInfo.write(recordValue["info"], writer);
1330
+ FfiConverterUInt64.write(recordValue["estimated_size_bytes"], writer);
1331
+ }
1332
+
1333
+ read(reader) {
1334
+ return {
1335
+ "id": FfiConverterSsTableId.read(reader),
1336
+ "info": FfiConverterSsTableInfo.read(reader),
1337
+ "estimated_size_bytes": FfiConverterUInt64.read(reader),
1338
+ };
1339
+ }
1340
+ })();
1341
+ const FfiConverterSsTableInfo = new (class extends AbstractFfiConverterByteArray {
1342
+ allocationSize(value) {
1343
+ const recordValue = uniffiRequireRecordObject("SsTableInfo", value);
1344
+ return uniffiOptionalConverter(FfiConverterBytes).allocationSize(recordValue["first_entry"]) + uniffiOptionalConverter(FfiConverterBytes).allocationSize(recordValue["last_entry"]) + FfiConverterUInt64.allocationSize(recordValue["index_offset"]) + FfiConverterUInt64.allocationSize(recordValue["index_len"]) + FfiConverterUInt64.allocationSize(recordValue["filter_offset"]) + FfiConverterUInt64.allocationSize(recordValue["filter_len"]) + uniffiOptionalConverter(FfiConverterCompressionCodec).allocationSize(recordValue["compression_codec"]) + FfiConverterSstType.allocationSize(recordValue["sst_type"]) + FfiConverterUInt64.allocationSize(recordValue["stats_offset"]) + FfiConverterUInt64.allocationSize(recordValue["stats_len"]) + FfiConverterFilterFormat.allocationSize(recordValue["filter_format"]);
1345
+ }
1346
+
1347
+ write(value, writer) {
1348
+ const recordValue = uniffiRequireRecordObject("SsTableInfo", value);
1349
+ uniffiOptionalConverter(FfiConverterBytes).write(recordValue["first_entry"], writer);
1350
+ uniffiOptionalConverter(FfiConverterBytes).write(recordValue["last_entry"], writer);
1351
+ FfiConverterUInt64.write(recordValue["index_offset"], writer);
1352
+ FfiConverterUInt64.write(recordValue["index_len"], writer);
1353
+ FfiConverterUInt64.write(recordValue["filter_offset"], writer);
1354
+ FfiConverterUInt64.write(recordValue["filter_len"], writer);
1355
+ uniffiOptionalConverter(FfiConverterCompressionCodec).write(recordValue["compression_codec"], writer);
1356
+ FfiConverterSstType.write(recordValue["sst_type"], writer);
1357
+ FfiConverterUInt64.write(recordValue["stats_offset"], writer);
1358
+ FfiConverterUInt64.write(recordValue["stats_len"], writer);
1359
+ FfiConverterFilterFormat.write(recordValue["filter_format"], writer);
1360
+ }
1361
+
1362
+ read(reader) {
1363
+ return {
1364
+ "first_entry": uniffiOptionalConverter(FfiConverterBytes).read(reader),
1365
+ "last_entry": uniffiOptionalConverter(FfiConverterBytes).read(reader),
1366
+ "index_offset": FfiConverterUInt64.read(reader),
1367
+ "index_len": FfiConverterUInt64.read(reader),
1368
+ "filter_offset": FfiConverterUInt64.read(reader),
1369
+ "filter_len": FfiConverterUInt64.read(reader),
1370
+ "compression_codec": uniffiOptionalConverter(FfiConverterCompressionCodec).read(reader),
1371
+ "sst_type": FfiConverterSstType.read(reader),
1372
+ "stats_offset": FfiConverterUInt64.read(reader),
1373
+ "stats_len": FfiConverterUInt64.read(reader),
1374
+ "filter_format": FfiConverterFilterFormat.read(reader),
1375
+ };
1376
+ }
1377
+ })();
1378
+ const FfiConverterSsTableView = new (class extends AbstractFfiConverterByteArray {
1379
+ allocationSize(value) {
1380
+ const recordValue = uniffiRequireRecordObject("SsTableView", value);
1381
+ return FfiConverterString.allocationSize(recordValue["id"]) + FfiConverterSsTableHandle.allocationSize(recordValue["sst"]) + uniffiOptionalConverter(FfiConverterKeyRange).allocationSize(recordValue["visible_range"]) + FfiConverterUInt64.allocationSize(recordValue["estimated_size_bytes"]);
1382
+ }
1383
+
1384
+ write(value, writer) {
1385
+ const recordValue = uniffiRequireRecordObject("SsTableView", value);
1386
+ FfiConverterString.write(recordValue["id"], writer);
1387
+ FfiConverterSsTableHandle.write(recordValue["sst"], writer);
1388
+ uniffiOptionalConverter(FfiConverterKeyRange).write(recordValue["visible_range"], writer);
1389
+ FfiConverterUInt64.write(recordValue["estimated_size_bytes"], writer);
1390
+ }
1391
+
1392
+ read(reader) {
1393
+ return {
1394
+ "id": FfiConverterString.read(reader),
1395
+ "sst": FfiConverterSsTableHandle.read(reader),
1396
+ "visible_range": uniffiOptionalConverter(FfiConverterKeyRange).read(reader),
1397
+ "estimated_size_bytes": FfiConverterUInt64.read(reader),
1398
+ };
1399
+ }
1400
+ })();
1401
+ const FfiConverterVersionedCompactions = new (class extends AbstractFfiConverterByteArray {
1402
+ allocationSize(value) {
1403
+ const recordValue = uniffiRequireRecordObject("VersionedCompactions", value);
1404
+ return FfiConverterUInt64.allocationSize(recordValue["id"]) + FfiConverterUInt64.allocationSize(recordValue["compactor_epoch"]) + uniffiArrayConverter(FfiConverterCompaction).allocationSize(recordValue["recent_compactions"]);
1405
+ }
1406
+
1407
+ write(value, writer) {
1408
+ const recordValue = uniffiRequireRecordObject("VersionedCompactions", value);
1409
+ FfiConverterUInt64.write(recordValue["id"], writer);
1410
+ FfiConverterUInt64.write(recordValue["compactor_epoch"], writer);
1411
+ uniffiArrayConverter(FfiConverterCompaction).write(recordValue["recent_compactions"], writer);
1412
+ }
1413
+
1414
+ read(reader) {
1415
+ return {
1416
+ "id": FfiConverterUInt64.read(reader),
1417
+ "compactor_epoch": FfiConverterUInt64.read(reader),
1418
+ "recent_compactions": uniffiArrayConverter(FfiConverterCompaction).read(reader),
1419
+ };
1420
+ }
1421
+ })();
1422
+ const FfiConverterVersionedManifest = new (class extends AbstractFfiConverterByteArray {
1423
+ allocationSize(value) {
1424
+ const recordValue = uniffiRequireRecordObject("VersionedManifest", value);
1425
+ return FfiConverterUInt64.allocationSize(recordValue["id"]) + FfiConverterUInt64.allocationSize(recordValue["writer_epoch"]) + FfiConverterUInt64.allocationSize(recordValue["compactor_epoch"]) + uniffiArrayConverter(FfiConverterExternalDb).allocationSize(recordValue["external_dbs"]) + FfiConverterBool.allocationSize(recordValue["initialized"]) + uniffiOptionalConverter(FfiConverterString).allocationSize(recordValue["last_compacted_l0_sst_view_id"]) + uniffiOptionalConverter(FfiConverterString).allocationSize(recordValue["last_compacted_l0_sst_id"]) + uniffiArrayConverter(FfiConverterSsTableView).allocationSize(recordValue["l0"]) + uniffiArrayConverter(FfiConverterSortedRun).allocationSize(recordValue["compacted"]) + FfiConverterUInt64.allocationSize(recordValue["next_wal_sst_id"]) + FfiConverterUInt64.allocationSize(recordValue["replay_after_wal_id"]) + FfiConverterInt64.allocationSize(recordValue["last_l0_clock_tick"]) + FfiConverterUInt64.allocationSize(recordValue["last_l0_seq"]) + FfiConverterUInt64.allocationSize(recordValue["recent_snapshot_min_seq"]) + uniffiArrayConverter(FfiConverterCheckpoint).allocationSize(recordValue["checkpoints"]) + uniffiOptionalConverter(FfiConverterString).allocationSize(recordValue["wal_object_store_uri"]);
1426
+ }
1427
+
1428
+ write(value, writer) {
1429
+ const recordValue = uniffiRequireRecordObject("VersionedManifest", value);
1430
+ FfiConverterUInt64.write(recordValue["id"], writer);
1431
+ FfiConverterUInt64.write(recordValue["writer_epoch"], writer);
1432
+ FfiConverterUInt64.write(recordValue["compactor_epoch"], writer);
1433
+ uniffiArrayConverter(FfiConverterExternalDb).write(recordValue["external_dbs"], writer);
1434
+ FfiConverterBool.write(recordValue["initialized"], writer);
1435
+ uniffiOptionalConverter(FfiConverterString).write(recordValue["last_compacted_l0_sst_view_id"], writer);
1436
+ uniffiOptionalConverter(FfiConverterString).write(recordValue["last_compacted_l0_sst_id"], writer);
1437
+ uniffiArrayConverter(FfiConverterSsTableView).write(recordValue["l0"], writer);
1438
+ uniffiArrayConverter(FfiConverterSortedRun).write(recordValue["compacted"], writer);
1439
+ FfiConverterUInt64.write(recordValue["next_wal_sst_id"], writer);
1440
+ FfiConverterUInt64.write(recordValue["replay_after_wal_id"], writer);
1441
+ FfiConverterInt64.write(recordValue["last_l0_clock_tick"], writer);
1442
+ FfiConverterUInt64.write(recordValue["last_l0_seq"], writer);
1443
+ FfiConverterUInt64.write(recordValue["recent_snapshot_min_seq"], writer);
1444
+ uniffiArrayConverter(FfiConverterCheckpoint).write(recordValue["checkpoints"], writer);
1445
+ uniffiOptionalConverter(FfiConverterString).write(recordValue["wal_object_store_uri"], writer);
1446
+ }
1447
+
1448
+ read(reader) {
1449
+ return {
1450
+ "id": FfiConverterUInt64.read(reader),
1451
+ "writer_epoch": FfiConverterUInt64.read(reader),
1452
+ "compactor_epoch": FfiConverterUInt64.read(reader),
1453
+ "external_dbs": uniffiArrayConverter(FfiConverterExternalDb).read(reader),
1454
+ "initialized": FfiConverterBool.read(reader),
1455
+ "last_compacted_l0_sst_view_id": uniffiOptionalConverter(FfiConverterString).read(reader),
1456
+ "last_compacted_l0_sst_id": uniffiOptionalConverter(FfiConverterString).read(reader),
1457
+ "l0": uniffiArrayConverter(FfiConverterSsTableView).read(reader),
1458
+ "compacted": uniffiArrayConverter(FfiConverterSortedRun).read(reader),
1459
+ "next_wal_sst_id": FfiConverterUInt64.read(reader),
1460
+ "replay_after_wal_id": FfiConverterUInt64.read(reader),
1461
+ "last_l0_clock_tick": FfiConverterInt64.read(reader),
1462
+ "last_l0_seq": FfiConverterUInt64.read(reader),
1463
+ "recent_snapshot_min_seq": FfiConverterUInt64.read(reader),
1464
+ "checkpoints": uniffiArrayConverter(FfiConverterCheckpoint).read(reader),
1465
+ "wal_object_store_uri": uniffiOptionalConverter(FfiConverterString).read(reader),
1466
+ };
1467
+ }
1468
+ })();
1018
1469
  const FfiConverterWriteHandle = new (class extends AbstractFfiConverterByteArray {
1019
1470
  allocationSize(value) {
1020
1471
  const recordValue = uniffiRequireRecordObject("WriteHandle", value);
@@ -1336,6 +1787,122 @@ const FfiConverterLogLevel = new (class extends AbstractFfiConverterByteArray {
1336
1787
  }
1337
1788
  }
1338
1789
  })();
1790
+ const FfiConverterCompactionStatus = new (class extends AbstractFfiConverterByteArray {
1791
+ allocationSize(value) {
1792
+ uniffiRequireFlatEnumValue(CompactionStatus, "CompactionStatus", value);
1793
+ return 4;
1794
+ }
1795
+
1796
+ write(value, writer) {
1797
+ const enumValue = uniffiRequireFlatEnumValue(CompactionStatus, "CompactionStatus", value);
1798
+ switch (enumValue) {
1799
+ case CompactionStatus["Submitted"]:
1800
+ writer.writeInt32(1);
1801
+ return;
1802
+ case CompactionStatus["Running"]:
1803
+ writer.writeInt32(2);
1804
+ return;
1805
+ case CompactionStatus["Completed"]:
1806
+ writer.writeInt32(3);
1807
+ return;
1808
+ case CompactionStatus["Failed"]:
1809
+ writer.writeInt32(4);
1810
+ return;
1811
+ default:
1812
+ throw new UnexpectedEnumCase(`Unexpected CompactionStatus case ${String(enumValue)}.`);
1813
+ }
1814
+ }
1815
+
1816
+ read(reader) {
1817
+ const enumTag = reader.readInt32();
1818
+ switch (enumTag) {
1819
+ case 1:
1820
+ return CompactionStatus["Submitted"];
1821
+ case 2:
1822
+ return CompactionStatus["Running"];
1823
+ case 3:
1824
+ return CompactionStatus["Completed"];
1825
+ case 4:
1826
+ return CompactionStatus["Failed"];
1827
+ default:
1828
+ throw new UnexpectedEnumCase(`Unexpected CompactionStatus case ${String(enumTag)}.`);
1829
+ }
1830
+ }
1831
+ })();
1832
+ const FfiConverterCompressionCodec = new (class extends AbstractFfiConverterByteArray {
1833
+ allocationSize(value) {
1834
+ uniffiRequireFlatEnumValue(CompressionCodec, "CompressionCodec", value);
1835
+ return 4;
1836
+ }
1837
+
1838
+ write(value, writer) {
1839
+ const enumValue = uniffiRequireFlatEnumValue(CompressionCodec, "CompressionCodec", value);
1840
+ switch (enumValue) {
1841
+ case CompressionCodec["Snappy"]:
1842
+ writer.writeInt32(1);
1843
+ return;
1844
+ case CompressionCodec["Zlib"]:
1845
+ writer.writeInt32(2);
1846
+ return;
1847
+ case CompressionCodec["Lz4"]:
1848
+ writer.writeInt32(3);
1849
+ return;
1850
+ case CompressionCodec["Zstd"]:
1851
+ writer.writeInt32(4);
1852
+ return;
1853
+ default:
1854
+ throw new UnexpectedEnumCase(`Unexpected CompressionCodec case ${String(enumValue)}.`);
1855
+ }
1856
+ }
1857
+
1858
+ read(reader) {
1859
+ const enumTag = reader.readInt32();
1860
+ switch (enumTag) {
1861
+ case 1:
1862
+ return CompressionCodec["Snappy"];
1863
+ case 2:
1864
+ return CompressionCodec["Zlib"];
1865
+ case 3:
1866
+ return CompressionCodec["Lz4"];
1867
+ case 4:
1868
+ return CompressionCodec["Zstd"];
1869
+ default:
1870
+ throw new UnexpectedEnumCase(`Unexpected CompressionCodec case ${String(enumTag)}.`);
1871
+ }
1872
+ }
1873
+ })();
1874
+ const FfiConverterFilterFormat = new (class extends AbstractFfiConverterByteArray {
1875
+ allocationSize(value) {
1876
+ uniffiRequireFlatEnumValue(FilterFormat, "FilterFormat", value);
1877
+ return 4;
1878
+ }
1879
+
1880
+ write(value, writer) {
1881
+ const enumValue = uniffiRequireFlatEnumValue(FilterFormat, "FilterFormat", value);
1882
+ switch (enumValue) {
1883
+ case FilterFormat["Legacy"]:
1884
+ writer.writeInt32(1);
1885
+ return;
1886
+ case FilterFormat["Composite"]:
1887
+ writer.writeInt32(2);
1888
+ return;
1889
+ default:
1890
+ throw new UnexpectedEnumCase(`Unexpected FilterFormat case ${String(enumValue)}.`);
1891
+ }
1892
+ }
1893
+
1894
+ read(reader) {
1895
+ const enumTag = reader.readInt32();
1896
+ switch (enumTag) {
1897
+ case 1:
1898
+ return FilterFormat["Legacy"];
1899
+ case 2:
1900
+ return FilterFormat["Composite"];
1901
+ default:
1902
+ throw new UnexpectedEnumCase(`Unexpected FilterFormat case ${String(enumTag)}.`);
1903
+ }
1904
+ }
1905
+ })();
1339
1906
  const FfiConverterRowEntryKind = new (class extends AbstractFfiConverterByteArray {
1340
1907
  allocationSize(value) {
1341
1908
  uniffiRequireFlatEnumValue(RowEntryKind, "RowEntryKind", value);
@@ -1373,6 +1940,38 @@ const FfiConverterRowEntryKind = new (class extends AbstractFfiConverterByteArra
1373
1940
  }
1374
1941
  }
1375
1942
  })();
1943
+ const FfiConverterSstType = new (class extends AbstractFfiConverterByteArray {
1944
+ allocationSize(value) {
1945
+ uniffiRequireFlatEnumValue(SstType, "SstType", value);
1946
+ return 4;
1947
+ }
1948
+
1949
+ write(value, writer) {
1950
+ const enumValue = uniffiRequireFlatEnumValue(SstType, "SstType", value);
1951
+ switch (enumValue) {
1952
+ case SstType["Compacted"]:
1953
+ writer.writeInt32(1);
1954
+ return;
1955
+ case SstType["Wal"]:
1956
+ writer.writeInt32(2);
1957
+ return;
1958
+ default:
1959
+ throw new UnexpectedEnumCase(`Unexpected SstType case ${String(enumValue)}.`);
1960
+ }
1961
+ }
1962
+
1963
+ read(reader) {
1964
+ const enumTag = reader.readInt32();
1965
+ switch (enumTag) {
1966
+ case 1:
1967
+ return SstType["Compacted"];
1968
+ case 2:
1969
+ return SstType["Wal"];
1970
+ default:
1971
+ throw new UnexpectedEnumCase(`Unexpected SstType case ${String(enumTag)}.`);
1972
+ }
1973
+ }
1974
+ })();
1376
1975
  const FfiConverterTtl = new (class extends AbstractFfiConverterByteArray {
1377
1976
  allocationSize(value) {
1378
1977
  const enumValue = uniffiRequireTaggedEnumValue("Ttl", value);
@@ -1465,7 +2064,147 @@ const FfiConverterMetricValue = new (class extends AbstractFfiConverterByteArray
1465
2064
  FfiConverterHistogramMetricValue.write(enumValue[""], writer);
1466
2065
  return;
1467
2066
  default:
1468
- throw new UnexpectedEnumCase(`Unexpected MetricValue case ${String(enumValue.tag)}.`);
2067
+ throw new UnexpectedEnumCase(`Unexpected MetricValue case ${String(enumValue.tag)}.`);
2068
+ }
2069
+ }
2070
+
2071
+ read(reader) {
2072
+ const enumTag = reader.readInt32();
2073
+ switch (enumTag) {
2074
+ case 1:
2075
+ return MetricValue.Counter(FfiConverterUInt64.read(reader));
2076
+ case 2:
2077
+ return MetricValue.Gauge(FfiConverterInt64.read(reader));
2078
+ case 3:
2079
+ return MetricValue.UpDownCounter(FfiConverterInt64.read(reader));
2080
+ case 4:
2081
+ return MetricValue.Histogram(FfiConverterHistogramMetricValue.read(reader));
2082
+ default:
2083
+ throw new UnexpectedEnumCase(`Unexpected MetricValue case ${String(enumTag)}.`);
2084
+ }
2085
+ }
2086
+ })();
2087
+ const FfiConverterCacheTarget = new (class extends AbstractFfiConverterByteArray {
2088
+ allocationSize(value) {
2089
+ const enumValue = uniffiRequireTaggedEnumValue("CacheTarget", value);
2090
+ switch (enumValue.tag) {
2091
+ case "Filters":
2092
+ return 4;
2093
+ case "Index":
2094
+ return 4;
2095
+ case "Stats":
2096
+ return 4;
2097
+ case "Data":
2098
+ return 4 + FfiConverterKeyRange.allocationSize(enumValue["range"]);
2099
+ default:
2100
+ throw new UnexpectedEnumCase(`Unexpected CacheTarget case ${String(enumValue.tag)}.`);
2101
+ }
2102
+ }
2103
+
2104
+ write(value, writer) {
2105
+ const enumValue = uniffiRequireTaggedEnumValue("CacheTarget", value);
2106
+ switch (enumValue.tag) {
2107
+ case "Filters":
2108
+ writer.writeInt32(1);
2109
+ return;
2110
+ case "Index":
2111
+ writer.writeInt32(2);
2112
+ return;
2113
+ case "Stats":
2114
+ writer.writeInt32(3);
2115
+ return;
2116
+ case "Data":
2117
+ writer.writeInt32(4);
2118
+ FfiConverterKeyRange.write(enumValue["range"], writer);
2119
+ return;
2120
+ default:
2121
+ throw new UnexpectedEnumCase(`Unexpected CacheTarget case ${String(enumValue.tag)}.`);
2122
+ }
2123
+ }
2124
+
2125
+ read(reader) {
2126
+ const enumTag = reader.readInt32();
2127
+ switch (enumTag) {
2128
+ case 1:
2129
+ return CacheTarget.Filters();
2130
+ case 2:
2131
+ return CacheTarget.Index();
2132
+ case 3:
2133
+ return CacheTarget.Stats();
2134
+ case 4:
2135
+ return CacheTarget.Data(FfiConverterKeyRange.read(reader));
2136
+ default:
2137
+ throw new UnexpectedEnumCase(`Unexpected CacheTarget case ${String(enumTag)}.`);
2138
+ }
2139
+ }
2140
+ })();
2141
+ const FfiConverterSourceId = new (class extends AbstractFfiConverterByteArray {
2142
+ allocationSize(value) {
2143
+ const enumValue = uniffiRequireTaggedEnumValue("SourceId", value);
2144
+ switch (enumValue.tag) {
2145
+ case "SortedRun":
2146
+ return 4 + FfiConverterUInt32.allocationSize(enumValue[""]);
2147
+ case "SstView":
2148
+ return 4 + FfiConverterString.allocationSize(enumValue[""]);
2149
+ default:
2150
+ throw new UnexpectedEnumCase(`Unexpected SourceId case ${String(enumValue.tag)}.`);
2151
+ }
2152
+ }
2153
+
2154
+ write(value, writer) {
2155
+ const enumValue = uniffiRequireTaggedEnumValue("SourceId", value);
2156
+ switch (enumValue.tag) {
2157
+ case "SortedRun":
2158
+ writer.writeInt32(1);
2159
+ FfiConverterUInt32.write(enumValue[""], writer);
2160
+ return;
2161
+ case "SstView":
2162
+ writer.writeInt32(2);
2163
+ FfiConverterString.write(enumValue[""], writer);
2164
+ return;
2165
+ default:
2166
+ throw new UnexpectedEnumCase(`Unexpected SourceId case ${String(enumValue.tag)}.`);
2167
+ }
2168
+ }
2169
+
2170
+ read(reader) {
2171
+ const enumTag = reader.readInt32();
2172
+ switch (enumTag) {
2173
+ case 1:
2174
+ return SourceId.SortedRun(FfiConverterUInt32.read(reader));
2175
+ case 2:
2176
+ return SourceId.SstView(FfiConverterString.read(reader));
2177
+ default:
2178
+ throw new UnexpectedEnumCase(`Unexpected SourceId case ${String(enumTag)}.`);
2179
+ }
2180
+ }
2181
+ })();
2182
+ const FfiConverterSsTableId = new (class extends AbstractFfiConverterByteArray {
2183
+ allocationSize(value) {
2184
+ const enumValue = uniffiRequireTaggedEnumValue("SsTableId", value);
2185
+ switch (enumValue.tag) {
2186
+ case "Wal":
2187
+ return 4 + FfiConverterUInt64.allocationSize(enumValue[""]);
2188
+ case "Compacted":
2189
+ return 4 + FfiConverterString.allocationSize(enumValue[""]);
2190
+ default:
2191
+ throw new UnexpectedEnumCase(`Unexpected SsTableId case ${String(enumValue.tag)}.`);
2192
+ }
2193
+ }
2194
+
2195
+ write(value, writer) {
2196
+ const enumValue = uniffiRequireTaggedEnumValue("SsTableId", value);
2197
+ switch (enumValue.tag) {
2198
+ case "Wal":
2199
+ writer.writeInt32(1);
2200
+ FfiConverterUInt64.write(enumValue[""], writer);
2201
+ return;
2202
+ case "Compacted":
2203
+ writer.writeInt32(2);
2204
+ FfiConverterString.write(enumValue[""], writer);
2205
+ return;
2206
+ default:
2207
+ throw new UnexpectedEnumCase(`Unexpected SsTableId case ${String(enumValue.tag)}.`);
1469
2208
  }
1470
2209
  }
1471
2210
 
@@ -1473,15 +2212,11 @@ const FfiConverterMetricValue = new (class extends AbstractFfiConverterByteArray
1473
2212
  const enumTag = reader.readInt32();
1474
2213
  switch (enumTag) {
1475
2214
  case 1:
1476
- return MetricValue.Counter(FfiConverterUInt64.read(reader));
2215
+ return SsTableId.Wal(FfiConverterUInt64.read(reader));
1477
2216
  case 2:
1478
- return MetricValue.Gauge(FfiConverterInt64.read(reader));
1479
- case 3:
1480
- return MetricValue.UpDownCounter(FfiConverterInt64.read(reader));
1481
- case 4:
1482
- return MetricValue.Histogram(FfiConverterHistogramMetricValue.read(reader));
2217
+ return SsTableId.Compacted(FfiConverterString.read(reader));
1483
2218
  default:
1484
- throw new UnexpectedEnumCase(`Unexpected MetricValue case ${String(enumTag)}.`);
2219
+ throw new UnexpectedEnumCase(`Unexpected SsTableId case ${String(enumTag)}.`);
1485
2220
  }
1486
2221
  }
1487
2222
  })();
@@ -2592,29 +3327,428 @@ configureRuntimeHooks({
2592
3327
  onLoad(bindings) {
2593
3328
  uniffiRegisterCallbackVtables(bindings);
2594
3329
  },
2595
- onUnload() {
2596
- if (uniffiRustFutureContinuationPointer != null) {
2597
- koffi.unregister(uniffiRustFutureContinuationPointer);
2598
- uniffiRustFutureContinuationPointer = null;
2599
- }
2600
- uniffiUnregisterCallbackVtables();
3330
+ onUnload() {
3331
+ if (uniffiRustFutureContinuationPointer != null) {
3332
+ koffi.unregister(uniffiRustFutureContinuationPointer);
3333
+ uniffiRustFutureContinuationPointer = null;
3334
+ }
3335
+ uniffiUnregisterCallbackVtables();
3336
+ },
3337
+ });
3338
+
3339
+ /**
3340
+ * Installs SlateDB logging exactly once for the current process.
3341
+ *
3342
+ * If `callback` is provided, log records are forwarded to it. Otherwise logs
3343
+ * are written to standard error using the default tracing formatter.
3344
+ */
3345
+ export function init_logging(level, callback) {
3346
+ const loweredLevel = uniffiLowerIntoRustBuffer(FfiConverterLogLevel, level);
3347
+ const loweredCallback = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterLogCallback), callback);
3348
+ uniffiRustCaller.rustCall(
3349
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_func_init_logging(loweredLevel, loweredCallback, status),
3350
+ uniffiRustCallOptions(FfiConverterError),
3351
+ );
3352
+ }
3353
+
3354
+ /**
3355
+ * Administrative read/query handle for SlateDB.
3356
+ */
3357
+ export class Admin extends UniffiObjectBase {
3358
+ constructor() {
3359
+ super();
3360
+ return uniffiNotImplemented("Admin.constructor");
3361
+ }
3362
+
3363
+ /**
3364
+ * Looks up a sequence number for the provided Unix UTC timestamp seconds.
3365
+ */
3366
+ async get_sequence_for_timestamp(timestamp_secs, round_up) {
3367
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3368
+ const ffiMethod =
3369
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3370
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_get_sequence_for_timestamp_generic_abi
3371
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_get_sequence_for_timestamp;
3372
+ const loweredTimestampSecs = FfiConverterInt64.lower(timestamp_secs);
3373
+ const loweredRoundUp = FfiConverterBool.lower(round_up);
3374
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3375
+ return rustCallAsync({
3376
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredTimestampSecs, loweredRoundUp),
3377
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3378
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3379
+ completeFunc,
3380
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3381
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiOptionalConverter(FfiConverterUInt64), uniffiResult),
3382
+ ...uniffiRustCallOptions(FfiConverterError),
3383
+ });
3384
+ }
3385
+
3386
+ /**
3387
+ * Looks up a timestamp for the provided sequence number.
3388
+ */
3389
+ async get_timestamp_for_sequence(seq, round_up) {
3390
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3391
+ const ffiMethod =
3392
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3393
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_get_timestamp_for_sequence_generic_abi
3394
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_get_timestamp_for_sequence;
3395
+ const loweredSeq = FfiConverterUInt64.lower(seq);
3396
+ const loweredRoundUp = FfiConverterBool.lower(round_up);
3397
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3398
+ return rustCallAsync({
3399
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredSeq, loweredRoundUp),
3400
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3401
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3402
+ completeFunc,
3403
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3404
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiOptionalConverter(FfiConverterInt64), uniffiResult),
3405
+ ...uniffiRustCallOptions(FfiConverterError),
3406
+ });
3407
+ }
3408
+
3409
+ /**
3410
+ * Lists checkpoints, optionally filtering by exact name.
3411
+ */
3412
+ async list_checkpoints(name_filter) {
3413
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3414
+ const ffiMethod =
3415
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3416
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_list_checkpoints_generic_abi
3417
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_list_checkpoints;
3418
+ const loweredNameFilter = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterString), name_filter);
3419
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3420
+ return rustCallAsync({
3421
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredNameFilter),
3422
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3423
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3424
+ completeFunc,
3425
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3426
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiArrayConverter(FfiConverterCheckpoint), uniffiResult),
3427
+ ...uniffiRustCallOptions(FfiConverterError),
3428
+ });
3429
+ }
3430
+
3431
+ /**
3432
+ * Lists compactions files inside the half-open ID range `[from, to)`.
3433
+ */
3434
+ async list_compactions(from, to) {
3435
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3436
+ const ffiMethod =
3437
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3438
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_list_compactions_generic_abi
3439
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_list_compactions;
3440
+ const loweredFrom = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterUInt64), from);
3441
+ const loweredTo = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterUInt64), to);
3442
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3443
+ return rustCallAsync({
3444
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredFrom, loweredTo),
3445
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3446
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3447
+ completeFunc,
3448
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3449
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiArrayConverter(FfiConverterVersionedCompactions), uniffiResult),
3450
+ ...uniffiRustCallOptions(FfiConverterError),
3451
+ });
3452
+ }
3453
+
3454
+ /**
3455
+ * Lists manifests inside the half-open ID range `[from, to)`.
3456
+ */
3457
+ async list_manifests(from, to) {
3458
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3459
+ const ffiMethod =
3460
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3461
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_list_manifests_generic_abi
3462
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_list_manifests;
3463
+ const loweredFrom = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterUInt64), from);
3464
+ const loweredTo = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterUInt64), to);
3465
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3466
+ return rustCallAsync({
3467
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredFrom, loweredTo),
3468
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3469
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3470
+ completeFunc,
3471
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3472
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiArrayConverter(FfiConverterVersionedManifest), uniffiResult),
3473
+ ...uniffiRustCallOptions(FfiConverterError),
3474
+ });
3475
+ }
3476
+
3477
+ /**
3478
+ * Reads a compaction by ULID string from a specific or latest compactions file.
3479
+ */
3480
+ async read_compaction(compaction_id, compactions_id) {
3481
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3482
+ const ffiMethod =
3483
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3484
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_read_compaction_generic_abi
3485
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_read_compaction;
3486
+ const loweredCompactionId = uniffiLowerString(compaction_id);
3487
+ const loweredCompactionsId = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterUInt64), compactions_id);
3488
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3489
+ return rustCallAsync({
3490
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredCompactionId, loweredCompactionsId),
3491
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3492
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3493
+ completeFunc,
3494
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3495
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiOptionalConverter(FfiConverterCompaction), uniffiResult),
3496
+ ...uniffiRustCallOptions(FfiConverterError),
3497
+ });
3498
+ }
3499
+
3500
+ /**
3501
+ * Reads a specific compactions file by ID, or the latest when `id` is `None`.
3502
+ */
3503
+ async read_compactions(id) {
3504
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3505
+ const ffiMethod =
3506
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3507
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_read_compactions_generic_abi
3508
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_read_compactions;
3509
+ const loweredId = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterUInt64), id);
3510
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3511
+ return rustCallAsync({
3512
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredId),
3513
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3514
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3515
+ completeFunc,
3516
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3517
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiOptionalConverter(FfiConverterVersionedCompactions), uniffiResult),
3518
+ ...uniffiRustCallOptions(FfiConverterError),
3519
+ });
3520
+ }
3521
+
3522
+ /**
3523
+ * Reads the latest compactor state view.
3524
+ */
3525
+ async read_compactor_state_view() {
3526
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3527
+ const ffiMethod =
3528
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3529
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_read_compactor_state_view_generic_abi
3530
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_read_compactor_state_view;
3531
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3532
+ return rustCallAsync({
3533
+ rustFutureFunc: () => ffiMethod(loweredSelf),
3534
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3535
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3536
+ completeFunc,
3537
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3538
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(FfiConverterCompactorStateView, uniffiResult),
3539
+ ...uniffiRustCallOptions(FfiConverterError),
3540
+ });
3541
+ }
3542
+
3543
+ /**
3544
+ * Reads a specific manifest by ID, or the latest when `id` is `None`.
3545
+ */
3546
+ async read_manifest(id) {
3547
+ const loweredSelf = uniffiAdminObjectFactory.cloneHandle(this);
3548
+ const ffiMethod =
3549
+ uniffiAdminObjectFactory.usesGenericAbi(this)
3550
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_read_manifest_generic_abi
3551
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_admin_read_manifest;
3552
+ const loweredId = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterUInt64), id);
3553
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
3554
+ return rustCallAsync({
3555
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredId),
3556
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
3557
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
3558
+ completeFunc,
3559
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
3560
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiOptionalConverter(FfiConverterVersionedManifest), uniffiResult),
3561
+ ...uniffiRustCallOptions(FfiConverterError),
3562
+ });
3563
+ }
3564
+ }
3565
+
3566
+ const uniffiAdminObjectFactory = createObjectFactory({
3567
+ typeName: "Admin",
3568
+ createInstance: () => Object.create(Admin.prototype),
3569
+ cloneFreeUsesUniffiHandle: true,
3570
+ cloneHandleGeneric(handle) {
3571
+ return uniffiRustCaller.rustCall(
3572
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_clone_admin_generic_abi(handle, status),
3573
+ uniffiRustCallOptions(),
3574
+ );
3575
+ },
3576
+ cloneHandleRawExternal(handle) {
3577
+ const rawExternalCloneHandle = uniffiGetCachedLibraryFunction(
3578
+ "uniffi_slatedb_uniffi_fn_clone_admin:raw-external",
3579
+ (bindings) => bindings.library.func(
3580
+ "uniffi_slatedb_uniffi_fn_clone_admin",
3581
+ bindings.ffiTypes.VoidPointer,
3582
+ [bindings.ffiTypes.VoidPointer, koffi.pointer(bindings.ffiTypes.RustCallStatus)],
3583
+ ),
3584
+ );
3585
+ return uniffiRustCaller.rustCall(
3586
+ (status) => rawExternalCloneHandle(handle, status),
3587
+ uniffiRustCallOptions(),
3588
+ );
3589
+ },
3590
+ cloneHandle(handle) {
3591
+ return uniffiRustCaller.rustCall(
3592
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_clone_admin(handle, status),
3593
+ uniffiRustCallOptions(),
3594
+ );
3595
+ },
3596
+ freeHandleGeneric(handle) {
3597
+ uniffiRustCaller.rustCall(
3598
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_free_admin_generic_abi(handle, status),
3599
+ uniffiRustCallOptions(),
3600
+ );
3601
+ },
3602
+ freeHandleRawExternal(handle) {
3603
+ const rawExternalFreeHandle = uniffiGetCachedLibraryFunction(
3604
+ "uniffi_slatedb_uniffi_fn_free_admin:raw-external",
3605
+ (bindings) => bindings.library.func(
3606
+ "uniffi_slatedb_uniffi_fn_free_admin",
3607
+ "void",
3608
+ [bindings.ffiTypes.VoidPointer, koffi.pointer(bindings.ffiTypes.RustCallStatus)],
3609
+ ),
3610
+ );
3611
+ uniffiRustCaller.rustCall(
3612
+ (status) => rawExternalFreeHandle(handle, status),
3613
+ uniffiRustCallOptions(),
3614
+ );
3615
+ },
3616
+ freeHandle(handle) {
3617
+ uniffiRustCaller.rustCall(
3618
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_free_admin(handle, status),
3619
+ uniffiRustCallOptions(),
3620
+ );
3621
+ },
3622
+ });
3623
+ const FfiConverterAdmin = createObjectConverter(uniffiAdminObjectFactory);
3624
+
3625
+ /**
3626
+ * Builder for opening an administrative [`crate::Admin`] handle.
3627
+ *
3628
+ * Builders are single-use: calling [`AdminBuilder::build`] consumes the builder.
3629
+ */
3630
+ export class AdminBuilder extends UniffiObjectBase {
3631
+ /**
3632
+ * Creates a new admin builder for `path` in `object_store`.
3633
+ */
3634
+ constructor(path, object_store) {
3635
+ super();
3636
+ const loweredPath = uniffiLowerString(path);
3637
+ const loweredObjectStore = uniffiObjectStoreObjectFactory.cloneHandle(object_store);
3638
+ const pointer = uniffiRustCaller.rustCall(
3639
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_constructor_adminbuilder_new(loweredPath, loweredObjectStore, status),
3640
+ uniffiRustCallOptions(),
3641
+ );
3642
+ return uniffiAdminBuilderObjectFactory.attach(this, pointer);
3643
+ }
3644
+
3645
+ /**
3646
+ * Builds the admin handle and consumes this builder.
3647
+ */
3648
+ build() {
3649
+ const loweredSelf = uniffiAdminBuilderObjectFactory.cloneHandle(this);
3650
+ const ffiMethod =
3651
+ uniffiAdminBuilderObjectFactory.usesGenericAbi(this)
3652
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_adminbuilder_build_generic_abi
3653
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_adminbuilder_build;
3654
+ const uniffiResult = uniffiRustCaller.rustCall(
3655
+ (status) => ffiMethod(loweredSelf, status),
3656
+ uniffiRustCallOptions(FfiConverterError),
3657
+ );
3658
+ return uniffiAdminObjectFactory.create(uniffiResult);
3659
+ }
3660
+
3661
+ /**
3662
+ * Sets the seed used for SlateDB's internal random number generation.
3663
+ */
3664
+ with_seed(seed) {
3665
+ const loweredSelf = uniffiAdminBuilderObjectFactory.cloneHandle(this);
3666
+ const ffiMethod =
3667
+ uniffiAdminBuilderObjectFactory.usesGenericAbi(this)
3668
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_adminbuilder_with_seed_generic_abi
3669
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_adminbuilder_with_seed;
3670
+ const loweredSeed = FfiConverterUInt64.lower(seed);
3671
+ uniffiRustCaller.rustCall(
3672
+ (status) => ffiMethod(loweredSelf, loweredSeed, status),
3673
+ uniffiRustCallOptions(FfiConverterError),
3674
+ );
3675
+ }
3676
+
3677
+ /**
3678
+ * Uses a separate object store for WAL-backed administrative operations.
3679
+ */
3680
+ with_wal_object_store(wal_object_store) {
3681
+ const loweredSelf = uniffiAdminBuilderObjectFactory.cloneHandle(this);
3682
+ const ffiMethod =
3683
+ uniffiAdminBuilderObjectFactory.usesGenericAbi(this)
3684
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_adminbuilder_with_wal_object_store_generic_abi
3685
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_adminbuilder_with_wal_object_store;
3686
+ const loweredWalObjectStore = uniffiObjectStoreObjectFactory.cloneHandle(wal_object_store);
3687
+ uniffiRustCaller.rustCall(
3688
+ (status) => ffiMethod(loweredSelf, loweredWalObjectStore, status),
3689
+ uniffiRustCallOptions(FfiConverterError),
3690
+ );
3691
+ }
3692
+ }
3693
+
3694
+ const uniffiAdminBuilderObjectFactory = createObjectFactory({
3695
+ typeName: "AdminBuilder",
3696
+ createInstance: () => Object.create(AdminBuilder.prototype),
3697
+ cloneFreeUsesUniffiHandle: true,
3698
+ cloneHandleGeneric(handle) {
3699
+ return uniffiRustCaller.rustCall(
3700
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_clone_adminbuilder_generic_abi(handle, status),
3701
+ uniffiRustCallOptions(),
3702
+ );
3703
+ },
3704
+ cloneHandleRawExternal(handle) {
3705
+ const rawExternalCloneHandle = uniffiGetCachedLibraryFunction(
3706
+ "uniffi_slatedb_uniffi_fn_clone_adminbuilder:raw-external",
3707
+ (bindings) => bindings.library.func(
3708
+ "uniffi_slatedb_uniffi_fn_clone_adminbuilder",
3709
+ bindings.ffiTypes.VoidPointer,
3710
+ [bindings.ffiTypes.VoidPointer, koffi.pointer(bindings.ffiTypes.RustCallStatus)],
3711
+ ),
3712
+ );
3713
+ return uniffiRustCaller.rustCall(
3714
+ (status) => rawExternalCloneHandle(handle, status),
3715
+ uniffiRustCallOptions(),
3716
+ );
3717
+ },
3718
+ cloneHandle(handle) {
3719
+ return uniffiRustCaller.rustCall(
3720
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_clone_adminbuilder(handle, status),
3721
+ uniffiRustCallOptions(),
3722
+ );
3723
+ },
3724
+ freeHandleGeneric(handle) {
3725
+ uniffiRustCaller.rustCall(
3726
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_free_adminbuilder_generic_abi(handle, status),
3727
+ uniffiRustCallOptions(),
3728
+ );
3729
+ },
3730
+ freeHandleRawExternal(handle) {
3731
+ const rawExternalFreeHandle = uniffiGetCachedLibraryFunction(
3732
+ "uniffi_slatedb_uniffi_fn_free_adminbuilder:raw-external",
3733
+ (bindings) => bindings.library.func(
3734
+ "uniffi_slatedb_uniffi_fn_free_adminbuilder",
3735
+ "void",
3736
+ [bindings.ffiTypes.VoidPointer, koffi.pointer(bindings.ffiTypes.RustCallStatus)],
3737
+ ),
3738
+ );
3739
+ uniffiRustCaller.rustCall(
3740
+ (status) => rawExternalFreeHandle(handle, status),
3741
+ uniffiRustCallOptions(),
3742
+ );
3743
+ },
3744
+ freeHandle(handle) {
3745
+ uniffiRustCaller.rustCall(
3746
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_free_adminbuilder(handle, status),
3747
+ uniffiRustCallOptions(),
3748
+ );
2601
3749
  },
2602
3750
  });
2603
-
2604
- /**
2605
- * Installs SlateDB logging exactly once for the current process.
2606
- *
2607
- * If `callback` is provided, log records are forwarded to it. Otherwise logs
2608
- * are written to standard error using the default tracing formatter.
2609
- */
2610
- export function init_logging(level, callback) {
2611
- const loweredLevel = uniffiLowerIntoRustBuffer(FfiConverterLogLevel, level);
2612
- const loweredCallback = uniffiLowerIntoRustBuffer(uniffiOptionalConverter(FfiConverterLogCallback), callback);
2613
- uniffiRustCaller.rustCall(
2614
- (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_func_init_logging(loweredLevel, loweredCallback, status),
2615
- uniffiRustCallOptions(FfiConverterError),
2616
- );
2617
- }
3751
+ const FfiConverterAdminBuilder = createObjectConverter(uniffiAdminBuilderObjectFactory);
2618
3752
 
2619
3753
  /**
2620
3754
  * Builder for opening a writable [`crate::Db`].
@@ -2665,6 +3799,22 @@ export class DbBuilder extends UniffiObjectBase {
2665
3799
  });
2666
3800
  }
2667
3801
 
3802
+ /**
3803
+ * Sets DB cache.
3804
+ */
3805
+ with_db_cache(db_cache) {
3806
+ const loweredSelf = uniffiDbBuilderObjectFactory.cloneHandle(this);
3807
+ const ffiMethod =
3808
+ uniffiDbBuilderObjectFactory.usesGenericAbi(this)
3809
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbbuilder_with_db_cache_generic_abi
3810
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbbuilder_with_db_cache;
3811
+ const loweredDbCache = uniffiDbCacheObjectFactory.cloneHandle(db_cache);
3812
+ uniffiRustCaller.rustCall(
3813
+ (status) => ffiMethod(loweredSelf, loweredDbCache, status),
3814
+ uniffiRustCallOptions(FfiConverterError),
3815
+ );
3816
+ }
3817
+
2668
3818
  /**
2669
3819
  * Disables the SST block and metadata cache.
2670
3820
  */
@@ -3109,6 +4259,30 @@ export class Db extends UniffiObjectBase {
3109
4259
  });
3110
4260
  }
3111
4261
 
4262
+ /**
4263
+ * Best-effort eviction of block-cache entries for one SST.
4264
+ *
4265
+ * If no block cache is configured, returns `Ok(())`.
4266
+ */
4267
+ async evict_cached_sst(sst_id) {
4268
+ const loweredSelf = uniffiDbObjectFactory.cloneHandle(this);
4269
+ const ffiMethod =
4270
+ uniffiDbObjectFactory.usesGenericAbi(this)
4271
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_db_evict_cached_sst_generic_abi
4272
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_db_evict_cached_sst;
4273
+ const loweredSstId = uniffiLowerIntoRustBuffer(FfiConverterSsTableId, sst_id);
4274
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_void(rustFuture, status);
4275
+ return rustCallAsync({
4276
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredSstId),
4277
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_void(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
4278
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_void(rustFuture),
4279
+ completeFunc,
4280
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_void(rustFuture),
4281
+ liftFunc: (_uniffiResult) => undefined,
4282
+ ...uniffiRustCallOptions(FfiConverterError),
4283
+ });
4284
+ }
4285
+
3112
4286
  /**
3113
4287
  * Flushes the default storage layer.
3114
4288
  */
@@ -3529,6 +4703,33 @@ export class Db extends UniffiObjectBase {
3529
4703
  return uniffiLiftFromRustBuffer(FfiConverterDbStatus, uniffiResult);
3530
4704
  }
3531
4705
 
4706
+ /**
4707
+ * Warms selected cache content for one SST.
4708
+ *
4709
+ * Returns `Err` on the first failing target. If no block cache is
4710
+ * configured, or if the SST is not reachable from the current manifest,
4711
+ * the call is a no-op that returns `Ok(())`.
4712
+ */
4713
+ async warm_sst(sst_id, targets) {
4714
+ const loweredSelf = uniffiDbObjectFactory.cloneHandle(this);
4715
+ const ffiMethod =
4716
+ uniffiDbObjectFactory.usesGenericAbi(this)
4717
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_db_warm_sst_generic_abi
4718
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_db_warm_sst;
4719
+ const loweredSstId = uniffiLowerIntoRustBuffer(FfiConverterSsTableId, sst_id);
4720
+ const loweredTargets = uniffiLowerIntoRustBuffer(uniffiArrayConverter(FfiConverterCacheTarget), targets);
4721
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_void(rustFuture, status);
4722
+ return rustCallAsync({
4723
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredSstId, loweredTargets),
4724
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_void(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
4725
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_void(rustFuture),
4726
+ completeFunc,
4727
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_void(rustFuture),
4728
+ liftFunc: (_uniffiResult) => undefined,
4729
+ ...uniffiRustCallOptions(FfiConverterError),
4730
+ });
4731
+ }
4732
+
3532
4733
  /**
3533
4734
  * Applies all operations in `batch` atomically.
3534
4735
  *
@@ -3638,6 +4839,112 @@ const uniffiDbObjectFactory = createObjectFactory({
3638
4839
  });
3639
4840
  const FfiConverterDb = createObjectConverter(uniffiDbObjectFactory);
3640
4841
 
4842
+ /**
4843
+ * Database cache used to store blocks in memory.
4844
+ */
4845
+ export class DbCache extends UniffiObjectBase {
4846
+ constructor() {
4847
+ super();
4848
+ return uniffiNotImplemented("DbCache.constructor");
4849
+ }
4850
+
4851
+ /**
4852
+ * Creates a new Foyer based DB cache.
4853
+ */
4854
+ static new_foyer_cache(options) {
4855
+ const loweredOptions = uniffiLowerIntoRustBuffer(FfiConverterFoyerCacheOptions, options);
4856
+ const pointer = uniffiRustCaller.rustCall(
4857
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_constructor_dbcache_new_foyer_cache(loweredOptions, status),
4858
+ uniffiRustCallOptions(FfiConverterError),
4859
+ );
4860
+ return uniffiDbCacheObjectFactory.create(pointer);
4861
+ }
4862
+
4863
+ /**
4864
+ * Creates a new Moka based DB cache.
4865
+ */
4866
+ static new_moka_cache(options) {
4867
+ const loweredOptions = uniffiLowerIntoRustBuffer(FfiConverterMokaCacheOptions, options);
4868
+ const pointer = uniffiRustCaller.rustCall(
4869
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_constructor_dbcache_new_moka_cache(loweredOptions, status),
4870
+ uniffiRustCallOptions(FfiConverterError),
4871
+ );
4872
+ return uniffiDbCacheObjectFactory.create(pointer);
4873
+ }
4874
+
4875
+ /**
4876
+ * Creates a new split cache with separate block and metadata capacities.
4877
+ */
4878
+ static new_split_cache(block_cache, meta_cache) {
4879
+ const loweredBlockCache = uniffiDbCacheObjectFactory.cloneHandle(block_cache);
4880
+ const loweredMetaCache = uniffiDbCacheObjectFactory.cloneHandle(meta_cache);
4881
+ const pointer = uniffiRustCaller.rustCall(
4882
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_constructor_dbcache_new_split_cache(loweredBlockCache, loweredMetaCache, status),
4883
+ uniffiRustCallOptions(FfiConverterError),
4884
+ );
4885
+ return uniffiDbCacheObjectFactory.create(pointer);
4886
+ }
4887
+ }
4888
+
4889
+ const uniffiDbCacheObjectFactory = createObjectFactory({
4890
+ typeName: "DbCache",
4891
+ createInstance: () => Object.create(DbCache.prototype),
4892
+ cloneFreeUsesUniffiHandle: true,
4893
+ cloneHandleGeneric(handle) {
4894
+ return uniffiRustCaller.rustCall(
4895
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_clone_dbcache_generic_abi(handle, status),
4896
+ uniffiRustCallOptions(),
4897
+ );
4898
+ },
4899
+ cloneHandleRawExternal(handle) {
4900
+ const rawExternalCloneHandle = uniffiGetCachedLibraryFunction(
4901
+ "uniffi_slatedb_uniffi_fn_clone_dbcache:raw-external",
4902
+ (bindings) => bindings.library.func(
4903
+ "uniffi_slatedb_uniffi_fn_clone_dbcache",
4904
+ bindings.ffiTypes.VoidPointer,
4905
+ [bindings.ffiTypes.VoidPointer, koffi.pointer(bindings.ffiTypes.RustCallStatus)],
4906
+ ),
4907
+ );
4908
+ return uniffiRustCaller.rustCall(
4909
+ (status) => rawExternalCloneHandle(handle, status),
4910
+ uniffiRustCallOptions(),
4911
+ );
4912
+ },
4913
+ cloneHandle(handle) {
4914
+ return uniffiRustCaller.rustCall(
4915
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_clone_dbcache(handle, status),
4916
+ uniffiRustCallOptions(),
4917
+ );
4918
+ },
4919
+ freeHandleGeneric(handle) {
4920
+ uniffiRustCaller.rustCall(
4921
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_free_dbcache_generic_abi(handle, status),
4922
+ uniffiRustCallOptions(),
4923
+ );
4924
+ },
4925
+ freeHandleRawExternal(handle) {
4926
+ const rawExternalFreeHandle = uniffiGetCachedLibraryFunction(
4927
+ "uniffi_slatedb_uniffi_fn_free_dbcache:raw-external",
4928
+ (bindings) => bindings.library.func(
4929
+ "uniffi_slatedb_uniffi_fn_free_dbcache",
4930
+ "void",
4931
+ [bindings.ffiTypes.VoidPointer, koffi.pointer(bindings.ffiTypes.RustCallStatus)],
4932
+ ),
4933
+ );
4934
+ uniffiRustCaller.rustCall(
4935
+ (status) => rawExternalFreeHandle(handle, status),
4936
+ uniffiRustCallOptions(),
4937
+ );
4938
+ },
4939
+ freeHandle(handle) {
4940
+ uniffiRustCaller.rustCall(
4941
+ (status) => ffiFunctions.uniffi_slatedb_uniffi_fn_free_dbcache(handle, status),
4942
+ uniffiRustCallOptions(),
4943
+ );
4944
+ },
4945
+ });
4946
+ const FfiConverterDbCache = createObjectConverter(uniffiDbCacheObjectFactory);
4947
+
3641
4948
  /**
3642
4949
  * Read-only database handle opened by [`crate::DbReaderBuilder`].
3643
4950
  */
@@ -3647,6 +4954,30 @@ export class DbReader extends UniffiObjectBase {
3647
4954
  return uniffiNotImplemented("DbReader.constructor");
3648
4955
  }
3649
4956
 
4957
+ /**
4958
+ * Best-effort eviction of block-cache entries for one SST.
4959
+ *
4960
+ * If no block cache is configured, returns `Ok(())`.
4961
+ */
4962
+ async evict_cached_sst(sst_id) {
4963
+ const loweredSelf = uniffiDbReaderObjectFactory.cloneHandle(this);
4964
+ const ffiMethod =
4965
+ uniffiDbReaderObjectFactory.usesGenericAbi(this)
4966
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbreader_evict_cached_sst_generic_abi
4967
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbreader_evict_cached_sst;
4968
+ const loweredSstId = uniffiLowerIntoRustBuffer(FfiConverterSsTableId, sst_id);
4969
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_void(rustFuture, status);
4970
+ return rustCallAsync({
4971
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredSstId),
4972
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_void(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
4973
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_void(rustFuture),
4974
+ completeFunc,
4975
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_void(rustFuture),
4976
+ liftFunc: (_uniffiResult) => undefined,
4977
+ ...uniffiRustCallOptions(FfiConverterError),
4978
+ });
4979
+ }
4980
+
3650
4981
  /**
3651
4982
  * Reads the current value for `key`.
3652
4983
  */
@@ -3669,6 +5000,51 @@ export class DbReader extends UniffiObjectBase {
3669
5000
  });
3670
5001
  }
3671
5002
 
5003
+ /**
5004
+ * Reads the current row version for `key`, including metadata.
5005
+ */
5006
+ async get_key_value(key) {
5007
+ const loweredSelf = uniffiDbReaderObjectFactory.cloneHandle(this);
5008
+ const ffiMethod =
5009
+ uniffiDbReaderObjectFactory.usesGenericAbi(this)
5010
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbreader_get_key_value_generic_abi
5011
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbreader_get_key_value;
5012
+ const loweredKey = uniffiLowerIntoRustBuffer(FfiConverterBytes, key);
5013
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
5014
+ return rustCallAsync({
5015
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredKey),
5016
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
5017
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
5018
+ completeFunc,
5019
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
5020
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiOptionalConverter(FfiConverterKeyValue), uniffiResult),
5021
+ ...uniffiRustCallOptions(FfiConverterError),
5022
+ });
5023
+ }
5024
+
5025
+ /**
5026
+ * Reads the current row version for `key` using custom read options.
5027
+ */
5028
+ async get_key_value_with_options(key, options) {
5029
+ const loweredSelf = uniffiDbReaderObjectFactory.cloneHandle(this);
5030
+ const ffiMethod =
5031
+ uniffiDbReaderObjectFactory.usesGenericAbi(this)
5032
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbreader_get_key_value_with_options_generic_abi
5033
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbreader_get_key_value_with_options;
5034
+ const loweredKey = uniffiLowerIntoRustBuffer(FfiConverterBytes, key);
5035
+ const loweredOptions = uniffiLowerIntoRustBuffer(FfiConverterReadOptions, options);
5036
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_rust_buffer(rustFuture, status);
5037
+ return rustCallAsync({
5038
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredKey, loweredOptions),
5039
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_rust_buffer(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
5040
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_rust_buffer(rustFuture),
5041
+ completeFunc,
5042
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_rust_buffer(rustFuture),
5043
+ liftFunc: (uniffiResult) => uniffiLiftFromRustBuffer(uniffiOptionalConverter(FfiConverterKeyValue), uniffiResult),
5044
+ ...uniffiRustCallOptions(FfiConverterError),
5045
+ });
5046
+ }
5047
+
3672
5048
  /**
3673
5049
  * Reads the current value for `key` using custom read options.
3674
5050
  */
@@ -3850,6 +5226,33 @@ export class DbReader extends UniffiObjectBase {
3850
5226
  );
3851
5227
  return uniffiLiftFromRustBuffer(FfiConverterDbStatus, uniffiResult);
3852
5228
  }
5229
+
5230
+ /**
5231
+ * Warms selected cache content for one SST.
5232
+ *
5233
+ * Returns `Err` on the first failing target. If no block cache is
5234
+ * configured, or if the SST is not reachable from the current manifest,
5235
+ * the call is a no-op that returns `Ok(())`.
5236
+ */
5237
+ async warm_sst(sst_id, targets) {
5238
+ const loweredSelf = uniffiDbReaderObjectFactory.cloneHandle(this);
5239
+ const ffiMethod =
5240
+ uniffiDbReaderObjectFactory.usesGenericAbi(this)
5241
+ ? ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbreader_warm_sst_generic_abi
5242
+ : ffiFunctions.uniffi_slatedb_uniffi_fn_method_dbreader_warm_sst;
5243
+ const loweredSstId = uniffiLowerIntoRustBuffer(FfiConverterSsTableId, sst_id);
5244
+ const loweredTargets = uniffiLowerIntoRustBuffer(uniffiArrayConverter(FfiConverterCacheTarget), targets);
5245
+ const completeFunc = (rustFuture, status) => ffiFunctions.ffi_slatedb_uniffi_rust_future_complete_void(rustFuture, status);
5246
+ return rustCallAsync({
5247
+ rustFutureFunc: () => ffiMethod(loweredSelf, loweredSstId, loweredTargets),
5248
+ pollFunc: (rustFuture, _continuationCallback, continuationHandle) => ffiFunctions.ffi_slatedb_uniffi_rust_future_poll_void(rustFuture, uniffiGetRustFutureContinuationPointer(), continuationHandle),
5249
+ cancelFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_cancel_void(rustFuture),
5250
+ completeFunc,
5251
+ freeFunc: (rustFuture) => ffiFunctions.ffi_slatedb_uniffi_rust_future_free_void(rustFuture),
5252
+ liftFunc: (_uniffiResult) => undefined,
5253
+ ...uniffiRustCallOptions(FfiConverterError),
5254
+ });
5255
+ }
3853
5256
  }
3854
5257
 
3855
5258
  const uniffiDbReaderObjectFactory = createObjectFactory({