@slatedb/uniffi 0.12.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/README.md +211 -0
- package/index.d.ts +1 -0
- package/index.js +7 -0
- package/package.json +47 -0
- package/prebuilds/darwin-arm64/libslatedb_uniffi.dylib +0 -0
- package/prebuilds/darwin-x64/libslatedb_uniffi.dylib +0 -0
- package/prebuilds/linux-arm64-gnu/libslatedb_uniffi.so +0 -0
- package/prebuilds/linux-x64-gnu/libslatedb_uniffi.so +0 -0
- package/prebuilds/win32-arm64/slatedb_uniffi.dll +0 -0
- package/prebuilds/win32-x64/slatedb_uniffi.dll +0 -0
- package/runtime/async-rust-call.d.ts +86 -0
- package/runtime/async-rust-call.js +217 -0
- package/runtime/callbacks.d.ts +122 -0
- package/runtime/callbacks.js +392 -0
- package/runtime/errors.d.ts +120 -0
- package/runtime/errors.js +274 -0
- package/runtime/ffi-converters.d.ts +100 -0
- package/runtime/ffi-converters.js +758 -0
- package/runtime/ffi-types.d.ts +120 -0
- package/runtime/ffi-types.js +456 -0
- package/runtime/handle-map.d.ts +35 -0
- package/runtime/handle-map.js +137 -0
- package/runtime/objects.d.ts +68 -0
- package/runtime/objects.js +469 -0
- package/runtime/rust-call.d.ts +77 -0
- package/runtime/rust-call.js +233 -0
- package/slatedb-ffi.d.ts +732 -0
- package/slatedb-ffi.js +11480 -0
- package/slatedb.d.ts +1393 -0
- package/slatedb.js +5873 -0
package/slatedb.d.ts
ADDED
|
@@ -0,0 +1,1393 @@
|
|
|
1
|
+
import { UniffiObjectBase } from "./runtime/objects.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface ComponentMetadata {
|
|
6
|
+
namespace: string;
|
|
7
|
+
packageName: string;
|
|
8
|
+
cdylibName: string;
|
|
9
|
+
nodeEngine: string;
|
|
10
|
+
bundledPrebuilds: boolean;
|
|
11
|
+
manualLoad: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare const componentMetadata: Readonly<ComponentMetadata>;
|
|
15
|
+
|
|
16
|
+
export { ffiMetadata } from "./slatedb-ffi.js";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Options for an explicit flush request.
|
|
21
|
+
*/
|
|
22
|
+
export interface FlushOptions {
|
|
23
|
+
/**
|
|
24
|
+
* Which storage layer should be flushed.
|
|
25
|
+
*/
|
|
26
|
+
"flush_type": FlushType;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Options applied to a merge operation.
|
|
31
|
+
*/
|
|
32
|
+
export interface MergeOptions {
|
|
33
|
+
/**
|
|
34
|
+
* TTL policy for the inserted merge operand.
|
|
35
|
+
*/
|
|
36
|
+
"ttl": Ttl;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Options applied to a put operation.
|
|
41
|
+
*/
|
|
42
|
+
export interface PutOptions {
|
|
43
|
+
/**
|
|
44
|
+
* TTL policy for the inserted value.
|
|
45
|
+
*/
|
|
46
|
+
"ttl": Ttl;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Options that control a point read.
|
|
51
|
+
*/
|
|
52
|
+
export interface ReadOptions {
|
|
53
|
+
/**
|
|
54
|
+
* Minimum durability level a returned row must satisfy.
|
|
55
|
+
*/
|
|
56
|
+
"durability_filter": DurabilityLevel;
|
|
57
|
+
/**
|
|
58
|
+
* Whether uncommitted dirty data may be returned.
|
|
59
|
+
*/
|
|
60
|
+
"dirty": boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether fetched blocks should be inserted into the block cache.
|
|
63
|
+
*/
|
|
64
|
+
"cache_blocks": boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Options for opening a [`crate::DbReader`].
|
|
69
|
+
*/
|
|
70
|
+
export interface ReaderOptions {
|
|
71
|
+
/**
|
|
72
|
+
* How often the reader polls for new manifests and WAL data, in milliseconds.
|
|
73
|
+
*/
|
|
74
|
+
"manifest_poll_interval_ms": bigint | number;
|
|
75
|
+
/**
|
|
76
|
+
* Lifetime of an internally managed checkpoint, in milliseconds.
|
|
77
|
+
*/
|
|
78
|
+
"checkpoint_lifetime_ms": bigint | number;
|
|
79
|
+
/**
|
|
80
|
+
* Maximum size of one in-memory table used while replaying WAL data.
|
|
81
|
+
*/
|
|
82
|
+
"max_memtable_bytes": bigint | number;
|
|
83
|
+
/**
|
|
84
|
+
* Whether WAL replay should be skipped entirely.
|
|
85
|
+
*/
|
|
86
|
+
"skip_wal_replay": boolean;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Options that control range scans and prefix scans.
|
|
91
|
+
*/
|
|
92
|
+
export interface ScanOptions {
|
|
93
|
+
/**
|
|
94
|
+
* Minimum durability level a returned row must satisfy.
|
|
95
|
+
*/
|
|
96
|
+
"durability_filter": DurabilityLevel;
|
|
97
|
+
/**
|
|
98
|
+
* Whether uncommitted dirty data may be returned.
|
|
99
|
+
*/
|
|
100
|
+
"dirty": boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Number of bytes to read ahead while scanning.
|
|
103
|
+
*/
|
|
104
|
+
"read_ahead_bytes": bigint | number;
|
|
105
|
+
/**
|
|
106
|
+
* Whether fetched blocks should be inserted into the block cache.
|
|
107
|
+
*/
|
|
108
|
+
"cache_blocks": boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Maximum number of concurrent fetch tasks used by the scan.
|
|
111
|
+
*/
|
|
112
|
+
"max_fetch_tasks": bigint | number;
|
|
113
|
+
/**
|
|
114
|
+
* The iteration order for the scan. Defaults to ascending when not set.
|
|
115
|
+
*/
|
|
116
|
+
"order": IterationOrder | undefined;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Options that control durability behavior for writes and commits.
|
|
121
|
+
*/
|
|
122
|
+
export interface WriteOptions {
|
|
123
|
+
/**
|
|
124
|
+
* Whether the call waits for the write to become durable before returning.
|
|
125
|
+
*/
|
|
126
|
+
"await_durable": boolean;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* A single log event forwarded to a foreign callback.
|
|
131
|
+
*/
|
|
132
|
+
export interface LogRecord {
|
|
133
|
+
/**
|
|
134
|
+
* Event severity.
|
|
135
|
+
*/
|
|
136
|
+
"level": LogLevel;
|
|
137
|
+
/**
|
|
138
|
+
* Logging target or explicit `log.target` field.
|
|
139
|
+
*/
|
|
140
|
+
"target": string;
|
|
141
|
+
/**
|
|
142
|
+
* Rendered log message.
|
|
143
|
+
*/
|
|
144
|
+
"message": string;
|
|
145
|
+
/**
|
|
146
|
+
* Rust module path, when available.
|
|
147
|
+
*/
|
|
148
|
+
"module_path": string | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Source file path, when available.
|
|
151
|
+
*/
|
|
152
|
+
"file": string | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* Source line number, when available.
|
|
155
|
+
*/
|
|
156
|
+
"line": number | undefined;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Histogram payload captured in a metric snapshot.
|
|
161
|
+
*/
|
|
162
|
+
export interface HistogramMetricValue {
|
|
163
|
+
/**
|
|
164
|
+
* Total number of recorded observations.
|
|
165
|
+
*/
|
|
166
|
+
"count": bigint | number;
|
|
167
|
+
/**
|
|
168
|
+
* Sum of all observed values.
|
|
169
|
+
*/
|
|
170
|
+
"sum": number;
|
|
171
|
+
/**
|
|
172
|
+
* Minimum observed value.
|
|
173
|
+
*/
|
|
174
|
+
"min": number;
|
|
175
|
+
/**
|
|
176
|
+
* Maximum observed value.
|
|
177
|
+
*/
|
|
178
|
+
"max": number;
|
|
179
|
+
/**
|
|
180
|
+
* Histogram bucket boundaries.
|
|
181
|
+
*/
|
|
182
|
+
"boundaries": Array<number>;
|
|
183
|
+
/**
|
|
184
|
+
* Number of observations in each bucket.
|
|
185
|
+
*/
|
|
186
|
+
"bucket_counts": Array<bigint | number>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* One metric from a [`DefaultMetricsRecorder`] snapshot.
|
|
191
|
+
*/
|
|
192
|
+
export interface Metric {
|
|
193
|
+
/**
|
|
194
|
+
* Dotted metric name.
|
|
195
|
+
*/
|
|
196
|
+
"name": string;
|
|
197
|
+
/**
|
|
198
|
+
* Canonical label set for the metric instance.
|
|
199
|
+
*/
|
|
200
|
+
"labels": Array<MetricLabel>;
|
|
201
|
+
/**
|
|
202
|
+
* Human-readable description.
|
|
203
|
+
*/
|
|
204
|
+
"description": string;
|
|
205
|
+
/**
|
|
206
|
+
* Current metric value.
|
|
207
|
+
*/
|
|
208
|
+
"value": MetricValue;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Key-value label attached to a metric.
|
|
213
|
+
*/
|
|
214
|
+
export interface MetricLabel {
|
|
215
|
+
/**
|
|
216
|
+
* Label key.
|
|
217
|
+
*/
|
|
218
|
+
"key": string;
|
|
219
|
+
/**
|
|
220
|
+
* Label value.
|
|
221
|
+
*/
|
|
222
|
+
"value": string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Snapshot of the current database lifecycle and durability state.
|
|
227
|
+
*/
|
|
228
|
+
export interface DbStatus {
|
|
229
|
+
/**
|
|
230
|
+
* Highest durable sequence number observed by this handle.
|
|
231
|
+
*/
|
|
232
|
+
"durable_seq": bigint | number;
|
|
233
|
+
/**
|
|
234
|
+
* Present once the handle has been closed.
|
|
235
|
+
*/
|
|
236
|
+
"close_reason": CloseReason | undefined;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* A half-open or closed byte-key range used by scan APIs.
|
|
241
|
+
*/
|
|
242
|
+
export interface KeyRange {
|
|
243
|
+
/**
|
|
244
|
+
* Inclusive or exclusive lower bound. `None` means unbounded.
|
|
245
|
+
*/
|
|
246
|
+
"start": Uint8Array | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* Whether `start` is inclusive when present.
|
|
249
|
+
*/
|
|
250
|
+
"start_inclusive": boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Inclusive or exclusive upper bound. `None` means unbounded.
|
|
253
|
+
*/
|
|
254
|
+
"end": Uint8Array | undefined;
|
|
255
|
+
/**
|
|
256
|
+
* Whether `end` is inclusive when present.
|
|
257
|
+
*/
|
|
258
|
+
"end_inclusive": boolean;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* A key/value pair together with the row version metadata that produced it.
|
|
263
|
+
*/
|
|
264
|
+
export interface KeyValue {
|
|
265
|
+
/**
|
|
266
|
+
* Row key.
|
|
267
|
+
*/
|
|
268
|
+
"key": Uint8Array;
|
|
269
|
+
/**
|
|
270
|
+
* Row value bytes.
|
|
271
|
+
*/
|
|
272
|
+
"value": Uint8Array;
|
|
273
|
+
/**
|
|
274
|
+
* Sequence number of the row version.
|
|
275
|
+
*/
|
|
276
|
+
"seq": bigint | number;
|
|
277
|
+
/**
|
|
278
|
+
* Creation timestamp of the row version.
|
|
279
|
+
*/
|
|
280
|
+
"create_ts": bigint | number;
|
|
281
|
+
/**
|
|
282
|
+
* Expiration timestamp, if the row has a TTL.
|
|
283
|
+
*/
|
|
284
|
+
"expire_ts": bigint | number | undefined;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* A raw row entry returned from WAL inspection.
|
|
289
|
+
*/
|
|
290
|
+
export interface RowEntry {
|
|
291
|
+
/**
|
|
292
|
+
* Encoded row kind.
|
|
293
|
+
*/
|
|
294
|
+
"kind": RowEntryKind;
|
|
295
|
+
/**
|
|
296
|
+
* Row key.
|
|
297
|
+
*/
|
|
298
|
+
"key": Uint8Array;
|
|
299
|
+
/**
|
|
300
|
+
* Row value for value and merge entries. `None` for tombstones.
|
|
301
|
+
*/
|
|
302
|
+
"value": Uint8Array | undefined;
|
|
303
|
+
/**
|
|
304
|
+
* Sequence number of the entry.
|
|
305
|
+
*/
|
|
306
|
+
"seq": bigint | number;
|
|
307
|
+
/**
|
|
308
|
+
* Creation timestamp if present in the WAL entry.
|
|
309
|
+
*/
|
|
310
|
+
"create_ts": bigint | number | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* Expiration timestamp if present in the WAL entry.
|
|
313
|
+
*/
|
|
314
|
+
"expire_ts": bigint | number | undefined;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Metadata returned by a successful write.
|
|
319
|
+
*/
|
|
320
|
+
export interface WriteHandle {
|
|
321
|
+
/**
|
|
322
|
+
* Sequence number assigned to the write.
|
|
323
|
+
*/
|
|
324
|
+
"seqnum": bigint | number;
|
|
325
|
+
/**
|
|
326
|
+
* Creation timestamp assigned to the write.
|
|
327
|
+
*/
|
|
328
|
+
"create_ts": bigint | number;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Metadata describing a WAL file in object storage.
|
|
333
|
+
*/
|
|
334
|
+
export interface WalFileMetadata {
|
|
335
|
+
/**
|
|
336
|
+
* Last-modified timestamp seconds component.
|
|
337
|
+
*/
|
|
338
|
+
"last_modified_seconds": bigint | number;
|
|
339
|
+
/**
|
|
340
|
+
* Last-modified timestamp nanoseconds component.
|
|
341
|
+
*/
|
|
342
|
+
"last_modified_nanos": number;
|
|
343
|
+
/**
|
|
344
|
+
* File size in bytes.
|
|
345
|
+
*/
|
|
346
|
+
"size_bytes": bigint | number;
|
|
347
|
+
/**
|
|
348
|
+
* Object-store location of the file.
|
|
349
|
+
*/
|
|
350
|
+
"location": string;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Minimum durability level required for data returned by reads and scans.
|
|
355
|
+
*/
|
|
356
|
+
export declare const DurabilityLevel: Readonly<{
|
|
357
|
+
/**
|
|
358
|
+
* Return only data that has been flushed to remote object storage.
|
|
359
|
+
*/
|
|
360
|
+
"Remote": "Remote";
|
|
361
|
+
/**
|
|
362
|
+
* Return both remote data and newer in-memory data.
|
|
363
|
+
*/
|
|
364
|
+
"Memory": "Memory";
|
|
365
|
+
}>;
|
|
366
|
+
/**
|
|
367
|
+
* Minimum durability level required for data returned by reads and scans.
|
|
368
|
+
*/
|
|
369
|
+
export type DurabilityLevel = (typeof DurabilityLevel)[keyof typeof DurabilityLevel];
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Storage layer targeted by an explicit flush.
|
|
373
|
+
*/
|
|
374
|
+
export declare const FlushType: Readonly<{
|
|
375
|
+
/**
|
|
376
|
+
* Flush the active memtable and any immutable memtables to object storage.
|
|
377
|
+
*/
|
|
378
|
+
"MemTable": "MemTable";
|
|
379
|
+
/**
|
|
380
|
+
* Flush the active WAL and any immutable WAL segments to object storage.
|
|
381
|
+
*/
|
|
382
|
+
"Wal": "Wal";
|
|
383
|
+
}>;
|
|
384
|
+
/**
|
|
385
|
+
* Storage layer targeted by an explicit flush.
|
|
386
|
+
*/
|
|
387
|
+
export type FlushType = (typeof FlushType)[keyof typeof FlushType];
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Isolation level used when starting a transaction.
|
|
391
|
+
*/
|
|
392
|
+
export declare const IsolationLevel: Readonly<{
|
|
393
|
+
/**
|
|
394
|
+
* Reads see a stable snapshot without full serializable conflict checking.
|
|
395
|
+
*/
|
|
396
|
+
"Snapshot": "Snapshot";
|
|
397
|
+
/**
|
|
398
|
+
* Reads see a stable snapshot with serializable conflict detection.
|
|
399
|
+
*/
|
|
400
|
+
"SerializableSnapshot": "SerializableSnapshot";
|
|
401
|
+
}>;
|
|
402
|
+
/**
|
|
403
|
+
* Isolation level used when starting a transaction.
|
|
404
|
+
*/
|
|
405
|
+
export type IsolationLevel = (typeof IsolationLevel)[keyof typeof IsolationLevel];
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* The iteration order for a scan.
|
|
409
|
+
*/
|
|
410
|
+
export declare const IterationOrder: Readonly<{
|
|
411
|
+
"Ascending": "Ascending";
|
|
412
|
+
"Descending": "Descending";
|
|
413
|
+
}>;
|
|
414
|
+
/**
|
|
415
|
+
* The iteration order for a scan.
|
|
416
|
+
*/
|
|
417
|
+
export type IterationOrder = (typeof IterationOrder)[keyof typeof IterationOrder];
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Block size used for newly written SSTable blocks.
|
|
421
|
+
*/
|
|
422
|
+
export declare const SstBlockSize: Readonly<{
|
|
423
|
+
/**
|
|
424
|
+
* 1 KiB blocks.
|
|
425
|
+
*/
|
|
426
|
+
"Block1Kib": "Block1Kib";
|
|
427
|
+
/**
|
|
428
|
+
* 2 KiB blocks.
|
|
429
|
+
*/
|
|
430
|
+
"Block2Kib": "Block2Kib";
|
|
431
|
+
/**
|
|
432
|
+
* 4 KiB blocks.
|
|
433
|
+
*/
|
|
434
|
+
"Block4Kib": "Block4Kib";
|
|
435
|
+
/**
|
|
436
|
+
* 8 KiB blocks.
|
|
437
|
+
*/
|
|
438
|
+
"Block8Kib": "Block8Kib";
|
|
439
|
+
/**
|
|
440
|
+
* 16 KiB blocks.
|
|
441
|
+
*/
|
|
442
|
+
"Block16Kib": "Block16Kib";
|
|
443
|
+
/**
|
|
444
|
+
* 32 KiB blocks.
|
|
445
|
+
*/
|
|
446
|
+
"Block32Kib": "Block32Kib";
|
|
447
|
+
/**
|
|
448
|
+
* 64 KiB blocks.
|
|
449
|
+
*/
|
|
450
|
+
"Block64Kib": "Block64Kib";
|
|
451
|
+
}>;
|
|
452
|
+
/**
|
|
453
|
+
* Block size used for newly written SSTable blocks.
|
|
454
|
+
*/
|
|
455
|
+
export type SstBlockSize = (typeof SstBlockSize)[keyof typeof SstBlockSize];
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Reason a database or reader reports itself as closed.
|
|
459
|
+
*/
|
|
460
|
+
export declare const CloseReason: Readonly<{
|
|
461
|
+
/**
|
|
462
|
+
* Closed cleanly by the caller.
|
|
463
|
+
*/
|
|
464
|
+
"Clean": "Clean";
|
|
465
|
+
/**
|
|
466
|
+
* Closed because another writer fenced this instance.
|
|
467
|
+
*/
|
|
468
|
+
"Fenced": "Fenced";
|
|
469
|
+
/**
|
|
470
|
+
* Closed because of a panic in a background task.
|
|
471
|
+
*/
|
|
472
|
+
"Panic": "Panic";
|
|
473
|
+
/**
|
|
474
|
+
* Closed for a reason not modeled explicitly by this binding.
|
|
475
|
+
*/
|
|
476
|
+
"Unknown": "Unknown";
|
|
477
|
+
}>;
|
|
478
|
+
/**
|
|
479
|
+
* Reason a database or reader reports itself as closed.
|
|
480
|
+
*/
|
|
481
|
+
export type CloseReason = (typeof CloseReason)[keyof typeof CloseReason];
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Log level used by [`init_logging`].
|
|
485
|
+
*/
|
|
486
|
+
export declare const LogLevel: Readonly<{
|
|
487
|
+
/**
|
|
488
|
+
* Disable logging.
|
|
489
|
+
*/
|
|
490
|
+
"Off": "Off";
|
|
491
|
+
/**
|
|
492
|
+
* Error-level logs only.
|
|
493
|
+
*/
|
|
494
|
+
"Error": "Error";
|
|
495
|
+
/**
|
|
496
|
+
* Warning and error logs.
|
|
497
|
+
*/
|
|
498
|
+
"Warn": "Warn";
|
|
499
|
+
/**
|
|
500
|
+
* Info, warning, and error logs.
|
|
501
|
+
*/
|
|
502
|
+
"Info": "Info";
|
|
503
|
+
/**
|
|
504
|
+
* Debug, info, warning, and error logs.
|
|
505
|
+
*/
|
|
506
|
+
"Debug": "Debug";
|
|
507
|
+
/**
|
|
508
|
+
* Trace and all higher-severity logs.
|
|
509
|
+
*/
|
|
510
|
+
"Trace": "Trace";
|
|
511
|
+
}>;
|
|
512
|
+
/**
|
|
513
|
+
* Log level used by [`init_logging`].
|
|
514
|
+
*/
|
|
515
|
+
export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Kind of row entry stored in WAL iteration results.
|
|
519
|
+
*/
|
|
520
|
+
export declare const RowEntryKind: Readonly<{
|
|
521
|
+
/**
|
|
522
|
+
* A regular value row.
|
|
523
|
+
*/
|
|
524
|
+
"Value": "Value";
|
|
525
|
+
/**
|
|
526
|
+
* A delete tombstone.
|
|
527
|
+
*/
|
|
528
|
+
"Tombstone": "Tombstone";
|
|
529
|
+
/**
|
|
530
|
+
* A merge operand row.
|
|
531
|
+
*/
|
|
532
|
+
"Merge": "Merge";
|
|
533
|
+
}>;
|
|
534
|
+
/**
|
|
535
|
+
* Kind of row entry stored in WAL iteration results.
|
|
536
|
+
*/
|
|
537
|
+
export type RowEntryKind = (typeof RowEntryKind)[keyof typeof RowEntryKind];
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Use the database default TTL.
|
|
541
|
+
*/
|
|
542
|
+
export interface TtlDefault {
|
|
543
|
+
tag: "Default";
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Store the value without expiration.
|
|
548
|
+
*/
|
|
549
|
+
export interface TtlNoExpiry {
|
|
550
|
+
tag: "NoExpiry";
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Expire the value after the given number of clock ticks.
|
|
555
|
+
*/
|
|
556
|
+
export interface TtlExpireAfterTicks {
|
|
557
|
+
tag: "ExpireAfterTicks";
|
|
558
|
+
"": bigint | number;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Expire the value at the given absolute timestamp (clock ticks).
|
|
563
|
+
*/
|
|
564
|
+
export interface TtlExpireAt {
|
|
565
|
+
tag: "ExpireAt";
|
|
566
|
+
"": bigint | number;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Time-to-live policy applied to an inserted value or merge operand.
|
|
571
|
+
*/
|
|
572
|
+
export type Ttl = TtlDefault | TtlNoExpiry | TtlExpireAfterTicks | TtlExpireAt;
|
|
573
|
+
/**
|
|
574
|
+
* Time-to-live policy applied to an inserted value or merge operand.
|
|
575
|
+
*/
|
|
576
|
+
export declare const Ttl: Readonly<{
|
|
577
|
+
/**
|
|
578
|
+
* Use the database default TTL.
|
|
579
|
+
*/
|
|
580
|
+
Default(): TtlDefault;
|
|
581
|
+
/**
|
|
582
|
+
* Store the value without expiration.
|
|
583
|
+
*/
|
|
584
|
+
NoExpiry(): TtlNoExpiry;
|
|
585
|
+
/**
|
|
586
|
+
* Expire the value after the given number of clock ticks.
|
|
587
|
+
*/
|
|
588
|
+
ExpireAfterTicks(_: bigint | number): TtlExpireAfterTicks;
|
|
589
|
+
/**
|
|
590
|
+
* Expire the value at the given absolute timestamp (clock ticks).
|
|
591
|
+
*/
|
|
592
|
+
ExpireAt(_: bigint | number): TtlExpireAt;
|
|
593
|
+
}>;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Monotonic counter value.
|
|
597
|
+
*/
|
|
598
|
+
export interface MetricValueCounter {
|
|
599
|
+
tag: "Counter";
|
|
600
|
+
"": bigint | number;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Gauge value.
|
|
605
|
+
*/
|
|
606
|
+
export interface MetricValueGauge {
|
|
607
|
+
tag: "Gauge";
|
|
608
|
+
"": bigint | number;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Up/down counter value.
|
|
613
|
+
*/
|
|
614
|
+
export interface MetricValueUpDownCounter {
|
|
615
|
+
tag: "UpDownCounter";
|
|
616
|
+
"": bigint | number;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Histogram summary and buckets.
|
|
621
|
+
*/
|
|
622
|
+
export interface MetricValueHistogram {
|
|
623
|
+
tag: "Histogram";
|
|
624
|
+
"": HistogramMetricValue;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Value stored in a metric snapshot.
|
|
629
|
+
*/
|
|
630
|
+
export type MetricValue = MetricValueCounter | MetricValueGauge | MetricValueUpDownCounter | MetricValueHistogram;
|
|
631
|
+
/**
|
|
632
|
+
* Value stored in a metric snapshot.
|
|
633
|
+
*/
|
|
634
|
+
export declare const MetricValue: Readonly<{
|
|
635
|
+
/**
|
|
636
|
+
* Monotonic counter value.
|
|
637
|
+
*/
|
|
638
|
+
Counter(_: bigint | number): MetricValueCounter;
|
|
639
|
+
/**
|
|
640
|
+
* Gauge value.
|
|
641
|
+
*/
|
|
642
|
+
Gauge(_: bigint | number): MetricValueGauge;
|
|
643
|
+
/**
|
|
644
|
+
* Up/down counter value.
|
|
645
|
+
*/
|
|
646
|
+
UpDownCounter(_: bigint | number): MetricValueUpDownCounter;
|
|
647
|
+
/**
|
|
648
|
+
* Histogram summary and buckets.
|
|
649
|
+
*/
|
|
650
|
+
Histogram(_: HistogramMetricValue): MetricValueHistogram;
|
|
651
|
+
}>;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Error type returned by the UniFFI bindings.
|
|
655
|
+
*/
|
|
656
|
+
export declare class Error extends globalThis.Error {
|
|
657
|
+
readonly tag: string;
|
|
658
|
+
protected constructor(tag: string, message?: string);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Transaction-specific failure.
|
|
663
|
+
*/
|
|
664
|
+
export declare class ErrorTransaction extends Error {
|
|
665
|
+
readonly tag: "Transaction";
|
|
666
|
+
readonly "message": string;
|
|
667
|
+
constructor(message: string);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Operation attempted on a closed handle.
|
|
672
|
+
*/
|
|
673
|
+
export declare class ErrorClosed extends Error {
|
|
674
|
+
readonly tag: "Closed";
|
|
675
|
+
/**
|
|
676
|
+
* Reported reason the handle is closed.
|
|
677
|
+
*/
|
|
678
|
+
readonly "reason": CloseReason;
|
|
679
|
+
/**
|
|
680
|
+
* Human-readable error message.
|
|
681
|
+
*/
|
|
682
|
+
readonly "message": string;
|
|
683
|
+
constructor(reason: CloseReason, message: string);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Temporary unavailability, such as an unavailable dependency.
|
|
688
|
+
*/
|
|
689
|
+
export declare class ErrorUnavailable extends Error {
|
|
690
|
+
readonly tag: "Unavailable";
|
|
691
|
+
readonly "message": string;
|
|
692
|
+
constructor(message: string);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Invalid input or invalid API usage.
|
|
697
|
+
*/
|
|
698
|
+
export declare class ErrorInvalid extends Error {
|
|
699
|
+
readonly tag: "Invalid";
|
|
700
|
+
readonly "message": string;
|
|
701
|
+
constructor(message: string);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Corrupt, missing, or otherwise invalid data was encountered.
|
|
706
|
+
*/
|
|
707
|
+
export declare class ErrorData extends Error {
|
|
708
|
+
readonly tag: "Data";
|
|
709
|
+
readonly "message": string;
|
|
710
|
+
constructor(message: string);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Internal failure inside SlateDB or the binding layer.
|
|
715
|
+
*/
|
|
716
|
+
export declare class ErrorInternal extends Error {
|
|
717
|
+
readonly tag: "Internal";
|
|
718
|
+
readonly "message": string;
|
|
719
|
+
constructor(message: string);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Error returned by a foreign [`crate::MergeOperator`] implementation.
|
|
724
|
+
*/
|
|
725
|
+
export declare class MergeOperatorCallbackError extends globalThis.Error {
|
|
726
|
+
readonly tag: string;
|
|
727
|
+
protected constructor(tag: string, message?: string);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* The merge callback failed with an application-defined message.
|
|
732
|
+
*/
|
|
733
|
+
export declare class MergeOperatorCallbackErrorFailed extends MergeOperatorCallbackError {
|
|
734
|
+
readonly tag: "Failed";
|
|
735
|
+
readonly "message": string;
|
|
736
|
+
constructor(message: string);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Callback invoked for each emitted log record.
|
|
741
|
+
*/
|
|
742
|
+
export interface LogCallback {
|
|
743
|
+
/**
|
|
744
|
+
* Handles one log record.
|
|
745
|
+
*/
|
|
746
|
+
log(record: LogRecord): void;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Application-provided merge operator used by merge-enabled databases.
|
|
751
|
+
*/
|
|
752
|
+
export interface MergeOperator {
|
|
753
|
+
/**
|
|
754
|
+
* Combines an existing value and a new merge operand into the next value.
|
|
755
|
+
*
|
|
756
|
+
* `existing_value` is `None` when the key has no visible base value.
|
|
757
|
+
*/
|
|
758
|
+
merge(key: Uint8Array, existing_value: Uint8Array | undefined, operand: Uint8Array): Uint8Array;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Handle for a monotonic counter metric.
|
|
763
|
+
*/
|
|
764
|
+
export interface Counter {
|
|
765
|
+
/**
|
|
766
|
+
* Adds `value` to the counter.
|
|
767
|
+
*/
|
|
768
|
+
increment(value: bigint | number): void;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Handle for a gauge metric.
|
|
773
|
+
*/
|
|
774
|
+
export interface Gauge {
|
|
775
|
+
/**
|
|
776
|
+
* Sets the gauge to `value`.
|
|
777
|
+
*/
|
|
778
|
+
set(value: bigint | number): void;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Handle for a histogram metric.
|
|
783
|
+
*/
|
|
784
|
+
export interface Histogram {
|
|
785
|
+
/**
|
|
786
|
+
* Records `value` in the histogram.
|
|
787
|
+
*/
|
|
788
|
+
record(value: number): void;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Application-defined metrics recorder used to publish SlateDB metrics.
|
|
793
|
+
*/
|
|
794
|
+
export interface MetricsRecorder {
|
|
795
|
+
/**
|
|
796
|
+
* Registers a monotonically increasing counter.
|
|
797
|
+
*/
|
|
798
|
+
register_counter(name: string, description: string, labels: Array<MetricLabel>): Counter;
|
|
799
|
+
/**
|
|
800
|
+
* Registers a gauge.
|
|
801
|
+
*/
|
|
802
|
+
register_gauge(name: string, description: string, labels: Array<MetricLabel>): Gauge;
|
|
803
|
+
/**
|
|
804
|
+
* Registers an up/down counter.
|
|
805
|
+
*/
|
|
806
|
+
register_up_down_counter(name: string, description: string, labels: Array<MetricLabel>): UpDownCounter;
|
|
807
|
+
/**
|
|
808
|
+
* Registers a histogram with explicit bucket boundaries.
|
|
809
|
+
*/
|
|
810
|
+
register_histogram(name: string, description: string, labels: Array<MetricLabel>, boundaries: Array<number>): Histogram;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Handle for an up/down counter metric.
|
|
815
|
+
*/
|
|
816
|
+
export interface UpDownCounter {
|
|
817
|
+
/**
|
|
818
|
+
* Adds `value` to the counter.
|
|
819
|
+
*/
|
|
820
|
+
increment(value: bigint | number): void;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Installs SlateDB logging exactly once for the current process.
|
|
825
|
+
*
|
|
826
|
+
* If `callback` is provided, log records are forwarded to it. Otherwise logs
|
|
827
|
+
* are written to standard error using the default tracing formatter.
|
|
828
|
+
*/
|
|
829
|
+
export declare function init_logging(level: LogLevel, callback: LogCallback | undefined): void;
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Builder for opening a writable [`crate::Db`].
|
|
833
|
+
*
|
|
834
|
+
* Builders are single-use: calling [`DbBuilder::build`] consumes the builder.
|
|
835
|
+
*/
|
|
836
|
+
export declare class DbBuilder extends UniffiObjectBase {
|
|
837
|
+
/**
|
|
838
|
+
* Creates a new database builder for `path` in `object_store`.
|
|
839
|
+
*/
|
|
840
|
+
constructor(path: string, object_store: ObjectStore);
|
|
841
|
+
/**
|
|
842
|
+
* Opens the database and consumes this builder.
|
|
843
|
+
*/
|
|
844
|
+
build(): Promise<Db>;
|
|
845
|
+
/**
|
|
846
|
+
* Disables the SST block and metadata cache.
|
|
847
|
+
*/
|
|
848
|
+
with_db_cache_disabled(): void;
|
|
849
|
+
/**
|
|
850
|
+
* Installs an application-defined merge operator.
|
|
851
|
+
*/
|
|
852
|
+
with_merge_operator(merge_operator: MergeOperator): void;
|
|
853
|
+
/**
|
|
854
|
+
* Installs an application-defined metrics recorder.
|
|
855
|
+
*/
|
|
856
|
+
with_metrics_recorder(metrics_recorder: MetricsRecorder): void;
|
|
857
|
+
/**
|
|
858
|
+
* Sets the seed used for SlateDB's internal random number generation.
|
|
859
|
+
*/
|
|
860
|
+
with_seed(seed: bigint | number): void;
|
|
861
|
+
/**
|
|
862
|
+
* Applies a [`crate::Settings`] object to the builder.
|
|
863
|
+
*/
|
|
864
|
+
with_settings(settings: Settings): void;
|
|
865
|
+
/**
|
|
866
|
+
* Sets the SSTable block size used for newly written tables.
|
|
867
|
+
*/
|
|
868
|
+
with_sst_block_size(sst_block_size: SstBlockSize): void;
|
|
869
|
+
/**
|
|
870
|
+
* Uses a separate object store for WAL files.
|
|
871
|
+
*/
|
|
872
|
+
with_wal_object_store(wal_object_store: ObjectStore): void;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Builder for opening a read-only [`crate::DbReader`].
|
|
877
|
+
*
|
|
878
|
+
* Builders are single-use: calling [`DbReaderBuilder::build`] consumes the builder.
|
|
879
|
+
*/
|
|
880
|
+
export declare class DbReaderBuilder extends UniffiObjectBase {
|
|
881
|
+
/**
|
|
882
|
+
* Creates a new reader builder for `path` in `object_store`.
|
|
883
|
+
*/
|
|
884
|
+
constructor(path: string, object_store: ObjectStore);
|
|
885
|
+
/**
|
|
886
|
+
* Opens the reader and consumes this builder.
|
|
887
|
+
*/
|
|
888
|
+
build(): Promise<DbReader>;
|
|
889
|
+
/**
|
|
890
|
+
* Pins the reader to an existing checkpoint UUID string.
|
|
891
|
+
*/
|
|
892
|
+
with_checkpoint_id(checkpoint_id: string): void;
|
|
893
|
+
/**
|
|
894
|
+
* Installs an application-defined merge operator used while reading merge rows.
|
|
895
|
+
*/
|
|
896
|
+
with_merge_operator(merge_operator: MergeOperator): void;
|
|
897
|
+
/**
|
|
898
|
+
* Installs an application-defined metrics recorder.
|
|
899
|
+
*/
|
|
900
|
+
with_metrics_recorder(metrics_recorder: MetricsRecorder): void;
|
|
901
|
+
/**
|
|
902
|
+
* Applies custom reader options.
|
|
903
|
+
*/
|
|
904
|
+
with_options(options: ReaderOptions): void;
|
|
905
|
+
/**
|
|
906
|
+
* Uses a separate object store for WAL files.
|
|
907
|
+
*/
|
|
908
|
+
with_wal_object_store(wal_object_store: ObjectStore): void;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* A writable SlateDB handle.
|
|
913
|
+
*/
|
|
914
|
+
export declare class Db extends UniffiObjectBase {
|
|
915
|
+
protected constructor();
|
|
916
|
+
/**
|
|
917
|
+
* Starts a transaction at the requested isolation level.
|
|
918
|
+
*/
|
|
919
|
+
begin(isolation_level: IsolationLevel): Promise<DbTransaction>;
|
|
920
|
+
/**
|
|
921
|
+
* Deletes `key` and returns metadata for the write.
|
|
922
|
+
*/
|
|
923
|
+
delete(key: Uint8Array): Promise<WriteHandle>;
|
|
924
|
+
/**
|
|
925
|
+
* Deletes `key` using custom write options.
|
|
926
|
+
*/
|
|
927
|
+
delete_with_options(key: Uint8Array, options: WriteOptions): Promise<WriteHandle>;
|
|
928
|
+
/**
|
|
929
|
+
* Flushes the default storage layer.
|
|
930
|
+
*/
|
|
931
|
+
flush(): Promise<void>;
|
|
932
|
+
/**
|
|
933
|
+
* Flushes according to the provided flush options.
|
|
934
|
+
*/
|
|
935
|
+
flush_with_options(options: FlushOptions): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Reads the current value for `key`.
|
|
938
|
+
*/
|
|
939
|
+
get(key: Uint8Array): Promise<Uint8Array | undefined>;
|
|
940
|
+
/**
|
|
941
|
+
* Reads the current row version for `key`, including metadata.
|
|
942
|
+
*/
|
|
943
|
+
get_key_value(key: Uint8Array): Promise<KeyValue | undefined>;
|
|
944
|
+
/**
|
|
945
|
+
* Reads the current row version for `key` using custom read options.
|
|
946
|
+
*/
|
|
947
|
+
get_key_value_with_options(key: Uint8Array, options: ReadOptions): Promise<KeyValue | undefined>;
|
|
948
|
+
/**
|
|
949
|
+
* Reads the current value for `key` using custom read options.
|
|
950
|
+
*/
|
|
951
|
+
get_with_options(key: Uint8Array, options: ReadOptions): Promise<Uint8Array | undefined>;
|
|
952
|
+
/**
|
|
953
|
+
* Appends a merge operand for `key` and returns metadata for the write.
|
|
954
|
+
*/
|
|
955
|
+
merge(key: Uint8Array, operand: Uint8Array): Promise<WriteHandle>;
|
|
956
|
+
/**
|
|
957
|
+
* Appends a merge operand using custom merge and write options.
|
|
958
|
+
*/
|
|
959
|
+
merge_with_options(key: Uint8Array, operand: Uint8Array, merge_options: MergeOptions, write_options: WriteOptions): Promise<WriteHandle>;
|
|
960
|
+
/**
|
|
961
|
+
* Inserts or overwrites a value and returns metadata for the write.
|
|
962
|
+
*
|
|
963
|
+
* Keys must be non-empty and at most `u16::MAX` bytes. Values must be at
|
|
964
|
+
* most `u32::MAX` bytes.
|
|
965
|
+
*/
|
|
966
|
+
put(key: Uint8Array, value: Uint8Array): Promise<WriteHandle>;
|
|
967
|
+
/**
|
|
968
|
+
* Inserts or overwrites a value using custom put and write options.
|
|
969
|
+
*/
|
|
970
|
+
put_with_options(key: Uint8Array, value: Uint8Array, put_options: PutOptions, write_options: WriteOptions): Promise<WriteHandle>;
|
|
971
|
+
/**
|
|
972
|
+
* Scans rows inside `range`.
|
|
973
|
+
*/
|
|
974
|
+
scan(range: KeyRange): Promise<DbIterator>;
|
|
975
|
+
/**
|
|
976
|
+
* Scans rows whose keys start with `prefix`.
|
|
977
|
+
*/
|
|
978
|
+
scan_prefix(prefix: Uint8Array): Promise<DbIterator>;
|
|
979
|
+
/**
|
|
980
|
+
* Scans rows whose keys start with `prefix` using custom scan options.
|
|
981
|
+
*/
|
|
982
|
+
scan_prefix_with_options(prefix: Uint8Array, options: ScanOptions): Promise<DbIterator>;
|
|
983
|
+
/**
|
|
984
|
+
* Scans rows inside `range` using custom scan options.
|
|
985
|
+
*/
|
|
986
|
+
scan_with_options(range: KeyRange, options: ScanOptions): Promise<DbIterator>;
|
|
987
|
+
/**
|
|
988
|
+
* Flushes outstanding work and closes the database.
|
|
989
|
+
*/
|
|
990
|
+
shutdown(): Promise<void>;
|
|
991
|
+
/**
|
|
992
|
+
* Creates a read-only snapshot representing a consistent point in time.
|
|
993
|
+
*/
|
|
994
|
+
snapshot(): Promise<DbSnapshot>;
|
|
995
|
+
/**
|
|
996
|
+
* Returns the latest database status snapshot.
|
|
997
|
+
*/
|
|
998
|
+
status(): DbStatus;
|
|
999
|
+
/**
|
|
1000
|
+
* Applies all operations in `batch` atomically.
|
|
1001
|
+
*
|
|
1002
|
+
* The provided batch is consumed and cannot be reused afterwards.
|
|
1003
|
+
*/
|
|
1004
|
+
write(batch: WriteBatch): Promise<WriteHandle>;
|
|
1005
|
+
/**
|
|
1006
|
+
* Applies all operations in `batch` atomically using custom write options.
|
|
1007
|
+
*
|
|
1008
|
+
* The provided batch is consumed and cannot be reused afterwards.
|
|
1009
|
+
*/
|
|
1010
|
+
write_with_options(batch: WriteBatch, options: WriteOptions): Promise<WriteHandle>;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Read-only database handle opened by [`crate::DbReaderBuilder`].
|
|
1015
|
+
*/
|
|
1016
|
+
export declare class DbReader extends UniffiObjectBase {
|
|
1017
|
+
protected constructor();
|
|
1018
|
+
/**
|
|
1019
|
+
* Reads the current value for `key`.
|
|
1020
|
+
*/
|
|
1021
|
+
get(key: Uint8Array): Promise<Uint8Array | undefined>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Reads the current value for `key` using custom read options.
|
|
1024
|
+
*/
|
|
1025
|
+
get_with_options(key: Uint8Array, options: ReadOptions): Promise<Uint8Array | undefined>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Scans rows inside `range`.
|
|
1028
|
+
*/
|
|
1029
|
+
scan(range: KeyRange): Promise<DbIterator>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Scans rows whose keys start with `prefix`.
|
|
1032
|
+
*/
|
|
1033
|
+
scan_prefix(prefix: Uint8Array): Promise<DbIterator>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Scans rows whose keys start with `prefix` using custom scan options.
|
|
1036
|
+
*/
|
|
1037
|
+
scan_prefix_with_options(prefix: Uint8Array, options: ScanOptions): Promise<DbIterator>;
|
|
1038
|
+
/**
|
|
1039
|
+
* Scans rows inside `range` using custom scan options.
|
|
1040
|
+
*/
|
|
1041
|
+
scan_with_options(range: KeyRange, options: ScanOptions): Promise<DbIterator>;
|
|
1042
|
+
/**
|
|
1043
|
+
* Closes the reader.
|
|
1044
|
+
*/
|
|
1045
|
+
shutdown(): Promise<void>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Returns the latest reader status snapshot.
|
|
1048
|
+
*/
|
|
1049
|
+
status(): DbStatus;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Read-only snapshot representing a consistent view of the database.
|
|
1054
|
+
*/
|
|
1055
|
+
export declare class DbSnapshot extends UniffiObjectBase {
|
|
1056
|
+
protected constructor();
|
|
1057
|
+
/**
|
|
1058
|
+
* Reads the value visible in this snapshot for `key`.
|
|
1059
|
+
*/
|
|
1060
|
+
get(key: Uint8Array): Promise<Uint8Array | undefined>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Reads the row version visible in this snapshot for `key`.
|
|
1063
|
+
*/
|
|
1064
|
+
get_key_value(key: Uint8Array): Promise<KeyValue | undefined>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Reads the row version visible in this snapshot for `key` using custom read options.
|
|
1067
|
+
*/
|
|
1068
|
+
get_key_value_with_options(key: Uint8Array, options: ReadOptions): Promise<KeyValue | undefined>;
|
|
1069
|
+
/**
|
|
1070
|
+
* Reads the value visible in this snapshot for `key` using custom read options.
|
|
1071
|
+
*/
|
|
1072
|
+
get_with_options(key: Uint8Array, options: ReadOptions): Promise<Uint8Array | undefined>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Scans rows inside `range` as of this snapshot.
|
|
1075
|
+
*/
|
|
1076
|
+
scan(range: KeyRange): Promise<DbIterator>;
|
|
1077
|
+
/**
|
|
1078
|
+
* Scans rows whose keys start with `prefix` as of this snapshot.
|
|
1079
|
+
*/
|
|
1080
|
+
scan_prefix(prefix: Uint8Array): Promise<DbIterator>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Scans rows whose keys start with `prefix` as of this snapshot using custom options.
|
|
1083
|
+
*/
|
|
1084
|
+
scan_prefix_with_options(prefix: Uint8Array, options: ScanOptions): Promise<DbIterator>;
|
|
1085
|
+
/**
|
|
1086
|
+
* Scans rows inside `range` as of this snapshot using custom scan options.
|
|
1087
|
+
*/
|
|
1088
|
+
scan_with_options(range: KeyRange, options: ScanOptions): Promise<DbIterator>;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* Transaction handle returned by [`crate::Db::begin`].
|
|
1093
|
+
*
|
|
1094
|
+
* A transaction becomes unusable after `commit`, `commit_with_options`, or
|
|
1095
|
+
* `rollback`.
|
|
1096
|
+
*/
|
|
1097
|
+
export declare class DbTransaction extends UniffiObjectBase {
|
|
1098
|
+
protected constructor();
|
|
1099
|
+
/**
|
|
1100
|
+
* Commits the transaction.
|
|
1101
|
+
*
|
|
1102
|
+
* Returns `None` when the transaction performed no writes.
|
|
1103
|
+
*/
|
|
1104
|
+
commit(): Promise<WriteHandle | undefined>;
|
|
1105
|
+
/**
|
|
1106
|
+
* Commits the transaction using custom write options.
|
|
1107
|
+
*
|
|
1108
|
+
* Returns `None` when the transaction performed no writes.
|
|
1109
|
+
*/
|
|
1110
|
+
commit_with_options(options: WriteOptions): Promise<WriteHandle | undefined>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Buffers a delete inside the transaction.
|
|
1113
|
+
*/
|
|
1114
|
+
delete(key: Uint8Array): Promise<void>;
|
|
1115
|
+
/**
|
|
1116
|
+
* Reads the value visible to this transaction for `key`.
|
|
1117
|
+
*/
|
|
1118
|
+
get(key: Uint8Array): Promise<Uint8Array | undefined>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Reads the row version visible to this transaction for `key`.
|
|
1121
|
+
*/
|
|
1122
|
+
get_key_value(key: Uint8Array): Promise<KeyValue | undefined>;
|
|
1123
|
+
/**
|
|
1124
|
+
* Reads the row version visible to this transaction for `key` using custom options.
|
|
1125
|
+
*/
|
|
1126
|
+
get_key_value_with_options(key: Uint8Array, options: ReadOptions): Promise<KeyValue | undefined>;
|
|
1127
|
+
/**
|
|
1128
|
+
* Reads the value visible to this transaction for `key` using custom read options.
|
|
1129
|
+
*/
|
|
1130
|
+
get_with_options(key: Uint8Array, options: ReadOptions): Promise<Uint8Array | undefined>;
|
|
1131
|
+
/**
|
|
1132
|
+
* Returns the transaction identifier as a UUID string.
|
|
1133
|
+
*/
|
|
1134
|
+
id(): string;
|
|
1135
|
+
/**
|
|
1136
|
+
* Marks keys as read for conflict detection.
|
|
1137
|
+
*/
|
|
1138
|
+
mark_read(keys: Array<Uint8Array>): Promise<void>;
|
|
1139
|
+
/**
|
|
1140
|
+
* Buffers a merge operand inside the transaction.
|
|
1141
|
+
*/
|
|
1142
|
+
merge(key: Uint8Array, operand: Uint8Array): Promise<void>;
|
|
1143
|
+
/**
|
|
1144
|
+
* Buffers a merge operand inside the transaction using custom merge options.
|
|
1145
|
+
*/
|
|
1146
|
+
merge_with_options(key: Uint8Array, operand: Uint8Array, options: MergeOptions): Promise<void>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Buffers a put inside the transaction.
|
|
1149
|
+
*/
|
|
1150
|
+
put(key: Uint8Array, value: Uint8Array): Promise<void>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Buffers a put inside the transaction using custom put options.
|
|
1153
|
+
*/
|
|
1154
|
+
put_with_options(key: Uint8Array, value: Uint8Array, options: PutOptions): Promise<void>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Rolls back the transaction and marks it completed.
|
|
1157
|
+
*/
|
|
1158
|
+
rollback(): Promise<void>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Scans rows inside `range` as visible to this transaction.
|
|
1161
|
+
*/
|
|
1162
|
+
scan(range: KeyRange): Promise<DbIterator>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Scans rows whose keys start with `prefix` as visible to this transaction.
|
|
1165
|
+
*/
|
|
1166
|
+
scan_prefix(prefix: Uint8Array): Promise<DbIterator>;
|
|
1167
|
+
/**
|
|
1168
|
+
* Scans rows whose keys start with `prefix` as visible to this transaction using custom options.
|
|
1169
|
+
*/
|
|
1170
|
+
scan_prefix_with_options(prefix: Uint8Array, options: ScanOptions): Promise<DbIterator>;
|
|
1171
|
+
/**
|
|
1172
|
+
* Scans rows inside `range` as visible to this transaction using custom options.
|
|
1173
|
+
*/
|
|
1174
|
+
scan_with_options(range: KeyRange, options: ScanOptions): Promise<DbIterator>;
|
|
1175
|
+
/**
|
|
1176
|
+
* Returns the sequence number assigned when the transaction started.
|
|
1177
|
+
*/
|
|
1178
|
+
seqnum(): bigint | number;
|
|
1179
|
+
/**
|
|
1180
|
+
* Excludes written keys from transaction conflict detection.
|
|
1181
|
+
*/
|
|
1182
|
+
unmark_write(keys: Array<Uint8Array>): Promise<void>;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Async iterator returned by scan APIs.
|
|
1187
|
+
*/
|
|
1188
|
+
export declare class DbIterator extends UniffiObjectBase {
|
|
1189
|
+
protected constructor();
|
|
1190
|
+
/**
|
|
1191
|
+
* Returns the next key/value pair from the iterator.
|
|
1192
|
+
*/
|
|
1193
|
+
next(): Promise<KeyValue | undefined>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Seeks the iterator to the first entry at or after `key`.
|
|
1196
|
+
*/
|
|
1197
|
+
seek(key: Uint8Array): Promise<void>;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* Built-in atomic-backed metrics recorder with snapshot access.
|
|
1202
|
+
*/
|
|
1203
|
+
export declare class DefaultMetricsRecorder extends UniffiObjectBase {
|
|
1204
|
+
/**
|
|
1205
|
+
* Creates an empty default metrics recorder.
|
|
1206
|
+
*/
|
|
1207
|
+
constructor();
|
|
1208
|
+
/**
|
|
1209
|
+
* Returns the metric matching `name` and the exact label set, if present.
|
|
1210
|
+
*/
|
|
1211
|
+
metric_by_name_and_labels(name: string, labels: Array<MetricLabel>): Metric | undefined;
|
|
1212
|
+
/**
|
|
1213
|
+
* Returns every metric with the requested name.
|
|
1214
|
+
*/
|
|
1215
|
+
metrics_by_name(name: string): Array<Metric>;
|
|
1216
|
+
register_counter(name: string, description: string, labels: Array<MetricLabel>): Counter;
|
|
1217
|
+
register_gauge(name: string, description: string, labels: Array<MetricLabel>): Gauge;
|
|
1218
|
+
register_histogram(name: string, description: string, labels: Array<MetricLabel>, boundaries: Array<number>): Histogram;
|
|
1219
|
+
register_up_down_counter(name: string, description: string, labels: Array<MetricLabel>): UpDownCounter;
|
|
1220
|
+
/**
|
|
1221
|
+
* Returns a point-in-time snapshot of every registered metric.
|
|
1222
|
+
*/
|
|
1223
|
+
snapshot(): Array<Metric>;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Object store handle used when opening databases, readers, and WAL readers.
|
|
1228
|
+
*/
|
|
1229
|
+
export declare class ObjectStore extends UniffiObjectBase {
|
|
1230
|
+
protected constructor();
|
|
1231
|
+
/**
|
|
1232
|
+
* Builds an object store from environment configuration.
|
|
1233
|
+
*
|
|
1234
|
+
* When `env_file` is provided, environment variables are loaded from that
|
|
1235
|
+
* file before constructing the store.
|
|
1236
|
+
*/
|
|
1237
|
+
static from_env(env_file: string | undefined): ObjectStore;
|
|
1238
|
+
/**
|
|
1239
|
+
* Resolves an object store from a URL understood by SlateDB.
|
|
1240
|
+
*/
|
|
1241
|
+
static resolve(url: string): ObjectStore;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* Mutable database settings object used to configure a [`crate::DbBuilder`].
|
|
1246
|
+
*/
|
|
1247
|
+
export declare class Settings extends UniffiObjectBase {
|
|
1248
|
+
protected constructor();
|
|
1249
|
+
/**
|
|
1250
|
+
* Creates a settings object populated with SlateDB defaults.
|
|
1251
|
+
*/
|
|
1252
|
+
static default(): Settings;
|
|
1253
|
+
/**
|
|
1254
|
+
* Loads settings from environment variables using `prefix`.
|
|
1255
|
+
*/
|
|
1256
|
+
static from_env(prefix: string): Settings;
|
|
1257
|
+
/**
|
|
1258
|
+
* Loads settings from environment variables, falling back to `default_settings`.
|
|
1259
|
+
*/
|
|
1260
|
+
static from_env_with_default(prefix: string, default_settings: Settings): Settings;
|
|
1261
|
+
/**
|
|
1262
|
+
* Loads settings from a JSON, TOML, or YAML file based on its extension.
|
|
1263
|
+
*/
|
|
1264
|
+
static from_file(path: string): Settings;
|
|
1265
|
+
/**
|
|
1266
|
+
* Parses settings from a JSON string.
|
|
1267
|
+
*/
|
|
1268
|
+
static from_json_string(json: string): Settings;
|
|
1269
|
+
/**
|
|
1270
|
+
* Loads settings from SlateDB's default file and environment lookup order.
|
|
1271
|
+
*/
|
|
1272
|
+
static load(): Settings;
|
|
1273
|
+
/**
|
|
1274
|
+
* Sets a settings field by dotted path using a JSON literal value.
|
|
1275
|
+
*
|
|
1276
|
+
* `key` identifies the field to update. Use `.` to address nested objects,
|
|
1277
|
+
* for example `compactor_options.max_sst_size` or
|
|
1278
|
+
* `object_store_cache_options.root_folder`.
|
|
1279
|
+
*
|
|
1280
|
+
* `value_json` must be a valid JSON literal matching the target field's
|
|
1281
|
+
* expected type. That means strings must be quoted JSON strings, numbers
|
|
1282
|
+
* should be passed as JSON numbers, booleans as `true`/`false`, and
|
|
1283
|
+
* optional fields can be cleared with `null`.
|
|
1284
|
+
*
|
|
1285
|
+
* Missing or `null` intermediate objects in the dotted path are created
|
|
1286
|
+
* automatically. If the update would produce an invalid `slatedb::Settings`
|
|
1287
|
+
* value, the method returns an error and leaves the current settings
|
|
1288
|
+
* unchanged.
|
|
1289
|
+
*
|
|
1290
|
+
* Examples:
|
|
1291
|
+
*
|
|
1292
|
+
* - `set("flush_interval", "\"250ms\"")`
|
|
1293
|
+
* - `set("default_ttl", "42")`
|
|
1294
|
+
* - `set("default_ttl", "null")`
|
|
1295
|
+
* - `set("compactor_options.max_sst_size", "33554432")`
|
|
1296
|
+
* - `set("object_store_cache_options.root_folder", "\"/tmp/slatedb-cache\"")`
|
|
1297
|
+
*/
|
|
1298
|
+
set(key: string, value_json: string): void;
|
|
1299
|
+
/**
|
|
1300
|
+
* Serializes the current settings value to a JSON string.
|
|
1301
|
+
*/
|
|
1302
|
+
to_json_string(): string;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* Handle for a single WAL file.
|
|
1307
|
+
*/
|
|
1308
|
+
export declare class WalFile extends UniffiObjectBase {
|
|
1309
|
+
protected constructor();
|
|
1310
|
+
/**
|
|
1311
|
+
* Returns the WAL file ID.
|
|
1312
|
+
*/
|
|
1313
|
+
id(): bigint | number;
|
|
1314
|
+
/**
|
|
1315
|
+
* Opens an iterator over raw row entries in this WAL file.
|
|
1316
|
+
*/
|
|
1317
|
+
iterator(): Promise<WalFileIterator>;
|
|
1318
|
+
/**
|
|
1319
|
+
* Reads object-store metadata for this WAL file.
|
|
1320
|
+
*/
|
|
1321
|
+
metadata(): Promise<WalFileMetadata>;
|
|
1322
|
+
/**
|
|
1323
|
+
* Returns a handle for the next WAL file ID without checking existence.
|
|
1324
|
+
*/
|
|
1325
|
+
next_file(): WalFile;
|
|
1326
|
+
/**
|
|
1327
|
+
* Returns the WAL ID immediately after this file.
|
|
1328
|
+
*/
|
|
1329
|
+
next_id(): bigint | number;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Iterator over raw row entries stored in a WAL file.
|
|
1334
|
+
*/
|
|
1335
|
+
export declare class WalFileIterator extends UniffiObjectBase {
|
|
1336
|
+
protected constructor();
|
|
1337
|
+
/**
|
|
1338
|
+
* Returns the next raw row entry from the WAL file.
|
|
1339
|
+
*/
|
|
1340
|
+
next(): Promise<RowEntry | undefined>;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* Reader for WAL files stored under a database path.
|
|
1345
|
+
*/
|
|
1346
|
+
export declare class WalReader extends UniffiObjectBase {
|
|
1347
|
+
/**
|
|
1348
|
+
* Creates a WAL reader for `path` in `object_store`.
|
|
1349
|
+
*/
|
|
1350
|
+
constructor(path: string, object_store: ObjectStore);
|
|
1351
|
+
/**
|
|
1352
|
+
* Returns a handle for the WAL file with the given ID.
|
|
1353
|
+
*/
|
|
1354
|
+
get(id: bigint | number): WalFile;
|
|
1355
|
+
/**
|
|
1356
|
+
* Lists WAL files in ascending ID order.
|
|
1357
|
+
*
|
|
1358
|
+
* `start_id` is inclusive and `end_id` is exclusive when provided.
|
|
1359
|
+
*/
|
|
1360
|
+
list(start_id: bigint | number | undefined, end_id: bigint | number | undefined): Promise<Array<WalFile>>;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* Mutable batch of write operations applied atomically by [`crate::Db::write`].
|
|
1365
|
+
*
|
|
1366
|
+
* A batch is single-use once submitted to the database.
|
|
1367
|
+
*/
|
|
1368
|
+
export declare class WriteBatch extends UniffiObjectBase {
|
|
1369
|
+
/**
|
|
1370
|
+
* Creates an empty write batch.
|
|
1371
|
+
*/
|
|
1372
|
+
constructor();
|
|
1373
|
+
/**
|
|
1374
|
+
* Appends a delete operation to the batch.
|
|
1375
|
+
*/
|
|
1376
|
+
delete(key: Uint8Array): void;
|
|
1377
|
+
/**
|
|
1378
|
+
* Appends a merge operation to the batch.
|
|
1379
|
+
*/
|
|
1380
|
+
merge(key: Uint8Array, operand: Uint8Array): void;
|
|
1381
|
+
/**
|
|
1382
|
+
* Appends a merge operation with custom merge options.
|
|
1383
|
+
*/
|
|
1384
|
+
merge_with_options(key: Uint8Array, operand: Uint8Array, options: MergeOptions): void;
|
|
1385
|
+
/**
|
|
1386
|
+
* Appends a put operation to the batch.
|
|
1387
|
+
*/
|
|
1388
|
+
put(key: Uint8Array, value: Uint8Array): void;
|
|
1389
|
+
/**
|
|
1390
|
+
* Appends a put operation with custom put options.
|
|
1391
|
+
*/
|
|
1392
|
+
put_with_options(key: Uint8Array, value: Uint8Array, options: PutOptions): void;
|
|
1393
|
+
}
|