@yaks/sqlite 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +1596 -2
- package/_dist/archetype.d.ts +75 -0
- package/_dist/archetype.d.ts.map +1 -0
- package/_dist/branches.d.ts +23 -0
- package/_dist/branches.d.ts.map +1 -0
- package/_dist/budget.d.ts +52 -0
- package/_dist/budget.d.ts.map +1 -0
- package/_dist/bundle.d.ts +2 -0
- package/_dist/bundle.d.ts.map +1 -0
- package/_dist/cache.d.ts +24 -0
- package/_dist/cache.d.ts.map +1 -0
- package/_dist/catalog.d.ts +9 -0
- package/_dist/catalog.d.ts.map +1 -0
- package/_dist/check.d.ts +4 -0
- package/_dist/check.d.ts.map +1 -0
- package/_dist/db.d.ts +36 -0
- package/_dist/db.d.ts.map +1 -0
- package/_dist/ddl.d.ts +143 -0
- package/_dist/ddl.d.ts.map +1 -0
- package/_dist/doom.d.ts +22 -0
- package/_dist/doom.d.ts.map +1 -0
- package/_dist/follow.d.ts +74 -0
- package/_dist/follow.d.ts.map +1 -0
- package/_dist/history-shapes.d.ts +3 -0
- package/_dist/history-shapes.d.ts.map +1 -0
- package/_dist/history.d.ts +18 -0
- package/_dist/history.d.ts.map +1 -0
- package/_dist/inspect.d.ts +43 -0
- package/_dist/inspect.d.ts.map +1 -0
- package/_dist/jsonb.d.ts +17 -0
- package/_dist/jsonb.d.ts.map +1 -0
- package/_dist/layout.d.ts +7 -0
- package/_dist/layout.d.ts.map +1 -0
- package/_dist/ledger.d.ts +41 -0
- package/_dist/ledger.d.ts.map +1 -0
- package/_dist/meta.d.ts +89 -0
- package/_dist/meta.d.ts.map +1 -0
- package/_dist/migration.d.ts +41 -0
- package/_dist/migration.d.ts.map +1 -0
- package/_dist/mod.d.ts +201 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/mode.d.ts +14 -0
- package/_dist/mode.d.ts.map +1 -0
- package/_dist/overlay.d.ts +30 -0
- package/_dist/overlay.d.ts.map +1 -0
- package/_dist/owe.d.ts +180 -0
- package/_dist/owe.d.ts.map +1 -0
- package/_dist/physical.d.ts +89 -0
- package/_dist/physical.d.ts.map +1 -0
- package/_dist/point.d.ts +10 -0
- package/_dist/point.d.ts.map +1 -0
- package/_dist/raise.d.ts +22 -0
- package/_dist/raise.d.ts.map +1 -0
- package/_dist/read-db.d.ts +9 -0
- package/_dist/read-db.d.ts.map +1 -0
- package/_dist/read-store.d.ts +10 -0
- package/_dist/read-store.d.ts.map +1 -0
- package/_dist/read.d.ts +59 -0
- package/_dist/read.d.ts.map +1 -0
- package/_dist/reader.d.ts +11 -0
- package/_dist/reader.d.ts.map +1 -0
- package/_dist/rules.d.ts +19 -0
- package/_dist/rules.d.ts.map +1 -0
- package/_dist/service.d.ts +12 -0
- package/_dist/service.d.ts.map +1 -0
- package/_dist/shape.d.ts +12 -0
- package/_dist/shape.d.ts.map +1 -0
- package/_dist/statements.d.ts +4 -0
- package/_dist/statements.d.ts.map +1 -0
- package/_dist/survey.d.ts +31 -0
- package/_dist/survey.d.ts.map +1 -0
- package/_dist/tools.d.ts +15 -0
- package/_dist/tools.d.ts.map +1 -0
- package/_dist/trash.d.ts +18 -0
- package/_dist/trash.d.ts.map +1 -0
- package/_dist/unit.d.ts +11 -0
- package/_dist/unit.d.ts.map +1 -0
- package/_dist/vocab.d.ts +6 -0
- package/_dist/vocab.d.ts.map +1 -0
- package/_dist/write.d.ts +169 -0
- package/_dist/write.d.ts.map +1 -0
- package/answer.js +110 -0
- package/answer.js.map +1 -0
- package/answer.ts +122 -0
- package/archetype.js +730 -0
- package/archetype.js.map +1 -0
- package/archetype.ts +790 -0
- package/binary_cases.ts +240 -0
- package/branches.js +195 -0
- package/branches.js.map +1 -0
- package/branches.ts +257 -0
- package/budget.js +89 -0
- package/budget.js.map +1 -0
- package/budget.ts +117 -0
- package/builtin.js +34 -0
- package/builtin.js.map +1 -0
- package/builtin.ts +31 -0
- package/bundle.js +21 -0
- package/bundle.js.map +1 -0
- package/bundle.ts +22 -0
- package/buried.js +95 -0
- package/buried.js.map +1 -0
- package/buried.ts +124 -0
- package/cache.js +153 -0
- package/cache.js.map +1 -0
- package/cache.ts +154 -0
- package/cache_worker.ts +16 -0
- package/catalog.js +173 -0
- package/catalog.js.map +1 -0
- package/catalog.ts +224 -0
- package/check.js +80 -0
- package/check.js.map +1 -0
- package/check.ts +92 -0
- package/checkpoint.js +98 -0
- package/checkpoint.js.map +1 -0
- package/checkpoint.ts +129 -0
- package/checkpoint_worker.ts +37 -0
- package/db.js +170 -0
- package/db.js.map +1 -0
- package/db.ts +173 -0
- package/ddl.js +1441 -0
- package/ddl.js.map +1 -0
- package/ddl.ts +1508 -0
- package/deno.json +1 -0
- package/doom.js +59 -0
- package/doom.js.map +1 -0
- package/doom.ts +75 -0
- package/driver.js +69 -0
- package/driver.js.map +1 -0
- package/driver.ts +101 -0
- package/error.js +30 -0
- package/error.js.map +1 -0
- package/error.ts +46 -0
- package/ffi/LICENSE +202 -0
- package/ffi/blob.js +99 -0
- package/ffi/blob.js.map +1 -0
- package/ffi/blob.ts +156 -0
- package/ffi/constants.js +65 -0
- package/ffi/constants.js.map +1 -0
- package/ffi/constants.ts +67 -0
- package/ffi/database.js +613 -0
- package/ffi/database.js.map +1 -0
- package/ffi/database.ts +931 -0
- package/ffi/ffi.js +535 -0
- package/ffi/ffi.js.map +1 -0
- package/ffi/ffi.ts +604 -0
- package/ffi/mod.js +15 -0
- package/ffi/mod.js.map +1 -0
- package/ffi/mod.ts +28 -0
- package/ffi/statement.js +555 -0
- package/ffi/statement.js.map +1 -0
- package/ffi/statement.ts +788 -0
- package/ffi/util.js +32 -0
- package/ffi/util.js.map +1 -0
- package/ffi/util.ts +48 -0
- package/follow.js +342 -0
- package/follow.js.map +1 -0
- package/follow.ts +401 -0
- package/history-branch.js +166 -0
- package/history-branch.js.map +1 -0
- package/history-branch.ts +140 -0
- package/history-shapes.js +254 -0
- package/history-shapes.js.map +1 -0
- package/history-shapes.ts +268 -0
- package/history.js +620 -0
- package/history.js.map +1 -0
- package/history.ts +674 -0
- package/inspect.js +120 -0
- package/inspect.js.map +1 -0
- package/inspect.ts +164 -0
- package/jsonb.js +73 -0
- package/jsonb.js.map +1 -0
- package/jsonb.ts +108 -0
- package/layout.js +22 -0
- package/layout.js.map +1 -0
- package/layout.ts +26 -0
- package/ledger.js +210 -0
- package/ledger.js.map +1 -0
- package/ledger.ts +210 -0
- package/legacy.js +4 -0
- package/legacy.js.map +1 -0
- package/legacy.ts +3 -0
- package/maintenance.js +148 -0
- package/maintenance.js.map +1 -0
- package/maintenance.ts +154 -0
- package/measure.js +133 -0
- package/measure.js.map +1 -0
- package/measure.ts +167 -0
- package/measure_worker.ts +18 -0
- package/memo.js +1250 -0
- package/memo.js.map +1 -0
- package/memo.ts +1480 -0
- package/meta.js +265 -0
- package/meta.js.map +1 -0
- package/meta.ts +321 -0
- package/migration.js +272 -0
- package/migration.js.map +1 -0
- package/migration.ts +286 -0
- package/mod.js +1103 -0
- package/mod.js.map +1 -0
- package/mod.ts +1762 -0
- package/mode.js +192 -0
- package/mode.js.map +1 -0
- package/mode.ts +207 -0
- package/native.js +544 -0
- package/native.js.map +1 -0
- package/native.ts +544 -0
- package/overlay.js +408 -0
- package/overlay.js.map +1 -0
- package/overlay.ts +485 -0
- package/owe.js +719 -0
- package/owe.js.map +1 -0
- package/owe.ts +873 -0
- package/package.json +99 -4
- package/physical.js +350 -0
- package/physical.js.map +1 -0
- package/physical.ts +434 -0
- package/plan.js +78 -0
- package/plan.js.map +1 -0
- package/plan.ts +104 -0
- package/point.js +81 -0
- package/point.js.map +1 -0
- package/point.ts +52 -0
- package/population.js +639 -0
- package/population.js.map +1 -0
- package/population.ts +630 -0
- package/purge.js +117 -0
- package/purge.js.map +1 -0
- package/purge.ts +127 -0
- package/raise.js +270 -0
- package/raise.js.map +1 -0
- package/raise.ts +316 -0
- package/read-db.js +381 -0
- package/read-db.js.map +1 -0
- package/read-db.ts +282 -0
- package/read-store.js +74 -0
- package/read-store.js.map +1 -0
- package/read-store.ts +86 -0
- package/read.js +1100 -0
- package/read.js.map +1 -0
- package/read.ts +1441 -0
- package/reader.js +141 -0
- package/reader.js.map +1 -0
- package/reader.ts +159 -0
- package/rules.js +88 -0
- package/rules.js.map +1 -0
- package/rules.ts +113 -0
- package/service.js +27 -0
- package/service.js.map +1 -0
- package/service.ts +41 -0
- package/shape.js +76 -0
- package/shape.js.map +1 -0
- package/shape.ts +108 -0
- package/sparse_presence_fixture.ts +45 -0
- package/sqlitepath.js +24 -0
- package/sqlitepath.js.map +1 -0
- package/sqlitepath.ts +29 -0
- package/statements.js +78 -0
- package/statements.js.map +1 -0
- package/statements.ts +96 -0
- package/survey.js +135 -0
- package/survey.js.map +1 -0
- package/survey.ts +196 -0
- package/tools.js +17 -0
- package/tools.js.map +1 -0
- package/tools.ts +50 -0
- package/trash.js +144 -0
- package/trash.js.map +1 -0
- package/trash.ts +187 -0
- package/unit.js +215 -0
- package/unit.js.map +1 -0
- package/unit.ts +211 -0
- package/versions.js +115 -0
- package/versions.js.map +1 -0
- package/versions.ts +110 -0
- package/vocab.js +19 -0
- package/vocab.js.map +1 -0
- package/vocab.json +27 -0
- package/vocab.ts +19 -0
- package/watch.js +33 -0
- package/watch.js.map +1 -0
- package/watch.ts +42 -0
- package/write.js +1164 -0
- package/write.js.map +1 -0
- package/write.ts +1356 -0
- package/written.js +200 -0
- package/written.js.map +1 -0
- package/written.ts +202 -0
package/_dist/owe.d.ts
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { type CreateIndex, type CreateTable, type CreateTrigger, type Driver, type Stmt } from "@yaks/sql/core";
|
|
2
|
+
import type { Filler } from "@yaks/fts";
|
|
3
|
+
import { type Refitting } from "./ddl.js";
|
|
4
|
+
/** The prefix of an owed piece of work's `server_meta` key. */ export declare let OWED: string;
|
|
5
|
+
/** The lease the process working owed work off holds. */ export declare let SCHEMA_DUTY: string;
|
|
6
|
+
/** A table holding this many rows gets a new index as owed work: on the
|
|
7
|
+
* box's copy an index over 10,000 rows builds in about 10 ms, and over its
|
|
8
|
+
* 4,057,139 `created` rows in 2.6 s. */ export declare let BIG: number;
|
|
9
|
+
/** The rows one window fills into a text index. Its time goes on the text,
|
|
10
|
+
* not the rows: on the box's copy, whose `entry_fts` bodies run about 5 KB,
|
|
11
|
+
* 1,000 rows took 164 ms a window and up to 515 ms, and its 356,025 rows
|
|
12
|
+
* take 39 s in one `rebuild`. */ export declare let FILL: number;
|
|
13
|
+
/** The text one window fills into a text index, past its first row: a
|
|
14
|
+
* substring index (@yaks/fts `contains`) takes about 190 ms a MiB, and 500 of
|
|
15
|
+
* the box's transcript texts held a window for up to 6.8 s. */ export declare let FILL_TEXT: any;
|
|
16
|
+
/** The rows one window copies into a table being rebuilt: 5.6 ms for 20,000
|
|
17
|
+
* of the box's `created`, whose rebuild in one unit holds the lock 10.2 s. */ export declare let COPY: number;
|
|
18
|
+
/** The rows one window deletes from a rebuilt table's old rows: about 65 ms
|
|
19
|
+
* on the box's copy. */ export declare let CLEAR: number;
|
|
20
|
+
/** The rows one window counts of a table whose statistics are its row count
|
|
21
|
+
* (./ddl.ts `counted`): one leaf page a row at worst, so 2 MB of the box's
|
|
22
|
+
* 4 KiB pages. On its 10 GB file under a load of 25, a window over a text
|
|
23
|
+
* index's data took 0.1 to 0.9 s, where `ANALYZE` read a whole table in one
|
|
24
|
+
* window and held the write lock 20.4 s (bug bace8585). */ export declare let COUNT: number;
|
|
25
|
+
/** The free pages a file keeps for its next writes to reuse; past these,
|
|
26
|
+
* {@link reclaim} gives the rest back. 64 MiB of the box's 4 KiB pages. */ export declare let SLACK: number;
|
|
27
|
+
/** The pages one window gives back: on a 660 MB file of 4 KiB pages with a
|
|
28
|
+
* third of its rows deleted in runs, 1,000 pages took 28 ms a window, and up
|
|
29
|
+
* to 176 ms with the checkpoint that followed. */ export declare let RECLAIM: number;
|
|
30
|
+
/** The sizes above as one value, which what chooses by them takes, so a
|
|
31
|
+
* test can shrink them instead of building the rows. */ export type Sizes = {
|
|
32
|
+
big: number;
|
|
33
|
+
fill: number;
|
|
34
|
+
fillText: number;
|
|
35
|
+
copy: number;
|
|
36
|
+
clear: number;
|
|
37
|
+
slack: number;
|
|
38
|
+
reclaim: number;
|
|
39
|
+
count: number;
|
|
40
|
+
};
|
|
41
|
+
export declare let SIZES: Sizes;
|
|
42
|
+
/** How long a window that failed waits before it is tried again. */ export declare let RETRY: number;
|
|
43
|
+
/** How often a file's upkeep ({@link Daily}) is done. */ export declare let DAY: number;
|
|
44
|
+
/** One piece of owed work. `error` and `next` are a failed window's: what it
|
|
45
|
+
* threw, and when it is tried again. */ export type Owed = {
|
|
46
|
+
name: string;
|
|
47
|
+
error?: string;
|
|
48
|
+
next?: string;
|
|
49
|
+
} & (/** an index over a table of {@link BIG} rows or more: SQLite builds an
|
|
50
|
+
* index in one statement, so this is the one window that holds the lock
|
|
51
|
+
* for seconds, off the opening path */ {
|
|
52
|
+
kind: 'index';
|
|
53
|
+
stmt: CreateIndex;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'fill';
|
|
56
|
+
source: string;
|
|
57
|
+
props: string[];
|
|
58
|
+
fields?: string[];
|
|
59
|
+
triggers: CreateTrigger[];
|
|
60
|
+
cursor: number;
|
|
61
|
+
} | {
|
|
62
|
+
kind: 'refit';
|
|
63
|
+
table: CreateTable;
|
|
64
|
+
cols: string[];
|
|
65
|
+
changed: Refitting['changed'];
|
|
66
|
+
after: Stmt[];
|
|
67
|
+
cursor: number;
|
|
68
|
+
} | {
|
|
69
|
+
kind: 'clear';
|
|
70
|
+
});
|
|
71
|
+
/** Write `work` down, replacing whatever was owed under its name. */ export declare let owe: (driver: Driver, work: Owed) => void;
|
|
72
|
+
/** Everything this file owes, in the order it is worked off, then by name. */ export declare let owed: (driver: Driver) => Owed[];
|
|
73
|
+
/** Whether `table` holds at least `n` rows, counting no further than that. */ export declare let holds: (driver: Driver, name: string, n: number) => boolean;
|
|
74
|
+
/** What is reported of a unique index the rows in its table break: it is not
|
|
75
|
+
* built, and the table serves without it. */ export declare let unbuilt: (s: CreateIndex, e: unknown) => Error;
|
|
76
|
+
/**
|
|
77
|
+
* Run `stmts` as `erect` does, owing each index a file lacks over a table of
|
|
78
|
+
* {@link BIG} rows or more instead of building it here. A new unique index the
|
|
79
|
+
* rows already in its table break is left unbuilt and returned, so the file
|
|
80
|
+
* opens with the shape it holds and the caller reports it; a failed statement
|
|
81
|
+
* undoes only itself, so the rest stands.
|
|
82
|
+
*/ export declare let build: (driver: Driver, stmts: readonly Stmt[], sizes?: Sizes, deferred?: boolean) => Error[];
|
|
83
|
+
/** What one call to {@link work} did: the work it finished or advanced, or
|
|
84
|
+
* the window that failed. */ export type Worked = {
|
|
85
|
+
name: string;
|
|
86
|
+
done: boolean;
|
|
87
|
+
} | {
|
|
88
|
+
name: string;
|
|
89
|
+
error: unknown;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Upkeep whoever tends a file does once a day, after what it owes: planner
|
|
93
|
+
* statistics ({@link statistics}) always, and what a host adds, the way the
|
|
94
|
+
* box checks that its text indexes hold every row (@yaks/fts `heal`). `run`
|
|
95
|
+
* is one window, in one unit. When each is next due is kept in `server_meta`
|
|
96
|
+
* as `daily:<name>`, with its `revision` after a `#`. One whose run changed
|
|
97
|
+
* what it decides raises its revision, so every store runs it at its next
|
|
98
|
+
* wake rather than up to a day after the deploy.
|
|
99
|
+
*/ export type Daily = {
|
|
100
|
+
name: string;
|
|
101
|
+
run: (driver: Driver) => void;
|
|
102
|
+
revision?: number;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Work a host's rows owe rather than its schema, found in them each time it
|
|
106
|
+
* is looked for: the box makes the pieces of its long texts' substring index
|
|
107
|
+
* this way (@yaks/fts `pieces`). `run` is one window, in one unit, and
|
|
108
|
+
* answers whether it found any to do. One that throws is put off an hour, as
|
|
109
|
+
* `chore:<name>` in `server_meta`.
|
|
110
|
+
*/ export type Chore = {
|
|
111
|
+
name: string;
|
|
112
|
+
run: (driver: Driver) => boolean;
|
|
113
|
+
};
|
|
114
|
+
/** Planner statistics (./ddl.ts `analyzed`): due once a day, and as soon as
|
|
115
|
+
* an index or a rebuilt table is in place, when the tables that lack them, or
|
|
116
|
+
* all that hold rows once the file has grown tenfold, are owed an analysis,
|
|
117
|
+
* which {@link work} does a table a window. */ export declare let statistics: Daily;
|
|
118
|
+
/** The `server_meta` key of {@link analyze}: when it is next tried, after a
|
|
119
|
+
* window that failed. */ export declare let ANALYZING: string;
|
|
120
|
+
/**
|
|
121
|
+
* Take one window of the statistics of the first table the receipt owes them,
|
|
122
|
+
* and answer how many stay owed; undefined when none is. A table that is
|
|
123
|
+
* counted (./ddl.ts `counted`) has `count` rows read in a snapshot, holding
|
|
124
|
+
* no lock, and the receipt written after in a unit of its own; any other is
|
|
125
|
+
* analyzed in its own unit.
|
|
126
|
+
*/ export declare let analyze: (driver: Driver, count?: number) => number | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Do one window, in one unit: of the first owed work that is due, else of
|
|
129
|
+
* the first of `chores` with work to do, else of the first table owed an
|
|
130
|
+
* analysis ({@link analyze}), else of giving free pages back
|
|
131
|
+
* ({@link reclaim}), else of the first of `daily` that is due. Undefined
|
|
132
|
+
* when nothing is. A window that throws leaves its work as it was, marked to
|
|
133
|
+
* be tried again in an hour, and says why.
|
|
134
|
+
*/ export declare let work: (driver: Driver, now?: number, daily?: Daily[], sizes?: Sizes, chores?: Chore[]) => Worked | undefined;
|
|
135
|
+
/** The `server_meta` key of {@link reclaim}: when it is next tried, after a
|
|
136
|
+
* window that failed. */ export declare let RECLAIMING: string;
|
|
137
|
+
/**
|
|
138
|
+
* Give back the free pages past {@link SLACK}, at most {@link RECLAIM} a
|
|
139
|
+
* window: SQLite moves pages from the end of the file into the free ones and
|
|
140
|
+
* cuts the end off, which the next checkpoint writes to the file. Only a file
|
|
141
|
+
* in incremental mode can (./db.ts `open`); one in another mode, or in
|
|
142
|
+
* memory, has nothing to give. Undefined when nothing is past the slack; one
|
|
143
|
+
* that throws is put off an hour.
|
|
144
|
+
*/ export declare let reclaim: (driver: Driver, now?: number, sizes?: Sizes) => Worked | undefined;
|
|
145
|
+
/** Do the first of `daily` that is due, and put it off a day; one that throws
|
|
146
|
+
* is put off an hour. Undefined when none is due. */ export declare let upkeep: (driver: Driver, daily: Daily[], now: number) => Worked | undefined;
|
|
147
|
+
/** The name a table is rebuilt under, and the name its old rows wait under
|
|
148
|
+
* to be cleared. Neither is a component table (./physical.ts). */ export declare let building: (comp: string) => string;
|
|
149
|
+
export declare let leaving: (comp: string) => string;
|
|
150
|
+
/**
|
|
151
|
+
* The {@link Filler} @yaks/fts `adopt` hands a new or changed text index to:
|
|
152
|
+
* on a file, an index whose content holds more than one window's rows is owed
|
|
153
|
+
* and filled {@link FILL} rows at a time; a smaller one is rebuilt at once.
|
|
154
|
+
*/ export declare let filler: (driver: Driver, sizes?: Sizes) => Filler;
|
|
155
|
+
/**
|
|
156
|
+
* Take on rebuilding `comp` as `r` says, on a file where it holds {@link BIG}
|
|
157
|
+
* rows or more: the table it is built as and the triggers keeping it in step,
|
|
158
|
+
* made now, and the copying owed. `after` is what to raise on the new table
|
|
159
|
+
* once it holds the name: the indexes and triggers the composed schema puts
|
|
160
|
+
* on it. A rebuild already under way to the same shape carries on, with this
|
|
161
|
+
* `after`; one to another shape is abandoned first. False where the table is
|
|
162
|
+
* small enough to rebuild at once.
|
|
163
|
+
*/ export declare let reshape: (driver: Driver, comp: string, r: Refitting, after: Stmt[], sizes?: Sizes) => boolean;
|
|
164
|
+
/** Give up every table rebuild owed but those of `kept`: a pass that took on
|
|
165
|
+
* no rebuild of a table found it fits its vocabulary again, or cannot be
|
|
166
|
+
* rebuilt (./ddl.ts `fit`). */ export declare let forgo: (driver: Driver, kept: Set<string>) => void;
|
|
167
|
+
/**
|
|
168
|
+
* Work off what this file owes, and do its upkeep, until `signal` aborts: a
|
|
169
|
+
* window, a pause as long as the window held the lock so other writers get
|
|
170
|
+
* their turn, and a look every `idle` milliseconds while nothing is due.
|
|
171
|
+
* `daily` is the host's upkeep beside the statistics, and `chores` the work
|
|
172
|
+
* its rows owe. A failed window is `report`ed and waits its hour.
|
|
173
|
+
*/ export declare let tend: (driver: Driver, opts: {
|
|
174
|
+
signal: AbortSignal;
|
|
175
|
+
report?: (error: unknown, work: string) => void;
|
|
176
|
+
idle?: number;
|
|
177
|
+
daily?: Daily[];
|
|
178
|
+
chores?: Chore[];
|
|
179
|
+
}) => Promise<void>;
|
|
180
|
+
//# sourceMappingURL=owe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owe.d.ts","sources":["../owe.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type Driver, type Param, type Row, type SchemaObject, type Stmt } from "@yaks/sql";
|
|
2
|
+
/** Whether a table is not the file's own: SQLite's catalogue, or one the host
|
|
3
|
+
* keeps inside it. A Durable Object's `_cf_KV` and `_cf_METADATA` are listed
|
|
4
|
+
* by `table_list` like any other, and workerd's authorizer refuses every
|
|
5
|
+
* statement naming them, a pragma included, with SQLITE_AUTH (T-34019). */ export declare let foreign: (name: string) => boolean;
|
|
6
|
+
type MainTable = {
|
|
7
|
+
name: string;
|
|
8
|
+
type: unknown;
|
|
9
|
+
withoutRowid: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** The main schema's tables under the names statements write them by. */ export declare let mainTables: (driver: Driver) => readonly MainTable[];
|
|
12
|
+
/** The main schema's tables as the file names them. */ export declare let storedTables: (driver: Driver) => string[];
|
|
13
|
+
/** Every table the file's schema lists, with the statement it was made by. */ export declare let defined: Stmt;
|
|
14
|
+
/** Every table the file's schema lists, by name. */ export declare let tables: (driver: Driver) => string[];
|
|
15
|
+
/** A table as the file holds it: its columns (`pragma table_info`), the
|
|
16
|
+
* columns it keys to another table, and what each column checks
|
|
17
|
+
* ({@link checks}). */ export type Stood = {
|
|
18
|
+
cols: Row[];
|
|
19
|
+
keys: string[];
|
|
20
|
+
checks: Record<string, string>;
|
|
21
|
+
};
|
|
22
|
+
/** What is asked of each table `names` names: its columns, then its keys. */ export declare let asked: (names: string[]) => Stmt[];
|
|
23
|
+
/** The answers to {@link asked}, as each table's {@link Stood}. `defs` is what
|
|
24
|
+
* {@link defined} answered. */ export declare let heard: (defs: Row[], names: string[], answers: Row[][]) => Record<string, Stood>;
|
|
25
|
+
/** Each table `pick` keeps, as the file holds it now, read through a driver
|
|
26
|
+
* that answers at once. */ export declare let stood: (driver: Driver, pick: (name: string) => boolean) => Record<string, Stood>;
|
|
27
|
+
/** Every name and keyword a definition says, as SQLite compares them: what
|
|
28
|
+
* tells which tables and columns an index, a trigger or a view names. */ export declare let words: (sql: string) => Set<string>;
|
|
29
|
+
/**
|
|
30
|
+
* What a table's definition checks, by the column each check sits on (a table
|
|
31
|
+
* constraint's under `''`): the expression as its tokens compare, so one check
|
|
32
|
+
* reads the same however it was spaced, cased or quoted. Read off the statement
|
|
33
|
+
* `sqlite_schema` keeps, because SQLite lists a table's columns and keys by
|
|
34
|
+
* pragma and has no pragma for a check.
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { assertEquals } from '@std/assert'
|
|
38
|
+
* import { checks } from '@yaks/sqlite'
|
|
39
|
+
*
|
|
40
|
+
* let kind = { kind: "kind in ( 'A' , 'b' )" }
|
|
41
|
+
* assertEquals(
|
|
42
|
+
* checks(`CREATE TABLE "t" (id integer, "kind" text check("kind" in ('A', 'b')))`),
|
|
43
|
+
* kind,
|
|
44
|
+
* )
|
|
45
|
+
* assertEquals(checks(`create table t (Kind TEXT CHECK (kind IN ('A','b')))`), kind)
|
|
46
|
+
* assertEquals(checks(`create table t (id integer, check (id > 0))`), {
|
|
47
|
+
* '': 'id > 0',
|
|
48
|
+
* })
|
|
49
|
+
* assertEquals(checks(`create table t (id integer)`), {})
|
|
50
|
+
* ```
|
|
51
|
+
*/ export declare let checks: (sql: string) => Record<string, string>;
|
|
52
|
+
/**
|
|
53
|
+
* The columns a table's own definition holds in place, which SQLite refuses
|
|
54
|
+
* to drop: one its definition makes a key or unique, and every one a table
|
|
55
|
+
* constraint names. A column whose own check is all that names it drops with
|
|
56
|
+
* its check.
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { assertEquals } from '@std/assert'
|
|
60
|
+
* import { pinned } from '@yaks/sqlite'
|
|
61
|
+
*
|
|
62
|
+
* let held = pinned(`create table t (entity integer primary key,
|
|
63
|
+
* "Slug" text unique, a text, b text check (b > ''), c text, check (a > ''))`)
|
|
64
|
+
* assertEquals(
|
|
65
|
+
* ['entity', 'slug', 'a', 'b', 'c'].filter((c) => held.has(c)),
|
|
66
|
+
* ['entity', 'slug', 'a'],
|
|
67
|
+
* )
|
|
68
|
+
* ```
|
|
69
|
+
*/ export declare let pinned: (sql: string) => Set<string>;
|
|
70
|
+
/** What the file's schema holds — each table, index, view and trigger, with
|
|
71
|
+
* the table it is on and its definition — or the entries these fields name. */ export declare let objects: (driver: Driver, fields?: Record<string, Param>) => SchemaObject[];
|
|
72
|
+
/** Whether the spine keeps `num` unique by itself, as every spine made
|
|
73
|
+
* before series had letters did (`num integer unique`). */ export declare let sole: (driver: Driver) => boolean;
|
|
74
|
+
/** A table's columns, in declaration order. */ export declare let columns: (driver: Driver, name: string) => string[];
|
|
75
|
+
/** A table's columns, in declaration order, given the statement the file's
|
|
76
|
+
* schema keeps for it (@yaks/sql `catalogue`): asked of the engine once a
|
|
77
|
+
* statement. */ export declare let columnsBy: (driver: Driver, name: string, sql: string | null | undefined) => readonly string[];
|
|
78
|
+
export declare let required: (driver: Driver, name: string) => string[];
|
|
79
|
+
export declare function componentTables(driver: Driver, known?: readonly string[], candidates?: readonly string[]): string[];
|
|
80
|
+
/**
|
|
81
|
+
* How many of the named objects the file's schema holds and how long their
|
|
82
|
+
* definitions run together, in characters: what moves when one of them is
|
|
83
|
+
* created, dropped or altered, by any connection (a file's revision sees
|
|
84
|
+
* another connection's). Read off `sqlite_schema`, since a Durable Object's
|
|
85
|
+
* SQLite refuses `pragma schema_version`. Only the named objects count, so
|
|
86
|
+
* what is kept beside them (a search index and its triggers, a plugin's own
|
|
87
|
+
* table, the `sqlite_stat1` the first analyze creates) is no change to them.
|
|
88
|
+
*/ export declare let shape: (driver: Driver, names: readonly string[]) => string;
|
|
89
|
+
//# sourceMappingURL=physical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physical.d.ts","sources":["../physical.ts"],"names":[],"mappings":"AASA,SAEE,KAAK,MAAM,EAEX,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,YAAY,EAEjB,KAAK,IAAI,yBAGkB;AAE7B;;;yEAGyE,GACzE,OAAO,YAAI,UAAW,MAAM,MAAM,KAAG,OAAO,CAAkC;KAEzE;EAAc,MAAM,MAAM;EAAE,MAAM,OAAO;EAAE,cAAc,OAAO;;AAuBrE,uEAAuE,GACvE,OAAO,YAAI,aAAc,QAAQ,oBAAkB,YAWlD;AAED,qDAAqD,GACrD,OAAO,YAAI,eAAgB,QAAQ,WAAS,MAAM,GACR;AAE1C,4EAA4E,GAC5E,OAAO,YAAI,SAAS,KAKlB;AAOF,kDAAkD,GAClD,OAAO,YAAI,SAAU,QAAQ,WAAS,MAAM,GACT;AAEnC;;qBAEqB,GACrB,YAAY;EACV,MAAM;EACN,MAAM,MAAM;EACZ,QAAQ,OAAO,MAAM,EAAE,MAAM;;AAG/B,2EAA2E,GAC3E,OAAO,YAAI,QAAS,OAAO,MAAM,OAAK,OAIlC;AAEJ;6BAC6B,GAC7B,OAAO,YAAI,QACT,MAAM,OACN,OAAO,MAAM,IACb,SAAS,YACR,OAAO,MAAM,EAAE,OAKZ;AAEN;yBACyB,GACzB,OAAO,YAAI,QACT,QAAQ,QACR,OAAO,MAAM,MAAM,KAAK,OAAO,KAC9B,OAAO,MAAM,EAAE,OAIjB;AAYD;uEACuE,GACvE,OAAO,YAAI,QAAS,KAAK,MAAM,KAAG,IAAI,MAAM,EACC;AA+C7C;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,YAAI,SAAU,KAAK,MAAM,KAAG,OAAO,MAAM,EAAE,MAAM,EAavD;AAED;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,YAAI,SAAU,KAAK,MAAM,KAAG,IAAI,MAAM,EAS1C;AAEH;6EAC6E,GAC7E,OAAO,YAAI,UACT,QAAQ,QACR,SAAQ,OAAO,MAAM,EAAE,WACtB,eAGA;AAEH;yDACyD,GACzD,OAAO,YAAI,OAAQ,QAAQ,WAAS,OAAO,CAUrC;AAEN,6CAA6C,GAC7C,OAAO,YAAI,UAAW,QAAQ,QAAQ,MAAM,MAAM,KAAG,MAAM,GAE5B;AAQ/B;;cAEc,GACd,OAAO,YAAI,YACT,QAAQ,QACR,MAAM,MAAM,EACZ,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,cACpB,MAAM,GAUjB;AAUD,OAAO,YAAI,WAAY,QAAQ,QAAQ,MAAM,MAAM,KAAG,MAAM,GAiB3D;AA8BD,OAAO,iBAAS,gBACd,QAAQ,MAAM,EACd,iBAAgB,MAAM,EAAO,EAC7B,sBAAsB,MAAM,EAAE,GAC7B,MAAM;AA+CT;;;;;;;;CAQC,GACD,OAAO,YAAI,QAAS,QAAQ,QAAQ,gBAAgB,MAAM,OAAK,MAAM,CAKpE"}
|
package/_dist/point.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Write } from "@yaks/sql";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
/** Classification for a deferred adapter that already knows each whole shape,
|
|
4
|
+
* each descriptor written by the identities of `vocab`, the one the adapter's
|
|
5
|
+
* statements are written with. These statements belong in the same batch as
|
|
6
|
+
* the rows they describe. */ export declare let pointSql: (shapes: {
|
|
7
|
+
eid: string;
|
|
8
|
+
tables: string[];
|
|
9
|
+
}[], vocab?: Vocab) => Write[];
|
|
10
|
+
//# sourceMappingURL=point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.d.ts","sources":["../point.ts"],"names":[],"mappings":"AACA,SAAkD,KAAK,KAAK,yBAA8B;AAC1F,cAAc,KAAK,2BAAgC;AAGnD;;;2BAG2B,GAC3B,OAAO,YAAI,WACT;EAAU,KAAK,MAAM;EAAE,QAAQ,MAAM;KACrC,QAAQ,UACP,QAuCF"}
|
package/_dist/raise.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Driver, type Stmt } from "@yaks/sql/core";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
/** The revision of when a component's objects are made: part of every
|
|
4
|
+
* store's print (./plan.ts), so code that made them all at install finds a
|
|
5
|
+
* store this code made as one it never installed, and makes them. */ export declare let RAISED: number;
|
|
6
|
+
/** Whether `comp`'s table waits for the first write that names it. */ export declare let lazy: (vocab: Vocab, comp: string) => boolean;
|
|
7
|
+
/** The component tables each of `stmts` rests on, in order: the ones it
|
|
8
|
+
* names, and the ones every object it names that another of `stmts` makes
|
|
9
|
+
* rests on. */ export declare let rests: (vocab: Vocab, stmts: readonly Stmt[]) => string[][];
|
|
10
|
+
/** Record the component tables the file holds now, in its receipt: what an
|
|
11
|
+
* install does once its tables stand. */ export declare let recorded: (driver: Driver) => void;
|
|
12
|
+
/** The components of `vocab` whose table waits for a first write. */ export declare let unraised: (driver: Driver, vocab: Vocab) => string[];
|
|
13
|
+
/** The tables of `vocab` this file holds. */ export declare let stood: (driver: Driver, vocab: Vocab) => string[];
|
|
14
|
+
/** Those of `stmts` that rest on no table this file lacks, as its schema
|
|
15
|
+
* says: what an install makes, before any receipt is recorded. */ export declare let holds: (driver: Driver, vocab: Vocab, stmts: readonly Stmt[]) => Stmt[];
|
|
16
|
+
/**
|
|
17
|
+
* Make the tables of `comps` this file lacks, and every one of `stmts` that
|
|
18
|
+
* rests on one of them and on no table still missing, in their order. Answers
|
|
19
|
+
* the components it made a table for. Run it in the transaction of the write
|
|
20
|
+
* that names them, before that write.
|
|
21
|
+
*/ export declare let raise: (driver: Driver, vocab: Vocab, comps: Iterable<string>, stmts: readonly Stmt[]) => string[];
|
|
22
|
+
//# sourceMappingURL=raise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raise.d.ts","sources":["../raise.ts"],"names":[],"mappings":"AAsBA,SAGE,KAAK,MAAM,EAGX,KAAK,IAAI,8BACuB;AAElC,cAAc,KAAK,2BAAgC;AAKnD;;mEAEmE,GACnE,OAAO,YAAI,eAAU;AAOrB,oEAAoE,GACpE,OAAO,YAAI,OAAQ,OAAO,OAAO,MAAM,MAAM,KAAG,OAAO,CAErC;AAoElB;;aAEa,GACb,OAAO,YAAI,QAAS,OAAO,OAAO,gBAAgB,WAAS,MAAM,KA6BhE;AAmBD;uCACuC,GACvC,OAAO,YAAI,WAAY,QAAQ,WAAS,IAAI,CAO3C;AAmDD,mEAAmE,GACnE,OAAO,YAAI,WAAY,QAAQ,QAAQ,OAAO,UAAQ,MAAM,GAC1B;AAElC,2CAA2C,GAC3C,OAAO,YAAI,QAAS,QAAQ,QAAQ,OAAO,UAAQ,MAAM,GAC1B;AAE/B;gEACgE,GAChE,OAAO,YAAI,QACT,QAAQ,QACR,OAAO,OACP,gBAAgB,WACf,OAKF;AAoCD;;;;;CAKC,GACD,OAAO,YAAI,QACT,QAAQ,QACR,OAAO,OACP,OAAO,SAAS,MAAM,GACtB,gBAAgB,WACf,MAAM,GAqBR"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Opened } from "./db.js";
|
|
2
|
+
/** Whether this process's SQLite library can load extensions. A connection
|
|
3
|
+
* offers `extension` only where it can, so storage on a library without it
|
|
4
|
+
* (macOS's own) has no vector facility rather than failing to open. */ export declare let loadable: () => boolean;
|
|
5
|
+
/** Open an existing SQLite file for reading, without changing journal
|
|
6
|
+
* settings or attempting a checkpoint when its last reader closes. Queries
|
|
7
|
+
* use the same SQL AST, snapshots and tracing as the writable driver, and every
|
|
8
|
+
* row decoded counts against the read running (./budget.ts). */ export declare let open: (path: string) => Opened;
|
|
9
|
+
//# sourceMappingURL=read-db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-db.d.ts","sources":["../read-db.ts"],"names":[],"mappings":"AAKA,cAAc,MAAM,kBAAiB;AAgFrC;;qEAEqE,GACrE,OAAO,YAAI,gBAAe,OAAO,CAAsC;AAWvE;;;8DAG8D,GAC9D,OAAO,YAAI,OAAQ,MAAM,MAAM,KAAG,OAkLjC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type BindOpts, type Driver } from "@yaks/sql";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
import type { Store } from "./mod.js";
|
|
4
|
+
import type { History } from "./history.js";
|
|
5
|
+
/** Bind every committed-store capability without admitting write callbacks.
|
|
6
|
+
* Index plugins receive the same statement, revision and schema descriptions
|
|
7
|
+
* as a writable store; the database driver enforces statement read-onlyness. */ export declare let storage: (driver: Driver, vocab: Vocab, base?: BindOpts & {
|
|
8
|
+
history?: History;
|
|
9
|
+
}) => Store;
|
|
10
|
+
//# sourceMappingURL=read-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-store.d.ts","sources":["../read-store.ts"],"names":[],"mappings":"AAGA,SAAS,KAAK,QAAQ,EAAE,KAAK,MAAM,yBAA8C;AACjF,cAAc,KAAK,2BAAgC;AAEnD,cAAc,KAAK,mBAAkB;AAarC,cAAc,OAAO,uBAAsB;AAI3C;;8EAE8E,GAC9E,OAAO,YAAI,UACT,QAAQ,QACR,OAAO,OACP,OAAM;EAAa,UAAU;MAC5B,MAuDF"}
|
package/_dist/read.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type And } from "@yaks/query/core";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
import { type BindOpts, type Derived, type Driver, type Expr, type Query as Sub, type Row, type Select } from "@yaks/sql/query";
|
|
4
|
+
import type { Bundle } from "./bundle.js";
|
|
5
|
+
export type Query = string | And;
|
|
6
|
+
export declare let rows: (driver: Driver, vocab: Vocab, query: Query, opts?: BindOpts) => Row[];
|
|
7
|
+
export declare let compSql: (v: Vocab, comp: string, eid: string, derived?: Derived) => Select;
|
|
8
|
+
/**
|
|
9
|
+
* The column a set-shaped read keys its rows by. Not a component prop — a prop
|
|
10
|
+
* is an identifier, so nothing in a vocabulary can collide with it.
|
|
11
|
+
*/ export declare let OWNER: string;
|
|
12
|
+
/**
|
|
13
|
+
* The same read widened from one entity to a set: every entity `owners` names,
|
|
14
|
+
* each row carrying its owner's eid under {@link OWNER}. `owners` is a query
|
|
15
|
+
* selecting one `eid` column.
|
|
16
|
+
*
|
|
17
|
+
* This is what makes a whole read one round trip over a remote database
|
|
18
|
+
* (@yaks/d1 `wholeSql`): the hits are named by the query that found them
|
|
19
|
+
* instead of by eids a first trip had to go and fetch.
|
|
20
|
+
*/ export declare let setSql: (v: Vocab, comp: string, owners: Sub, derived?: Derived) => Select;
|
|
21
|
+
export declare let spine: (vocab: Vocab, which: Expr, kind?: boolean) => Select;
|
|
22
|
+
/**
|
|
23
|
+
* Identity, not search: these entities as they stand. A tombstoned one comes
|
|
24
|
+
* back carrying `tombstone` (it is still an identity, just a deleted one); an
|
|
25
|
+
* eid no entity has is simply absent. Each carries the components `comps`
|
|
26
|
+
* names, and no other table is read; left out, it carries every one. This is
|
|
27
|
+
* the read `apply()` uses for its precondition guard, where a query would be
|
|
28
|
+
* the wrong question.
|
|
29
|
+
*
|
|
30
|
+
* Each entity is read from the tables its archetype names, and no table is
|
|
31
|
+
* asked whether it holds one. `unsettled` speaks for the entities whose
|
|
32
|
+
* pointer does not say what they hold ({@link Unsettled}); an entity it cannot
|
|
33
|
+
* speak for either is a failure, and the read throws {@link Unpointed}.
|
|
34
|
+
*/ export type ReadCache = {
|
|
35
|
+
fetch: (eids: string[], comps?: string[]) => Bundle[];
|
|
36
|
+
/** the eids a scope admits, and where `graves` asks, the deleted it sees
|
|
37
|
+
* (@yaks/sql `ghostly`), which only `run`'s statement judges */ permit: (eids: string[], components: string[], run: () => Row[], graves?: boolean) => Row[];
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Who says what an entity holds where its stored pointer does not: the
|
|
41
|
+
* store's open transaction, which wrote rows the pointer has not been moved
|
|
42
|
+
* for yet (./archetype.ts `ledger`), or a connection reading another time than
|
|
43
|
+
* the pointer speaks of (./mode.ts).
|
|
44
|
+
*/ export type Unsettled = {
|
|
45
|
+
/** Whether `eid`'s pointer is behind what the entity holds. */ wrote: (eid: string) => boolean;
|
|
46
|
+
/** The tables each of these entities holds among `names`, by its id, given
|
|
47
|
+
* the ones its pointer names (null where it names none). One it cannot
|
|
48
|
+
* speak for is left out. */ held: (rows: {
|
|
49
|
+
eid: string;
|
|
50
|
+
id: number;
|
|
51
|
+
pointed: readonly string[] | null;
|
|
52
|
+
}[], names: readonly string[]) => Map<number, readonly string[]>;
|
|
53
|
+
};
|
|
54
|
+
export declare let get: (driver: Driver, vocab: Vocab, eids: string[], opts?: BindOpts, comps?: string[], unsettled?: Unsettled, cache?: ReadCache, answered?: boolean) => Bundle[];
|
|
55
|
+
/** The tag a computed component's eids end with in a store: the store's epoch
|
|
56
|
+
* and the component, hashed (@yaks/sql `eidOf`) — so a record's eid names it
|
|
57
|
+
* in this store and no other. */ export declare let tagOf: (epoch: string, comp: string) => string;
|
|
58
|
+
export declare let read: (driver: Driver, vocab: Vocab, query: Query, opts?: BindOpts, comps?: string[], ask?: (query: And) => Row[], fetch?: (eids: string[], comps?: string[], answered?: boolean) => Bundle[], unsettled?: Unsettled) => Bundle[];
|
|
59
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sources":["../read.ts"],"names":[],"mappings":"AA4BA,SAAS,KAAK,GAAG,gCAAiD;AAClE,cAAoB,KAAK,2BAAgC;AACzD,SAME,KAAK,QAAQ,EAKb,KAAK,OAAO,EAEZ,KAAK,MAAM,EAMX,KAAK,IAAI,EAWT,KAAK,SAAS,GAAG,EAIjB,KAAK,GAAG,EAER,KAAK,MAAM,+BAcsB;AACnC,cAAc,MAAM,sBAA2B;AAU/C,YAAY,QAAQ,MAAM,GAAG;AAQ7B,OAAO,YAAI,OACT,QAAQ,QACR,OAAO,OACP,OAAO,OACP,OAAM,aACL,MAkEF;AA+RD,OAAO,YAAI,UACT,GAAG,OACH,MAAM,MAAM,EACZ,KAAK,MAAM,EACX,UAAS,YACR,OAOA;AAEH;;;CAGC,GACD,OAAO,YAAI,cAAc;AAEzB;;;;;;;;CAQC,GACD,OAAO,YAAI,SACT,GAAG,OACH,MAAM,MAAM,EACZ,QAAQ,KACR,UAAS,YACR,OAOA;AAmCH,OAAO,YAAI,QAAS,OAAO,OAAO,OAAO,MAAM,mBAAe,OA4B7D;AAiVD;;;;;;;;;;;;CAYC,GACD,YAAY;EACV,QAAQ,MAAM,MAAM,IAAI,QAAQ,MAAM,OAAO;EAC7C;gEAC8D,GAC9D,SACE,MAAM,MAAM,IACZ,YAAY,MAAM,IAClB,WAAW,OACX,SAAS,OAAO,KACb;;AAGP;;;;;CAKC,GACD,YAAY;EACV,6DAA6D,GAC7D,QAAQ,KAAK,MAAM,KAAK,OAAO;EAC/B;;4BAE0B,GAC1B,OACE;IAAQ,KAAK,MAAM;IAAE,IAAI,MAAM;IAAE,kBAAkB,MAAM,KAAK,IAAI;OAClE,gBAAgB,MAAM,OACnB,IAAI,MAAM,WAAW,MAAM;;AA4BlC,OAAO,YAAI,MACT,QAAQ,QACR,OAAO,OACP,MAAM,MAAM,IACZ,OAAM,UACN,QAAQ,MAAM,IACd,YAAY,WACZ,QAAQ,WACR,uBACC,SA6WF;AAmCD;;+BAE+B,GAC/B,OAAO,YAAI,QAAS,OAAO,MAAM,EAAE,MAAM,MAAM,KAAG,MAAM,CACf;AA8BzC,OAAO,YAAI,OACT,QAAQ,QACR,OAAO,OACP,OAAO,OACP,OAAM,UACN,QAAQ,MAAM,IACd,OAAM,OAAO,QAAQ,OACrB,SAAS,MAAM,MAAM,IAAI,QAAQ,MAAM,IAAI,WAAW,OAAO,KAAK,UAClE,YAAY,cACX,SAsBF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type BindOpts, type Driver } from "@yaks/sql";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
import type { Store } from "./mod.js";
|
|
4
|
+
/** Read against the physical schema of this snapshot, not the one that was
|
|
5
|
+
* standing when the command started. Never repair an older vocabulary's
|
|
6
|
+
* dropped columns or indices: another process may have retired them. */ export declare let options: <T extends BindOpts & {
|
|
7
|
+
deferred?: boolean;
|
|
8
|
+
}>(driver: Driver, vocab: Vocab, base: T) => () => T;
|
|
9
|
+
/** Read an already-installed database. No schema is created or repaired, and
|
|
10
|
+
* no mutation methods are exposed. Each operation sees one committed snapshot. */ export declare let reader: (driver: Driver, vocab: Vocab, base?: BindOpts) => Pick<Store, 'read' | 'rows' | 'get'>;
|
|
11
|
+
//# sourceMappingURL=reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reader.d.ts","sources":["../reader.ts"],"names":[],"mappings":"AAGA,SAEE,KAAK,QAAQ,EAEb,KAAK,MAAM,yBAIgB;AAC7B,cAAc,KAAK,2BAAgC;AACnD,cAAc,KAAK,mBAAkB;AASrC;;sEAEsE,GACtE,OAAO,YAAI,UAAW,UAAU;EAAa,WAAW,OAAO;GAC7D,QAAQ,QACR,OAAO,OACP,MAAM,YACC,EAuER;AAoBD;gFACgF,GAChF,OAAO,YAAI,SACT,QAAQ,QACR,OAAO,OACP,OAAM,aACL,KAAK,OAAO,SAAS,SAAS,OAgChC"}
|
package/_dist/rules.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Vocab } from "@yaks/vocab";
|
|
2
|
+
import type { Binding, Bundle, Match } from "@yaks/graph";
|
|
3
|
+
import { type BindOpts, type Cte, type Driver, type On } from "@yaks/sql";
|
|
4
|
+
/**
|
|
5
|
+
* Run a compiled match and read its rows back as bindings. The statement is
|
|
6
|
+
* the one above; what makes it report on a batch is the overlay under it
|
|
7
|
+
* (./overlay.ts), not anything here.
|
|
8
|
+
*/ export declare let matched: (driver: Driver, m: Match, vocab: Vocab, opts?: BindOpts, on?: On, over?: Cte[]) => Binding[];
|
|
9
|
+
/**
|
|
10
|
+
* How declared rules are evaluated (@yaks/graph `Tx.bindings`): run every match
|
|
11
|
+
* against this graph with `batch` folded in.
|
|
12
|
+
*
|
|
13
|
+
* One overlay for the whole set — `covers` is what the rules read — and then
|
|
14
|
+
* one statement per flat match or collection level under it. The overlay is a
|
|
15
|
+
* `with` prefix, so it costs
|
|
16
|
+
* nothing to build and nothing to tear down: every statement here simply
|
|
17
|
+
* carries it.
|
|
18
|
+
*/ export declare let bindings: (driver: Driver, vocab: Vocab, matches: Match[], bundles: Bundle[], covers: string[], opts?: BindOpts) => Binding[][];
|
|
19
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sources":["../rules.ts"],"names":[],"mappings":"AASA,cAAc,KAAK,2BAAgC;AACnD,cAAc,OAAO,EAAE,MAAM,EAAE,KAAK,2BAAgC;AAEpE,SACE,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,MAAM,EACX,KAAK,EAAE,yBAGoB;AAI7B;;;;CAIC,GACD,OAAO,YAAI,UACT,QAAQ,QACR,GAAG,OACH,OAAO,OACP,OAAM,UACN,KAAI,IACJ,OAAM,UACL,UA8BC;AAEJ;;;;;;;;;CASC,GACD,OAAO,YAAI,WACT,QAAQ,QACR,OAAO,OACP,SAAS,SACT,SAAS,UACT,QAAQ,MAAM,IACd,OAAM,aACL,YA4BF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Cache, trim } from "./cache.js";
|
|
2
|
+
export type Options = {
|
|
3
|
+
/** Database paths, each with its byte budget and table-to-file-URL-column map. */ caches?: Record<string, Cache>;
|
|
4
|
+
/** Milliseconds between passes; defaults to one hour. */ every?: number;
|
|
5
|
+
};
|
|
6
|
+
/** Maintain configured caches until the host stops. Each failure reaches the
|
|
7
|
+
* host's telemetry and leaves the next pass able to try again. */ export declare let service: (host: {
|
|
8
|
+
report?: (error: unknown, context?: {
|
|
9
|
+
tags?: Record<string, string>;
|
|
10
|
+
}) => unknown;
|
|
11
|
+
}, options?: Options, signal?: AbortSignal, maintain?: typeof trim) => Promise<void>;
|
|
12
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sources":["../service.ts"],"names":[],"mappings":"AAIA,SAAS,KAAK,KAAK,EAAY,IAAI,qBAAoB;AAEvD,YAAY;EACV,gFAAgF,GAChF,SAAS,OAAO,MAAM,EAAE;EACxB,uDAAuD,GACvD,QAAQ,MAAM;;AAGhB;gEACgE,GAChE,OAAO,YAAI,UACT;EACE,UACE,OAAO,OAAO,EACd;IAAY,OAAO,OAAO,MAAM,EAAE,MAAM;QACrC,OAAO;GAEd,UAAS,SACT,SAAQ,aACR,kBAAiB,SAChB,QAAQ,IAAI,EAed"}
|
package/_dist/shape.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Vocab } from "@yaks/vocab";
|
|
2
|
+
import { type Driver } from "@yaks/sql/core";
|
|
3
|
+
/** The vocabulary as a database keeps its words. An expand release keeps
|
|
4
|
+
* an existing label layout until the migration moves it in one transaction. */ export declare let layoutOf: (v: Vocab, tables: readonly string[]) => Vocab;
|
|
5
|
+
/** The columns a word's table holds in this file, by label, or none where
|
|
6
|
+
* the file never raised it. `v` declares the word, though the connection may
|
|
7
|
+
* be bound to words that do not (a retired word a move still reads): its
|
|
8
|
+
* table is found by the word's identity, or by its label in a file laid out
|
|
9
|
+
* before identities. */ export declare let wordColumns: (driver: Driver, v: Vocab, comp: string) => string[];
|
|
10
|
+
/** Bind the vocabulary for all statements on this connection. */ export declare let bindStorage: (driver: Driver, v: Vocab) => Vocab;
|
|
11
|
+
/** Whether a vocabulary can distinguish the two layouts. */ export declare let identified: (v: Vocab) => boolean;
|
|
12
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sources":["../shape.ts"],"names":[],"mappings":"AAKA,SAAsB,KAAK,KAAK,2BAAgC;AAChE,SAEE,KAAK,MAAM,8BAMqB;AAKlC;6EAC6E,GAC7E,OAAO,YAAI,WAAY,GAAG,OAAO,iBAAiB,MAAM,OAAK,MAKtD;AAEP;;;;sBAIsB,GACtB,OAAO,YAAI,cACT,QAAQ,QACR,GAAG,OACH,MAAM,MAAM,KACX,MAAM,GAOR;AAED,+DAA+D,GAC/D,OAAO,YAAI,cAAe,QAAQ,QAAQ,GAAG,UAAQ,MAapD;AAED,0DAA0D,GAC1D,OAAO,YAAI,aAAc,GAAG,UAAQ,OAAO,CAM1C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Driver, type Statements } from "@yaks/sql";
|
|
2
|
+
/** The platform library's path, only when the name resolves to a local file. */ export declare let vectorPath: (resolve?: (specifier: string) => string) => string | undefined;
|
|
3
|
+
/** One stable capability per connection, sharing the graph's transaction. */ export declare let statements: (driver: Driver) => Statements;
|
|
4
|
+
//# sourceMappingURL=statements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statements.d.ts","sources":["../statements.ts"],"names":[],"mappings":"AAGA,SAEE,KAAK,MAAM,EAGX,KAAK,UAAU,yBAEY;AAY7B,8EAA8E,GAC9E,OAAO,YAAI,aACT,WAAU,WAAW,MAAM,KAAK,MAAM,KACrC,MAAM,GAAG,SAAS,CAuBpB;AAED,2EAA2E,GAC3E,OAAO,YAAI,aAAc,QAAQ,WAAS,WA4CzC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Derived, type Driver } from "@yaks/sql";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
/** What a look at a file finds against a vocabulary's schema. */ export type Survey = {
|
|
4
|
+
/** each stored property, as `comp.prop`, whose column the file's table
|
|
5
|
+
* lacks */ lacking: string[];
|
|
6
|
+
/** each component whose table the file lacks */ absent: string[];
|
|
7
|
+
/** each declared index the file lacks */ unindexed: string[];
|
|
8
|
+
/** each of the spine, the graves and the component tables whose writes the
|
|
9
|
+
* log does not follow */ unlogged: string[];
|
|
10
|
+
};
|
|
11
|
+
/** What a reader binds over the file: the survey's properties, read as never
|
|
12
|
+
* given. */ export declare let lacked: (vocab: Vocab, survey: Pick<Survey, 'lacking'>) => Derived;
|
|
13
|
+
/** What a reader asks of the file itself: its tables, columns and indexes,
|
|
14
|
+
* and not the log's triggers. */ export declare let glance: (driver: Driver, vocab: Vocab, derived?: Derived) => Omit<Survey, 'unlogged'>;
|
|
15
|
+
/** The file looked at, all of it. */ export declare let look: (driver: Driver, vocab: Vocab, derived?: Derived) => Survey;
|
|
16
|
+
/** The survey the file holds of this vocabulary's schema, where it was taken
|
|
17
|
+
* at the version the schema stands at now; undefined where there is none, or
|
|
18
|
+
* the schema has moved since. Read in the snapshot it is asked in. */ export declare let surveyed: (driver: Driver, vocab: Vocab, derived?: Derived) => Survey | undefined;
|
|
19
|
+
/** Record what a look at the file finds against this vocabulary's schema,
|
|
20
|
+
* for every opener after this one. Nothing where the file is in memory, or
|
|
21
|
+
* holds a survey of the schema as it stands. */ export declare let survey: (driver: Driver, vocab: Vocab, derived?: Derived) => void;
|
|
22
|
+
/** What a look found, `before`, across the tables a write just raised
|
|
23
|
+
* (./raise.ts): `raised` no longer absent, nor the indexes made with them. A
|
|
24
|
+
* table raised is made whole, its indexes and the log's triggers with it, so
|
|
25
|
+
* nothing else the look found moves. Its indexes kept missing, every read of
|
|
26
|
+
* the component was planned as though it had none: a person's messages walked
|
|
27
|
+
* every titled row for the few knocks a seek of `knock.target` reads (bug
|
|
28
|
+
* 73244693). */ export declare let raisedOver: <T extends Omit<Survey, 'unlogged'>>(driver: Driver, before: T, raised: readonly string[]) => T;
|
|
29
|
+
/** Keep the survey the file holds standing across the tables a write just
|
|
30
|
+
* raised ({@link raisedOver}). Nothing where there was no survey to keep. */ export declare let raisedSurvey: (driver: Driver, vocab: Vocab, derived: Derived | undefined, before: Survey | undefined, raised: readonly string[]) => void;
|
|
31
|
+
//# sourceMappingURL=survey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"survey.d.ts","sources":["../survey.ts"],"names":[],"mappings":"AAoBA,SAEE,KAAK,OAAO,EACZ,KAAK,MAAM,yBAIgB;AAC7B,cAAc,KAAK,2BAAgC;AASnD,+DAA+D,GAC/D,YAAY;EACV;WACS,GACT,SAAS,MAAM;EACf,8CAA8C,GAC9C,QAAQ,MAAM;EACd,uCAAuC,GACvC,WAAW,MAAM;EACjB;yBACuB,GACvB,UAAU,MAAM;;AAMlB;UACU,GACV,OAAO,YAAI,SACT,OAAO,OACP,QAAQ,KAAK,QAAQ,eACpB,QAKE;AAEL;+BAC+B,GAC/B,OAAO,YAAI,SACT,QAAQ,QACR,OAAO,OACP,UAAU,YACT,KAAK,QAAQ,YAUf;AAED,mCAAmC,GACnC,OAAO,YAAI,OACT,QAAQ,QACR,OAAO,OACP,UAAU,YACT,OAGD;AAsBF;;oEAEoE,GACpE,OAAO,YAAI,WACT,QAAQ,QACR,OAAO,OACP,UAAU,YACT,SAAS,SAAS,CAYpB;AAED;;8CAE8C,GAC9C,OAAO,YAAI,SACT,QAAQ,QACR,OAAO,OACP,UAAU,YACT,IAAI,CAaN;AAED;;;;;;cAMc,GACd,OAAO,YAAI,aAAc,UAAU,KAAK,QAAQ,aAC9C,QAAQ,QACR,QAAQ,GACR,iBAAiB,MAAM,OACtB,EAQF;AAED;2EAC2E,GAC3E,OAAO,YAAI,eACT,QAAQ,QACR,OAAO,OACP,SAAS,UAAU,SAAS,EAC5B,QAAQ,SAAS,SAAS,EAC1B,iBAAiB,MAAM,OACtB,IAAI,CASN"}
|
package/_dist/tools.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Runs } from "@yaks/graph/tools";
|
|
2
|
+
import type { Finding } from "@yaks/tools";
|
|
3
|
+
/** What configuration this package's checks accept. */ export type Options = {
|
|
4
|
+
/** how many drifted entities to name (default 12) */ sample?: number;
|
|
5
|
+
};
|
|
6
|
+
/** The implementations behind the tools ./vocab.json declares, using the
|
|
7
|
+
* calling application's bound storage diagnostics. */ export declare let runs: (host: {
|
|
8
|
+
storage: {
|
|
9
|
+
checks?: {
|
|
10
|
+
storage(): Finding[];
|
|
11
|
+
archetypes(sample: number): Finding[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}, options?: Options) => Runs;
|
|
15
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sources":["../tools.ts"],"names":[],"mappings":"AAIA,cAAc,IAAI,iCAAsC;AACxD,cAAc,OAAO,2BAAgC;AAGrD,qDAAqD,GACrD,YAAY;EACV,mDAAmD,GACnD,SAAS,MAAM;;AAWjB;oDACoD,GACpD,OAAO,YAAI,OACT;EACE;IACE;MACE,WAAW;MACX,WAAW,QAAQ,MAAM,GAAG;;;GAIlC,UAAS,YACR,KAeD"}
|
package/_dist/trash.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Delete, type Driver, type Insert, type Row, type Select } from "@yaks/sql";
|
|
2
|
+
import type { Bundle } from "@yaks/graph";
|
|
3
|
+
import { type Trash, type TrashPage } from "@yaks/graph/trash";
|
|
4
|
+
import type { Vocab } from "@yaks/vocab";
|
|
5
|
+
export declare let TRASH: string;
|
|
6
|
+
type RetainedBody = {
|
|
7
|
+
id: number;
|
|
8
|
+
body: string;
|
|
9
|
+
};
|
|
10
|
+
/** Walk before-images in bounded pages for an in-place security rewrite. */ export declare let retainedBodies: (driver: Driver, after: number, limit: number) => RetainedBody[];
|
|
11
|
+
/** A replacement keeps the identity, batch and date of the before-image. */ export declare let rewriteRetained: (driver: Driver, was: RetainedBody, body: string) => void;
|
|
12
|
+
/** Save each row once per destructive transaction. */ export declare let retainSql: (id: string, at: string, bundles: Bundle[]) => Insert[];
|
|
13
|
+
/** Select every snapshot in a retained transaction touching these identities. */ export declare let trashSql: (eids?: string[], page?: TrashPage) => Select;
|
|
14
|
+
/** Decode retained transactions, preserving binary properties. */ export declare let trashRows: (vocab: Vocab, rows: Row[]) => Trash[];
|
|
15
|
+
/** Retained transactions touching an identity, newest first. */ export declare let trashed: (driver: Driver, vocab: Vocab, eids?: string[], page?: TrashPage) => Trash[];
|
|
16
|
+
/** Erase one retained transaction, called only for a deliberate trash purge. */ export declare let purgeTrashSql: (id: string | string[]) => Delete;
|
|
17
|
+
/** Cleanup candidates still held by retained before-images. */ export declare let trashTargetsSql: (eids: string[]) => Select;
|
|
18
|
+
//# sourceMappingURL=trash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trash.d.ts","sources":["../trash.ts"],"names":[],"mappings":"AAEA,SAME,KAAK,MAAM,EAEX,KAAK,MAAM,EAOX,KAAK,MAAM,EAKX,KAAK,GAAG,EACR,KAAK,MAAM,yBAKgB;AAC7B,cAAc,MAAM,2BAAgC;AACpD,SAAS,KAAK,KAAK,EAAc,KAAK,SAAS,iCAAsC;AACrF,cAAc,KAAK,2BAAgC;AAGnD,OAAO,YAAI,cAAqB;KAE3B;EAAiB,IAAI,MAAM;EAAE,MAAM,MAAM;;AAE9C,0EAA0E,GAC1E,OAAO,YAAI,iBACT,QAAQ,QACR,OAAO,MAAM,EACb,OAAO,MAAM,KACZ,eAO2D;AAE9D,0EAA0E,GAC1E,OAAO,YAAI,kBACT,QAAQ,QACR,KAAK,cACL,MAAM,MAAM,KACX,IAAI,CAMH;AAEJ,oDAAoD,GACpD,OAAO,YAAI,YAAa,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,SAAS,aAAW,SAiBhE;AAEJ,+EAA+E,GAC/E,OAAO,YAAI,WAAY,OAAO,MAAM,IAAI,OAAM,cAAiB,OAkD9D;AAED,gEAAgE,GAChE,OAAO,YAAI,YAAa,OAAO,OAAO,MAAM,UAAQ,QASnD;AAED,8DAA8D,GAC9D,OAAO,YAAI,UACT,QAAQ,QACR,OAAO,OACP,OAAO,MAAM,IACb,OAAO,cACN,QAC6E;AAEhF,8EAA8E,GAC9E,OAAO,YAAI,gBAAiB,IAAI,MAAM,GAAG,MAAM,OAAK,OAWlD;AAEF,6DAA6D,GAC7D,OAAO,YAAI,kBAAmB,MAAM,MAAM,OAAK,OAY3C"}
|
package/_dist/unit.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Driver } from "@yaks/sql";
|
|
2
|
+
/** Whether this async context owns the connection's active transaction. */ export declare let owned: (driver: Driver) => boolean;
|
|
3
|
+
/** Independent asynchronous transactions on one connection take turns.
|
|
4
|
+
* Only calls within the owning body's async context may open savepoints;
|
|
5
|
+
* otherwise an unrelated write could commit inside a transaction that later
|
|
6
|
+
* rolls back. The uncontended synchronous path stays synchronous. */ export declare let exclusive: <R>(driver: Driver, body: () => R) => R | Promise<Awaited<R>>;
|
|
7
|
+
export declare let unit: <R>(driver: Driver, body: () => R, mode?: 'write' | 'read', _dts_1: never) => R;
|
|
8
|
+
/** `body` with this connection's busy wait at nothing: a lock another
|
|
9
|
+
* connection holds refuses it at once, for work that can be left to later
|
|
10
|
+
* rather than waited for. */ export declare let unwaiting: <R>(driver: Driver, body: () => R) => R;
|
|
11
|
+
//# sourceMappingURL=unit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit.d.ts","sources":["../unit.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,yBAA6C;AAUjE,yEAAyE,GACzE,OAAO,YAAI,QAAS,QAAQ,WAAS,OAAO,CAGzC;AAEH;;;mEAGmE,GACnE,OAAO,YAAI,YAAa,GACtB,QAAQ,QACR,YAAY,MACX,IAAI,QAAQ,QAAQ,IAyBtB;AAoDD,OAAO,YAAI,OAAQ,GACjB,QAAQ,QACR,YAAY,GACZ,OAAM,UAAU,QAChB,kBAMC,EAsFF;AAED;;2BAE2B,GAC3B,OAAO,YAAI,YAAa,GAAG,QAAQ,QAAQ,YAAY,MAAI,EAS1D"}
|
package/_dist/vocab.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VocabDoc } from "@yaks/vocab";
|
|
2
|
+
/** The tool declarations this plugin contributes. */ export declare let sqliteDoc: VocabDoc;
|
|
3
|
+
/** What this package is: its manifest's description, the one place it is
|
|
4
|
+
* written, which a host stamps on each document here. */ export declare let description: string;
|
|
5
|
+
/** Every document this plugin declares. */ export declare let docs: VocabDoc[];
|
|
6
|
+
//# sourceMappingURL=vocab.d.ts.map
|