@tinyshed/tinystore 0.7.1 → 0.9.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 +1 -1
- package/dist/backup.d.ts +2 -0
- package/dist/backup.js +1 -0
- package/dist/blobs.d.ts +18 -1
- package/dist/blobs.js +52 -45
- package/dist/console.d.ts +6 -3
- package/dist/console.js +53 -14
- package/dist/directory.d.ts +72 -0
- package/dist/directory.js +121 -0
- package/dist/index.d.ts +2 -1
- package/dist/jobs.d.ts +42 -14
- package/dist/jobs.js +146 -39
- package/dist/locks.js +18 -0
- package/dist/metrics.d.ts +5 -1
- package/dist/metrics.js +2 -0
- package/dist/query.d.ts +8 -1
- package/dist/query.js +56 -19
- package/dist/search.d.ts +17 -1
- package/dist/search.js +11 -2
- package/dist/sql.d.ts +33 -2
- package/dist/sql.js +91 -11
- package/dist/store.d.ts +9 -0
- package/dist/store.js +11 -0
- package/dist/wire/protocol.d.ts +219 -11
- package/dist/wire/protocol.js +650 -18
- package/package.json +8 -8
- package/src/backup.ts +3 -0
- package/src/blobs.ts +66 -45
- package/src/console.ts +56 -16
- package/src/directory.ts +235 -0
- package/src/index.ts +9 -0
- package/src/jobs.ts +187 -46
- package/src/locks.ts +22 -0
- package/src/metrics.ts +7 -1
- package/src/query.ts +68 -24
- package/src/search.ts +28 -5
- package/src/sql.ts +105 -11
- package/src/store.ts +12 -0
- package/src/wire/protocol.ts +685 -18
package/dist/wire/protocol.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export declare const methods: {
|
|
|
14
14
|
readonly 'blobs.usage': 1035;
|
|
15
15
|
readonly 'blobs.clear': 1036;
|
|
16
16
|
readonly 'blobs.read': 1037;
|
|
17
|
+
readonly 'blobs.directory': 1038;
|
|
18
|
+
readonly 'blobs.scan': 1039;
|
|
19
|
+
readonly 'blobs.changes': 1040;
|
|
20
|
+
readonly 'blobs.forget': 1041;
|
|
17
21
|
/**
|
|
18
22
|
* Answers once the store has the message, not once anyone handled it; in a
|
|
19
23
|
* database's transaction, it is handed over once the transaction commits.
|
|
@@ -46,6 +50,7 @@ export declare const methods: {
|
|
|
46
50
|
readonly 'jobs.keep': 523;
|
|
47
51
|
readonly 'jobs.watch': 524;
|
|
48
52
|
readonly 'jobs.tx': 525;
|
|
53
|
+
readonly 'jobs.counts': 526;
|
|
49
54
|
readonly 'kv.bucket.open': 257;
|
|
50
55
|
readonly 'kv.get': 258;
|
|
51
56
|
readonly 'kv.has': 259;
|
|
@@ -176,6 +181,8 @@ export declare const BackupWritten: import("./codec.ts").Message<{
|
|
|
176
181
|
readonly bytes: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
177
182
|
/** the store seals values with a key the backup does not hold */
|
|
178
183
|
readonly keyLeftOut: readonly [3, import("./codec.ts").Codec<boolean, boolean>];
|
|
184
|
+
/** the databases opened with backup false, which it holds nothing of */
|
|
185
|
+
readonly excluded: readonly [4, import("./codec.ts").Codec<string[], readonly string[]>];
|
|
179
186
|
}>;
|
|
180
187
|
/**
|
|
181
188
|
* Opens a set of files by name, made the first time.
|
|
@@ -251,10 +258,13 @@ export declare const BlobsWritten: import("./codec.ts").Message<{
|
|
|
251
258
|
}>;
|
|
252
259
|
/**
|
|
253
260
|
* A piece of a file's bytes: an upload's DATA from the client, a read's from
|
|
254
|
-
* the server.
|
|
261
|
+
* the server. A piece of a growing directory's file brings the file's size
|
|
262
|
+
* and time as it was read, so that the reader sees it moved.
|
|
255
263
|
*/
|
|
256
264
|
export declare const BlobsPiece: import("./codec.ts").Message<{
|
|
257
265
|
readonly bytes: readonly [1, import("./codec.ts").Codec<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>];
|
|
266
|
+
readonly size: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
267
|
+
readonly lastModified: readonly [3, import("./codec.ts").Codec<number, number>];
|
|
258
268
|
}>;
|
|
259
269
|
/**
|
|
260
270
|
* A get's answer: what the file carries, none when there is no file, and all
|
|
@@ -376,6 +386,108 @@ export declare const BlobsUsage: import("./codec.ts").Message<{
|
|
|
376
386
|
readonly count: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
377
387
|
readonly size: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
378
388
|
}>;
|
|
389
|
+
/**
|
|
390
|
+
* Opens a directory by name: a folder of the server's machine, which the
|
|
391
|
+
* store lists and reads and never writes. Its handle takes get, head, list,
|
|
392
|
+
* usage and read as a set of files' does, each answered from the list the
|
|
393
|
+
* last scan wrote but a get's and a read's bytes, which come from the disk;
|
|
394
|
+
* every call that writes a file is invalid. A connection that came with a
|
|
395
|
+
* token names no path: it opens the directory the server was given under the
|
|
396
|
+
* name, and one the server was not given is invalid.
|
|
397
|
+
*/
|
|
398
|
+
export declare const BlobsDirectory: import("./codec.ts").Message<{
|
|
399
|
+
/** [a-z0-9][a-z0-9_-]{0,63}, never a set of files' name too */
|
|
400
|
+
readonly name: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
401
|
+
/** the folder on the server's machine; the server's own when absent */
|
|
402
|
+
readonly path: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
403
|
+
/** a scan on the store's background work, a period apart */
|
|
404
|
+
readonly every: readonly [3, import("./codec.ts").Codec<number, number>];
|
|
405
|
+
/** names a scan passes over, * for any run of a name's characters */
|
|
406
|
+
readonly ignore: readonly [4, import("./codec.ts").Codec<string[], readonly string[]>];
|
|
407
|
+
/** a read holds to no version and goes up to the size now */
|
|
408
|
+
readonly growing: readonly [5, import("./codec.ts").Codec<boolean, boolean>];
|
|
409
|
+
}>;
|
|
410
|
+
/**
|
|
411
|
+
* What a scan found, and what the list holds once it ended.
|
|
412
|
+
*/
|
|
413
|
+
export declare const BlobsScanned: import("./codec.ts").Message<{
|
|
414
|
+
readonly added: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
415
|
+
readonly changed: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
416
|
+
readonly removed: readonly [3, import("./codec.ts").Codec<number, number>];
|
|
417
|
+
/** what it met and could not list: a link, a folder it cannot read, another disk */
|
|
418
|
+
readonly skipped: readonly [4, import("./codec.ts").Codec<number, number>];
|
|
419
|
+
readonly count: readonly [5, import("./codec.ts").Codec<number, number>];
|
|
420
|
+
readonly size: readonly [6, import("./codec.ts").Codec<number, number>];
|
|
421
|
+
}>;
|
|
422
|
+
/**
|
|
423
|
+
* The changes of a directory past a cursor, from the first file it listed
|
|
424
|
+
* when absent.
|
|
425
|
+
*/
|
|
426
|
+
export declare const BlobsSince: import("./codec.ts").Message<{
|
|
427
|
+
readonly handle: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
428
|
+
/** a page's next */
|
|
429
|
+
readonly after: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
430
|
+
}>;
|
|
431
|
+
export declare const BlobsChange: import("./codec.ts").Message<{
|
|
432
|
+
/** the whole path in the directory */
|
|
433
|
+
readonly path: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
434
|
+
/** added, changed or removed */
|
|
435
|
+
readonly change: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
436
|
+
/** none once removed */
|
|
437
|
+
readonly info: readonly [3, import("./codec.ts").Message<{
|
|
438
|
+
/** within the folder the call stood in */
|
|
439
|
+
readonly path: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
440
|
+
readonly size: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
441
|
+
/** the SHA-256 of its bytes in hex, quoted */
|
|
442
|
+
readonly etag: readonly [3, import("./codec.ts").Codec<string, string>];
|
|
443
|
+
readonly contentType: readonly [4, import("./codec.ts").Codec<string, string>];
|
|
444
|
+
readonly lastModified: readonly [5, import("./codec.ts").Codec<number, number>];
|
|
445
|
+
readonly expires: readonly [6, import("./codec.ts").Codec<number, number>];
|
|
446
|
+
readonly meta: readonly [7, import("./codec.ts").Codec<Record<string, string>, Record<string, string>>];
|
|
447
|
+
}>];
|
|
448
|
+
}>;
|
|
449
|
+
/**
|
|
450
|
+
* A page of changes in the order the scans wrote them, 1000 at most; next is
|
|
451
|
+
* always there, with no items the cursor to ask from after the next scan.
|
|
452
|
+
*/
|
|
453
|
+
export declare const BlobsChanges: import("./codec.ts").Message<{
|
|
454
|
+
readonly items: readonly [1, import("./codec.ts").Codec<Read<{
|
|
455
|
+
/** the whole path in the directory */
|
|
456
|
+
readonly path: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
457
|
+
/** added, changed or removed */
|
|
458
|
+
readonly change: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
459
|
+
/** none once removed */
|
|
460
|
+
readonly info: readonly [3, import("./codec.ts").Message<{
|
|
461
|
+
/** within the folder the call stood in */
|
|
462
|
+
readonly path: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
463
|
+
readonly size: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
464
|
+
/** the SHA-256 of its bytes in hex, quoted */
|
|
465
|
+
readonly etag: readonly [3, import("./codec.ts").Codec<string, string>];
|
|
466
|
+
readonly contentType: readonly [4, import("./codec.ts").Codec<string, string>];
|
|
467
|
+
readonly lastModified: readonly [5, import("./codec.ts").Codec<number, number>];
|
|
468
|
+
readonly expires: readonly [6, import("./codec.ts").Codec<number, number>];
|
|
469
|
+
readonly meta: readonly [7, import("./codec.ts").Codec<Record<string, string>, Record<string, string>>];
|
|
470
|
+
}>];
|
|
471
|
+
}>[], readonly import("./codec.ts").Written<{
|
|
472
|
+
/** the whole path in the directory */
|
|
473
|
+
readonly path: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
474
|
+
/** added, changed or removed */
|
|
475
|
+
readonly change: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
476
|
+
/** none once removed */
|
|
477
|
+
readonly info: readonly [3, import("./codec.ts").Message<{
|
|
478
|
+
/** within the folder the call stood in */
|
|
479
|
+
readonly path: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
480
|
+
readonly size: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
481
|
+
/** the SHA-256 of its bytes in hex, quoted */
|
|
482
|
+
readonly etag: readonly [3, import("./codec.ts").Codec<string, string>];
|
|
483
|
+
readonly contentType: readonly [4, import("./codec.ts").Codec<string, string>];
|
|
484
|
+
readonly lastModified: readonly [5, import("./codec.ts").Codec<number, number>];
|
|
485
|
+
readonly expires: readonly [6, import("./codec.ts").Codec<number, number>];
|
|
486
|
+
readonly meta: readonly [7, import("./codec.ts").Codec<Record<string, string>, Record<string, string>>];
|
|
487
|
+
}>];
|
|
488
|
+
}>[]>];
|
|
489
|
+
readonly next: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
490
|
+
}>;
|
|
379
491
|
/**
|
|
380
492
|
* A message published on a channel's branch, as docs/guides/channels/README.md has
|
|
381
493
|
* it: every subscription listening there now receives it.
|
|
@@ -663,11 +775,13 @@ export declare const JobsCall: import("./codec.ts").Message<{
|
|
|
663
775
|
readonly timeZone: readonly [9, import("./codec.ts").Codec<string, string>];
|
|
664
776
|
}>;
|
|
665
777
|
/**
|
|
666
|
-
* The job under an id
|
|
778
|
+
* The job under an id; or, for a cancel, a job without one by the row a page
|
|
779
|
+
* gave, its id left out.
|
|
667
780
|
*/
|
|
668
781
|
export declare const JobsId: import("./codec.ts").Message<{
|
|
669
782
|
readonly handle: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
670
783
|
readonly id: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
784
|
+
readonly row: readonly [3, import("./codec.ts").Codec<string, string>];
|
|
671
785
|
}>;
|
|
672
786
|
/**
|
|
673
787
|
* Whether a call did what it asked: an add added, an update changed, a cancel
|
|
@@ -698,11 +812,20 @@ export declare const JobsJob: import("./codec.ts").Message<{
|
|
|
698
812
|
/** the last run a handler finished */
|
|
699
813
|
readonly startedAt: readonly [12, import("./codec.ts").Codec<number, number>];
|
|
700
814
|
readonly endedAt: readonly [13, import("./codec.ts").Codec<number, number>];
|
|
815
|
+
/** where a job without an id lies, which a cancel names it by */
|
|
816
|
+
readonly row: readonly [14, import("./codec.ts").Codec<string, string>];
|
|
817
|
+
/** a walk's: why the job's value no longer reads, the job left out */
|
|
818
|
+
readonly failure: readonly [15, import("./codec.ts").Message<{
|
|
819
|
+
readonly code: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
820
|
+
readonly message: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
821
|
+
readonly what: readonly [3, import("./codec.ts").Codec<Record<string, string>, Record<string, string>>];
|
|
822
|
+
}>];
|
|
701
823
|
}>;
|
|
702
824
|
/**
|
|
703
825
|
* A page of a queue's jobs: those whose ids start with a prefix, in the byte
|
|
704
|
-
* order of their ids
|
|
705
|
-
*
|
|
826
|
+
* order of their ids; with no prefix every job, those with ids first, then
|
|
827
|
+
* those without as they run, then those without that failed, the last failed
|
|
828
|
+
* first; with no prefix and the failed state the failed alone, the last first.
|
|
706
829
|
*/
|
|
707
830
|
export declare const JobsList: import("./codec.ts").Message<{
|
|
708
831
|
readonly handle: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
@@ -713,6 +836,8 @@ export declare const JobsList: import("./codec.ts").Message<{
|
|
|
713
836
|
readonly after: readonly [4, import("./codec.ts").Codec<string, string>];
|
|
714
837
|
/** 100 when absent, 1000 at most */
|
|
715
838
|
readonly limit: readonly [5, import("./codec.ts").Codec<number, number>];
|
|
839
|
+
/** a job whose value no longer reads comes as its failure in its place, not the page's */
|
|
840
|
+
readonly walk: readonly [6, import("./codec.ts").Codec<boolean, boolean>];
|
|
716
841
|
}>;
|
|
717
842
|
export declare const JobsPage: import("./codec.ts").Message<{
|
|
718
843
|
readonly jobs: readonly [1, import("./codec.ts").Codec<Read<{
|
|
@@ -734,6 +859,14 @@ export declare const JobsPage: import("./codec.ts").Message<{
|
|
|
734
859
|
/** the last run a handler finished */
|
|
735
860
|
readonly startedAt: readonly [12, import("./codec.ts").Codec<number, number>];
|
|
736
861
|
readonly endedAt: readonly [13, import("./codec.ts").Codec<number, number>];
|
|
862
|
+
/** where a job without an id lies, which a cancel names it by */
|
|
863
|
+
readonly row: readonly [14, import("./codec.ts").Codec<string, string>];
|
|
864
|
+
/** a walk's: why the job's value no longer reads, the job left out */
|
|
865
|
+
readonly failure: readonly [15, import("./codec.ts").Message<{
|
|
866
|
+
readonly code: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
867
|
+
readonly message: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
868
|
+
readonly what: readonly [3, import("./codec.ts").Codec<Record<string, string>, Record<string, string>>];
|
|
869
|
+
}>];
|
|
737
870
|
}>[], readonly import("./codec.ts").Written<{
|
|
738
871
|
readonly found: readonly [1, import("./codec.ts").Codec<boolean, boolean>];
|
|
739
872
|
readonly id: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
@@ -753,9 +886,30 @@ export declare const JobsPage: import("./codec.ts").Message<{
|
|
|
753
886
|
/** the last run a handler finished */
|
|
754
887
|
readonly startedAt: readonly [12, import("./codec.ts").Codec<number, number>];
|
|
755
888
|
readonly endedAt: readonly [13, import("./codec.ts").Codec<number, number>];
|
|
889
|
+
/** where a job without an id lies, which a cancel names it by */
|
|
890
|
+
readonly row: readonly [14, import("./codec.ts").Codec<string, string>];
|
|
891
|
+
/** a walk's: why the job's value no longer reads, the job left out */
|
|
892
|
+
readonly failure: readonly [15, import("./codec.ts").Message<{
|
|
893
|
+
readonly code: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
894
|
+
readonly message: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
895
|
+
readonly what: readonly [3, import("./codec.ts").Codec<Record<string, string>, Record<string, string>>];
|
|
896
|
+
}>];
|
|
756
897
|
}>[]>];
|
|
757
898
|
readonly next: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
758
899
|
}>;
|
|
900
|
+
/**
|
|
901
|
+
* How many jobs a queue holds in each state, from one snapshot; a done job
|
|
902
|
+
* has left it.
|
|
903
|
+
*/
|
|
904
|
+
export declare const JobsCounts: import("./codec.ts").Message<{
|
|
905
|
+
/** due later */
|
|
906
|
+
readonly scheduled: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
907
|
+
/** due, and no handler runs it yet */
|
|
908
|
+
readonly waiting: readonly [2, import("./codec.ts").Codec<number, number>];
|
|
909
|
+
readonly running: readonly [3, import("./codec.ts").Codec<number, number>];
|
|
910
|
+
/** kept for the queue's keep */
|
|
911
|
+
readonly failed: readonly [4, import("./codec.ts").Codec<number, number>];
|
|
912
|
+
}>;
|
|
759
913
|
/**
|
|
760
914
|
* Starts the queue's worker for the client: the server claims its jobs as they
|
|
761
915
|
* fall due and hands each over as a held job, no more at once than the
|
|
@@ -822,7 +976,7 @@ export declare const JobsKept: import("./codec.ts").Message<{
|
|
|
822
976
|
}>;
|
|
823
977
|
/**
|
|
824
978
|
* One write of a transaction: an add, a set or an update with its call, or a
|
|
825
|
-
* cancel with its id.
|
|
979
|
+
* cancel with its id or its row.
|
|
826
980
|
*/
|
|
827
981
|
export declare const JobsOp: import("./codec.ts").Message<{
|
|
828
982
|
/** jobs.add, jobs.set, jobs.update or jobs.cancel */
|
|
@@ -844,6 +998,7 @@ export declare const JobsOp: import("./codec.ts").Message<{
|
|
|
844
998
|
readonly id: readonly [3, import("./codec.ts").Message<{
|
|
845
999
|
readonly handle: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
846
1000
|
readonly id: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
1001
|
+
readonly row: readonly [3, import("./codec.ts").Codec<string, string>];
|
|
847
1002
|
}>];
|
|
848
1003
|
}>;
|
|
849
1004
|
/**
|
|
@@ -871,6 +1026,7 @@ export declare const JobsTx: import("./codec.ts").Message<{
|
|
|
871
1026
|
readonly id: readonly [3, import("./codec.ts").Message<{
|
|
872
1027
|
readonly handle: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
873
1028
|
readonly id: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
1029
|
+
readonly row: readonly [3, import("./codec.ts").Codec<string, string>];
|
|
874
1030
|
}>];
|
|
875
1031
|
}>[], readonly import("./codec.ts").Written<{
|
|
876
1032
|
/** jobs.add, jobs.set, jobs.update or jobs.cancel */
|
|
@@ -892,6 +1048,7 @@ export declare const JobsTx: import("./codec.ts").Message<{
|
|
|
892
1048
|
readonly id: readonly [3, import("./codec.ts").Message<{
|
|
893
1049
|
readonly handle: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
894
1050
|
readonly id: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
1051
|
+
readonly row: readonly [3, import("./codec.ts").Codec<string, string>];
|
|
895
1052
|
}>];
|
|
896
1053
|
}>[]>];
|
|
897
1054
|
}>;
|
|
@@ -1424,6 +1581,8 @@ export declare const MetricsAggregateAsked: import("./codec.ts").Message<{
|
|
|
1424
1581
|
readonly calendar: readonly [7, import("./codec.ts").Codec<string, string>];
|
|
1425
1582
|
/** an IANA name, UTC among them, which calendar takes */
|
|
1426
1583
|
readonly timeZone: readonly [8, import("./codec.ts").Codec<string, string>];
|
|
1584
|
+
/** a NaN sample counts in no bucket, which says how many it passed over: skipped */
|
|
1585
|
+
readonly skipNan: readonly [9, import("./codec.ts").Codec<boolean, boolean>];
|
|
1427
1586
|
}>;
|
|
1428
1587
|
/**
|
|
1429
1588
|
* A bucket of an aggregate: its value, or a timer's percentile's bounds.
|
|
@@ -1443,6 +1602,8 @@ export declare const MetricsBucket: import("./codec.ts").Message<{
|
|
|
1443
1602
|
readonly partial: readonly [8, import("./codec.ts").Codec<boolean, boolean>];
|
|
1444
1603
|
/** its first step began before the bucket before it */
|
|
1445
1604
|
readonly gap: readonly [9, import("./codec.ts").Codec<boolean, boolean>];
|
|
1605
|
+
/** the NaN samples it passed over, with skipNan */
|
|
1606
|
+
readonly skipped: readonly [10, import("./codec.ts").Codec<number, number>];
|
|
1446
1607
|
}>;
|
|
1447
1608
|
/**
|
|
1448
1609
|
* A group's buckets, or a part of them: a group longer than a body goes on
|
|
@@ -1466,6 +1627,8 @@ export declare const MetricsGroup: import("./codec.ts").Message<{
|
|
|
1466
1627
|
readonly partial: readonly [8, import("./codec.ts").Codec<boolean, boolean>];
|
|
1467
1628
|
/** its first step began before the bucket before it */
|
|
1468
1629
|
readonly gap: readonly [9, import("./codec.ts").Codec<boolean, boolean>];
|
|
1630
|
+
/** the NaN samples it passed over, with skipNan */
|
|
1631
|
+
readonly skipped: readonly [10, import("./codec.ts").Codec<number, number>];
|
|
1469
1632
|
}>[], readonly import("./codec.ts").Written<{
|
|
1470
1633
|
/** where it begins */
|
|
1471
1634
|
readonly at: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
@@ -1481,6 +1644,8 @@ export declare const MetricsGroup: import("./codec.ts").Message<{
|
|
|
1481
1644
|
readonly partial: readonly [8, import("./codec.ts").Codec<boolean, boolean>];
|
|
1482
1645
|
/** its first step began before the bucket before it */
|
|
1483
1646
|
readonly gap: readonly [9, import("./codec.ts").Codec<boolean, boolean>];
|
|
1647
|
+
/** the NaN samples it passed over, with skipNan */
|
|
1648
|
+
readonly skipped: readonly [10, import("./codec.ts").Codec<number, number>];
|
|
1484
1649
|
}>[]>];
|
|
1485
1650
|
/** the next part goes on with this group; on a page's last, the next page's first */
|
|
1486
1651
|
readonly more: readonly [4, import("./codec.ts").Codec<boolean, boolean>];
|
|
@@ -1504,6 +1669,8 @@ export declare const MetricsAggregates: import("./codec.ts").Message<{
|
|
|
1504
1669
|
readonly partial: readonly [8, import("./codec.ts").Codec<boolean, boolean>];
|
|
1505
1670
|
/** its first step began before the bucket before it */
|
|
1506
1671
|
readonly gap: readonly [9, import("./codec.ts").Codec<boolean, boolean>];
|
|
1672
|
+
/** the NaN samples it passed over, with skipNan */
|
|
1673
|
+
readonly skipped: readonly [10, import("./codec.ts").Codec<number, number>];
|
|
1507
1674
|
}>[], readonly import("./codec.ts").Written<{
|
|
1508
1675
|
/** where it begins */
|
|
1509
1676
|
readonly at: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
@@ -1519,6 +1686,8 @@ export declare const MetricsAggregates: import("./codec.ts").Message<{
|
|
|
1519
1686
|
readonly partial: readonly [8, import("./codec.ts").Codec<boolean, boolean>];
|
|
1520
1687
|
/** its first step began before the bucket before it */
|
|
1521
1688
|
readonly gap: readonly [9, import("./codec.ts").Codec<boolean, boolean>];
|
|
1689
|
+
/** the NaN samples it passed over, with skipNan */
|
|
1690
|
+
readonly skipped: readonly [10, import("./codec.ts").Codec<number, number>];
|
|
1522
1691
|
}>[]>];
|
|
1523
1692
|
/** the next part goes on with this group; on a page's last, the next page's first */
|
|
1524
1693
|
readonly more: readonly [4, import("./codec.ts").Codec<boolean, boolean>];
|
|
@@ -1540,6 +1709,8 @@ export declare const MetricsAggregates: import("./codec.ts").Message<{
|
|
|
1540
1709
|
readonly partial: readonly [8, import("./codec.ts").Codec<boolean, boolean>];
|
|
1541
1710
|
/** its first step began before the bucket before it */
|
|
1542
1711
|
readonly gap: readonly [9, import("./codec.ts").Codec<boolean, boolean>];
|
|
1712
|
+
/** the NaN samples it passed over, with skipNan */
|
|
1713
|
+
readonly skipped: readonly [10, import("./codec.ts").Codec<number, number>];
|
|
1543
1714
|
}>[], readonly import("./codec.ts").Written<{
|
|
1544
1715
|
/** where it begins */
|
|
1545
1716
|
readonly at: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
@@ -1555,6 +1726,8 @@ export declare const MetricsAggregates: import("./codec.ts").Message<{
|
|
|
1555
1726
|
readonly partial: readonly [8, import("./codec.ts").Codec<boolean, boolean>];
|
|
1556
1727
|
/** its first step began before the bucket before it */
|
|
1557
1728
|
readonly gap: readonly [9, import("./codec.ts").Codec<boolean, boolean>];
|
|
1729
|
+
/** the NaN samples it passed over, with skipNan */
|
|
1730
|
+
readonly skipped: readonly [10, import("./codec.ts").Codec<number, number>];
|
|
1558
1731
|
}>[]>];
|
|
1559
1732
|
/** the next part goes on with this group; on a page's last, the next page's first */
|
|
1560
1733
|
readonly more: readonly [4, import("./codec.ts").Codec<boolean, boolean>];
|
|
@@ -2495,6 +2668,8 @@ export declare const SearchQuery: import("./codec.ts").Message<{
|
|
|
2495
2668
|
readonly prefixEvery: readonly [10, import("./codec.ts").Codec<boolean, boolean>];
|
|
2496
2669
|
/** utf8, utf16 or chars: each hit says where it matched, counted in that unit */
|
|
2497
2670
|
readonly matches: readonly [11, import("./codec.ts").Codec<string, string>];
|
|
2671
|
+
/** the least cosine a document's vector has for the vector to find it */
|
|
2672
|
+
readonly minSimilarity: readonly [12, import("./codec.ts").Codec<number, number>];
|
|
2498
2673
|
}>;
|
|
2499
2674
|
/**
|
|
2500
2675
|
* Where a search's word matched a hit: a range of a field's text, or of a
|
|
@@ -2584,7 +2759,8 @@ export declare const SqlMigration: import("./codec.ts").Message<{
|
|
|
2584
2759
|
}>;
|
|
2585
2760
|
/**
|
|
2586
2761
|
* Opens a database. Migrations, when given, are applied and checked; without
|
|
2587
|
-
* them the file opens as it is.
|
|
2762
|
+
* them the file opens as it is. One that backups leave out lies in local/
|
|
2763
|
+
* rather than sql/, and a name whose file lies in the other folder is invalid.
|
|
2588
2764
|
*/
|
|
2589
2765
|
export declare const SqlOpen: import("./codec.ts").Message<{
|
|
2590
2766
|
/** [a-z0-9][a-z0-9_-]{0,63} */
|
|
@@ -2600,6 +2776,8 @@ export declare const SqlOpen: import("./codec.ts").Message<{
|
|
|
2600
2776
|
}>[]>];
|
|
2601
2777
|
/** full or os: how far its commits go before they return; the store's own when absent */
|
|
2602
2778
|
readonly durability: readonly [3, import("./codec.ts").Codec<string, string>];
|
|
2779
|
+
/** false: no backup takes it, nor any node; true when absent */
|
|
2780
|
+
readonly backup: readonly [4, import("./codec.ts").Codec<boolean, boolean>];
|
|
2603
2781
|
}>;
|
|
2604
2782
|
/**
|
|
2605
2783
|
* A statement's text and the values of its ?s, in order. In a batch it may
|
|
@@ -2624,15 +2802,33 @@ export declare const SqlStatement: import("./codec.ts").Message<{
|
|
|
2624
2802
|
readonly values: readonly [3, import("./codec.ts").Codec<(boolean | SqlValue)[], readonly import("./codec.ts").SqlArg[]>];
|
|
2625
2803
|
}>;
|
|
2626
2804
|
/**
|
|
2627
|
-
*
|
|
2628
|
-
|
|
2805
|
+
* A column a statement's rows are ordered by, named as its rows name it.
|
|
2806
|
+
*/
|
|
2807
|
+
export declare const SqlOrder: import("./codec.ts").Message<{
|
|
2808
|
+
readonly column: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
2809
|
+
readonly descending: readonly [2, import("./codec.ts").Codec<boolean, boolean>];
|
|
2810
|
+
}>;
|
|
2811
|
+
/**
|
|
2812
|
+
* What a statement gives back: its rows, one row or none, one value, or each
|
|
2813
|
+
* row as the reader reads it. A write with returning runs on the writer, its
|
|
2814
|
+
* rows given once it is durable. Each reads one snapshot of five seconds at
|
|
2815
|
+
* most; with order, the columns its text orders its rows by, a unique one
|
|
2816
|
+
* last, it reads on past that after the last row it sent, and without it
|
|
2817
|
+
* fails limit there.
|
|
2629
2818
|
*/
|
|
2630
2819
|
export declare const SqlQuery: import("./codec.ts").Message<{
|
|
2631
2820
|
readonly handle: readonly [1, import("./codec.ts").Codec<number, number>];
|
|
2632
2821
|
readonly text: readonly [2, import("./codec.ts").Codec<string, string>];
|
|
2633
2822
|
readonly values: readonly [3, import("./codec.ts").Codec<(boolean | SqlValue)[], readonly import("./codec.ts").SqlArg[]>];
|
|
2634
|
-
/** all, one or
|
|
2823
|
+
/** all, one, scalar or each */
|
|
2635
2824
|
readonly want: readonly [4, import("./codec.ts").Codec<string, string>];
|
|
2825
|
+
readonly order: readonly [5, import("./codec.ts").Codec<Read<{
|
|
2826
|
+
readonly column: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
2827
|
+
readonly descending: readonly [2, import("./codec.ts").Codec<boolean, boolean>];
|
|
2828
|
+
}>[], readonly import("./codec.ts").Written<{
|
|
2829
|
+
readonly column: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
2830
|
+
readonly descending: readonly [2, import("./codec.ts").Codec<boolean, boolean>];
|
|
2831
|
+
}>[]>];
|
|
2636
2832
|
}>;
|
|
2637
2833
|
/**
|
|
2638
2834
|
* Rows a statement gave, a part of them a message: the first part names the
|
|
@@ -2901,8 +3097,8 @@ export declare const SearchSetMany: import("./codec.ts").Message<{
|
|
|
2901
3097
|
}>;
|
|
2902
3098
|
/**
|
|
2903
3099
|
* A hit: a document and its value, or a table's row, a value a column of
|
|
2904
|
-
* the answer's columns, as sql.Rows holds one,
|
|
2905
|
-
* matched it when the query asked.
|
|
3100
|
+
* the answer's columns, as sql.Rows holds one, where the search's words
|
|
3101
|
+
* matched it when the query asked, and what each half of the search gave it.
|
|
2906
3102
|
*/
|
|
2907
3103
|
export declare const SearchHit: import("./codec.ts").Message<{
|
|
2908
3104
|
readonly id: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
@@ -2929,6 +3125,10 @@ export declare const SearchHit: import("./codec.ts").Message<{
|
|
|
2929
3125
|
/** the query's word, as its text wrote it */
|
|
2930
3126
|
readonly word: readonly [5, import("./codec.ts").Codec<string, string>];
|
|
2931
3127
|
}>[]>];
|
|
3128
|
+
/** its words' score, where they found it among their best */
|
|
3129
|
+
readonly textScore: readonly [6, import("./codec.ts").Codec<number, number>];
|
|
3130
|
+
/** its vector's cosine with the search's, where both have one */
|
|
3131
|
+
readonly similarity: readonly [7, import("./codec.ts").Codec<number, number>];
|
|
2932
3132
|
}>;
|
|
2933
3133
|
export declare const SearchFound: import("./codec.ts").Message<{
|
|
2934
3134
|
readonly hits: readonly [1, import("./codec.ts").Codec<Read<{
|
|
@@ -2956,6 +3156,10 @@ export declare const SearchFound: import("./codec.ts").Message<{
|
|
|
2956
3156
|
/** the query's word, as its text wrote it */
|
|
2957
3157
|
readonly word: readonly [5, import("./codec.ts").Codec<string, string>];
|
|
2958
3158
|
}>[]>];
|
|
3159
|
+
/** its words' score, where they found it among their best */
|
|
3160
|
+
readonly textScore: readonly [6, import("./codec.ts").Codec<number, number>];
|
|
3161
|
+
/** its vector's cosine with the search's, where both have one */
|
|
3162
|
+
readonly similarity: readonly [7, import("./codec.ts").Codec<number, number>];
|
|
2959
3163
|
}>[], readonly import("./codec.ts").Written<{
|
|
2960
3164
|
readonly id: readonly [1, import("./codec.ts").Codec<string, string>];
|
|
2961
3165
|
/** null for a table's row */
|
|
@@ -2981,6 +3185,10 @@ export declare const SearchFound: import("./codec.ts").Message<{
|
|
|
2981
3185
|
/** the query's word, as its text wrote it */
|
|
2982
3186
|
readonly word: readonly [5, import("./codec.ts").Codec<string, string>];
|
|
2983
3187
|
}>[]>];
|
|
3188
|
+
/** its words' score, where they found it among their best */
|
|
3189
|
+
readonly textScore: readonly [6, import("./codec.ts").Codec<number, number>];
|
|
3190
|
+
/** its vector's cosine with the search's, where both have one */
|
|
3191
|
+
readonly similarity: readonly [7, import("./codec.ts").Codec<number, number>];
|
|
2984
3192
|
}>[]>];
|
|
2985
3193
|
/** the text the search read in fact, when a word was read as another */
|
|
2986
3194
|
readonly corrected: readonly [2, import("./codec.ts").Codec<string, string>];
|