@bjornpagen/bumbledb 0.2.0 → 0.3.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/COOKBOOK.md +462 -406
- package/README.md +66 -31
- package/dist/closed.d.ts +121 -25
- package/dist/closed.d.ts.map +1 -1
- package/dist/closed.js +108 -42
- package/dist/closed.js.map +1 -1
- package/dist/db.d.ts +12 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +20 -5
- package/dist/db.js.map +1 -1
- package/dist/face.d.ts +100 -55
- package/dist/face.d.ts.map +1 -1
- package/dist/face.js +36 -10
- package/dist/face.js.map +1 -1
- package/dist/fields.d.ts +50 -79
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +20 -53
- package/dist/fields.js.map +1 -1
- package/dist/index.d.ts +17 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/law.d.ts +224 -0
- package/dist/law.d.ts.map +1 -0
- package/dist/law.js +224 -0
- package/dist/law.js.map +1 -0
- package/dist/lower.d.ts +17 -10
- package/dist/lower.d.ts.map +1 -1
- package/dist/lower.js +34 -23
- package/dist/lower.js.map +1 -1
- package/dist/native.d.ts +6 -2
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js.map +1 -1
- package/dist/query/atom.d.ts +88 -50
- package/dist/query/atom.d.ts.map +1 -1
- package/dist/query/atom.js +4 -1
- package/dist/query/atom.js.map +1 -1
- package/dist/query/lower.d.ts +71 -56
- package/dist/query/lower.d.ts.map +1 -1
- package/dist/query/lower.js +90 -43
- package/dist/query/lower.js.map +1 -1
- package/dist/query/predicate.d.ts +10 -9
- package/dist/query/predicate.d.ts.map +1 -1
- package/dist/query/predicate.js +2 -2
- package/dist/query/predicate.js.map +1 -1
- package/dist/query/scope.d.ts +76 -41
- package/dist/query/scope.d.ts.map +1 -1
- package/dist/query/scope.js +77 -30
- package/dist/query/scope.js.map +1 -1
- package/dist/query/select.d.ts +5 -5
- package/dist/query/select.d.ts.map +1 -1
- package/dist/relation.d.ts +21 -8
- package/dist/relation.d.ts.map +1 -1
- package/dist/relation.js +13 -7
- package/dist/relation.js.map +1 -1
- package/dist/schema.d.ts +41 -3
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +16 -2
- package/dist/schema.js.map +1 -1
- package/dist/spec.d.ts +7 -6
- package/dist/spec.d.ts.map +1 -1
- package/dist/spec.js.map +1 -1
- package/dist/statements.d.ts +61 -31
- package/dist/statements.d.ts.map +1 -1
- package/dist/statements.js +22 -17
- package/dist/statements.js.map +1 -1
- package/package.json +2 -2
- package/src/closed.ts +243 -68
- package/src/db.ts +23 -5
- package/src/face.ts +162 -84
- package/src/fields.ts +57 -136
- package/src/index.ts +42 -16
- package/src/law.ts +519 -0
- package/src/lower.ts +36 -23
- package/src/native.ts +6 -2
- package/src/query/atom.ts +105 -58
- package/src/query/lower.ts +271 -139
- package/src/query/predicate.ts +43 -33
- package/src/query/scope.ts +125 -49
- package/src/query/select.ts +5 -5
- package/src/relation.ts +15 -9
- package/src/schema.ts +48 -7
- package/src/spec.ts +7 -6
- package/src/statements.ts +83 -43
package/src/fields.ts
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Field descriptors — the value half of the `schema!` field grammar
|
|
3
|
-
* (`docs/architecture/70-api.md`),
|
|
3
|
+
* (`docs/architecture/70-api.md`), MINIMAL edition: `bool`, `u64`, `i64`,
|
|
4
4
|
* `str`, `bytes(n)`, `interval(u64|i64[, width])`, each a plain frozen value
|
|
5
|
-
* that IS its own descriptor type — `{ kind,
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `.fresh` exists only on u64 (bare or after `.as`), and no field-level
|
|
17
|
-
* constraint vocabulary of any kind exists — `unique`/`fk` are unwritable,
|
|
18
|
-
* not rejected.
|
|
5
|
+
* that IS its own descriptor type — `{ kind, width?, element?, fresh? }` —
|
|
6
|
+
* honest at runtime and in the type alike. A field's VALUE type is its bare
|
|
7
|
+
* structural type (`u64` → `bigint`, `str` → `string`, `bytes(n)` →
|
|
8
|
+
* `Uint8Array`, intervals → `{ start, end }`): no brands, no phantoms, no
|
|
9
|
+
* minting casts. A descriptor carries STRUCTURE ONLY — domains are never
|
|
10
|
+
* declared anywhere (the owner ruling: THE LAWS TYPE THE COLUMNS): a
|
|
11
|
+
* field's domain is COMPUTED by `schema()` from the statement list, where
|
|
12
|
+
* the dependencies themselves induce the equivalence classes. The macro's
|
|
13
|
+
* refusals are reproduced representationally: `.fresh` exists only on u64,
|
|
14
|
+
* and no field-level constraint vocabulary of any kind exists —
|
|
15
|
+
* `unique`/`fk` are unwritable, not rejected.
|
|
19
16
|
*/
|
|
20
17
|
|
|
21
18
|
import * as errors from "@superbuilders/errors"
|
|
@@ -23,8 +20,8 @@ import type { LiteralSpec } from "#spec.ts"
|
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
* A half-open interval `[start, end)` as a plain value object — the ONE
|
|
26
|
-
* interval value type, whatever the field's element
|
|
27
|
-
* The ray is representable (`end` = the element
|
|
23
|
+
* interval value type, whatever the field's element type or width label.
|
|
24
|
+
* The ray is representable (`end` = the element type's MAX_END); widths
|
|
28
25
|
* and signedness are NOT modeled on the value — they are descriptor-type
|
|
29
26
|
* labels the engine judges at the typed write boundary. Interval fields
|
|
30
27
|
* derive no order (the Rust refusal, `docs/architecture/10-data-model.md`),
|
|
@@ -52,68 +49,52 @@ function span(start: bigint, end: bigint): IntervalValue {
|
|
|
52
49
|
/**
|
|
53
50
|
* A closed relation's roster as seen from a referencing field: the handle
|
|
54
51
|
* namespace `where()` selections and ground axioms resolve bare handle ids
|
|
55
|
-
* through (the macro's own rule: a handle is legal exactly on a field
|
|
56
|
-
*
|
|
52
|
+
* through (the macro's own rule: a handle is legal exactly on a field that
|
|
53
|
+
* references a closed relation).
|
|
57
54
|
*/
|
|
58
55
|
interface ClosedRoster {
|
|
59
56
|
readonly name: string
|
|
60
57
|
readonly handles: readonly string[]
|
|
61
58
|
}
|
|
62
59
|
|
|
63
|
-
/** The `bool` field descriptor: value type `boolean`. No `.
|
|
60
|
+
/** The `bool` field descriptor: value type `boolean`. No `.fresh` (macro parity). */
|
|
64
61
|
interface BoolField {
|
|
65
62
|
readonly kind: "bool"
|
|
66
|
-
readonly domain: undefined
|
|
67
63
|
}
|
|
68
64
|
|
|
69
|
-
/** The `str` field descriptor: value type `string`. No `.
|
|
65
|
+
/** The `str` field descriptor: value type `string`. No `.fresh` (macro parity). */
|
|
70
66
|
interface StrField {
|
|
71
67
|
readonly kind: "str"
|
|
72
|
-
readonly domain: undefined
|
|
73
68
|
}
|
|
74
69
|
|
|
75
70
|
/**
|
|
76
|
-
* A `fresh`-marked u64 field descriptor — `id: u64.
|
|
77
|
-
* (
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* (`
|
|
81
|
-
*
|
|
71
|
+
* A `fresh`-marked u64 field descriptor — `id: u64.fresh`. The mark is a
|
|
72
|
+
* structural label (`fresh: true`) in the descriptor type AND on the
|
|
73
|
+
* runtime value; it implies the key `R(field) -> R`, which the ENGINE
|
|
74
|
+
* materializes (`SchemaDescriptor::materialized_statements`), and it makes
|
|
75
|
+
* the field a GENERATOR — `schema()` names its equivalence class by the
|
|
76
|
+
* declaration coordinate (`"Account.id"`). Terminal: no builder property
|
|
77
|
+
* survives the mark.
|
|
82
78
|
*/
|
|
83
|
-
interface FreshU64Field
|
|
79
|
+
interface FreshU64Field {
|
|
84
80
|
readonly kind: "u64"
|
|
85
|
-
readonly domain: Domain
|
|
86
81
|
readonly fresh: true
|
|
87
82
|
}
|
|
88
83
|
|
|
89
84
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* descriptor
|
|
93
|
-
*
|
|
94
|
-
* on an unmarked descriptor it holds the marked descriptor, on a marked
|
|
95
|
-
* one it IS the literal `true` (one structural property, read either way).
|
|
85
|
+
* The `u64` field descriptor. `.fresh` marks the field as engine-minted —
|
|
86
|
+
* the property doubles as the mark itself: on an unmarked descriptor it
|
|
87
|
+
* holds the marked descriptor, on a marked one it IS the literal `true`
|
|
88
|
+
* (one structural property, read either way).
|
|
96
89
|
*/
|
|
97
|
-
interface U64Field
|
|
90
|
+
interface U64Field {
|
|
98
91
|
readonly kind: "u64"
|
|
99
|
-
readonly
|
|
100
|
-
readonly fresh: FreshU64Field<Domain>
|
|
92
|
+
readonly fresh: FreshU64Field
|
|
101
93
|
}
|
|
102
94
|
|
|
103
|
-
/** The `
|
|
104
|
-
interface
|
|
105
|
-
as<const Domain extends string>(domain: Domain): U64Field<Domain>
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** A domain-labeled i64 field descriptor. Terminal: `.fresh` is legal on u64 only. */
|
|
109
|
-
interface I64Field<Domain extends string | undefined = undefined> {
|
|
95
|
+
/** The `i64` field descriptor. Terminal: `.fresh` is legal on u64 only. */
|
|
96
|
+
interface I64Field {
|
|
110
97
|
readonly kind: "i64"
|
|
111
|
-
readonly domain: Domain
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/** The `i64` constructor value: a bare i64 descriptor plus `.as`. */
|
|
115
|
-
interface I64Ctor extends I64Field<undefined> {
|
|
116
|
-
as<const Domain extends string>(domain: Domain): I64Field<Domain>
|
|
117
98
|
}
|
|
118
99
|
|
|
119
100
|
/**
|
|
@@ -122,15 +103,9 @@ interface I64Ctor extends I64Field<undefined> {
|
|
|
122
103
|
* value type is bare `Uint8Array`. No order is derived — no comparators
|
|
123
104
|
* exist on the value type (the engine refuses order on bytes).
|
|
124
105
|
*/
|
|
125
|
-
interface BytesField<Width extends number = number
|
|
106
|
+
interface BytesField<Width extends number = number> {
|
|
126
107
|
readonly kind: "bytes"
|
|
127
108
|
readonly width: Width
|
|
128
|
-
readonly domain: Domain
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/** A `bytes(n)` constructor value: a bare bytes descriptor plus `.as`. */
|
|
132
|
-
interface BytesCtor<Width extends number = number> extends BytesField<Width, undefined> {
|
|
133
|
-
as<const Domain extends string>(domain: Domain): BytesField<Width, Domain>
|
|
134
109
|
}
|
|
135
110
|
|
|
136
111
|
/**
|
|
@@ -141,52 +116,32 @@ interface BytesCtor<Width extends number = number> extends BytesField<Width, und
|
|
|
141
116
|
*/
|
|
142
117
|
interface IntervalField<
|
|
143
118
|
Element extends "u64" | "i64" = "u64" | "i64",
|
|
144
|
-
Width extends bigint | undefined = bigint | undefined
|
|
145
|
-
Domain extends string | undefined = undefined
|
|
119
|
+
Width extends bigint | undefined = bigint | undefined
|
|
146
120
|
> {
|
|
147
121
|
readonly kind: "interval"
|
|
148
122
|
readonly element: Element
|
|
149
123
|
readonly width: Width
|
|
150
|
-
readonly domain: Domain
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/** An `interval(e[, w])` constructor value: a bare interval descriptor plus `.as`. */
|
|
154
|
-
interface IntervalCtor<
|
|
155
|
-
Element extends "u64" | "i64" = "u64" | "i64",
|
|
156
|
-
Width extends bigint | undefined = bigint | undefined
|
|
157
|
-
> extends IntervalField<Element, Width, undefined> {
|
|
158
|
-
as<const Domain extends string>(domain: Domain): IntervalField<Element, Width, Domain>
|
|
159
124
|
}
|
|
160
125
|
|
|
161
126
|
/**
|
|
162
127
|
* A closed relation's reference field descriptor (`Kind.id`) — a u64
|
|
163
|
-
* descriptor
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
128
|
+
* descriptor carrying the closed linkage: the roster resolves bare handle
|
|
129
|
+
* ids in selections and ground axioms, and `schema()` names the id's
|
|
130
|
+
* generator class `"Kind.id"`. Terminal: no `.fresh` — a vocabulary's rows
|
|
131
|
+
* are ground axioms, never minted.
|
|
167
132
|
*/
|
|
168
|
-
interface ClosedIdField
|
|
133
|
+
interface ClosedIdField {
|
|
169
134
|
readonly kind: "u64"
|
|
170
|
-
readonly domain: Domain
|
|
171
135
|
readonly closed: ClosedRoster
|
|
172
136
|
}
|
|
173
137
|
|
|
174
|
-
/** Any field descriptor, whatever its kind
|
|
175
|
-
type AnyField =
|
|
176
|
-
| BoolField
|
|
177
|
-
| StrField
|
|
178
|
-
| U64Field<string | undefined>
|
|
179
|
-
| FreshU64Field<string | undefined>
|
|
180
|
-
| I64Field<string | undefined>
|
|
181
|
-
| BytesField<number, string | undefined>
|
|
182
|
-
| IntervalField<"u64" | "i64", bigint | undefined, string | undefined>
|
|
183
|
-
| ClosedIdField
|
|
138
|
+
/** Any field descriptor, whatever its kind or marks. */
|
|
139
|
+
type AnyField = BoolField | StrField | U64Field | FreshU64Field | I64Field | BytesField | IntervalField | ClosedIdField
|
|
184
140
|
|
|
185
141
|
/**
|
|
186
142
|
* The bare structural VALUE type of a field descriptor — the one total
|
|
187
143
|
* definition every fact, result row, and query term reads: `bool` →
|
|
188
|
-
* `boolean`, `str` → `string`, `u64`/`i64` → `bigint`
|
|
189
|
-
* included — the label never touches the value), `bytes<N>` →
|
|
144
|
+
* `boolean`, `str` → `string`, `u64`/`i64` → `bigint`, `bytes<N>` →
|
|
190
145
|
* `Uint8Array`, intervals → {@link IntervalValue}.
|
|
191
146
|
*/
|
|
192
147
|
type Infer<F extends AnyField> = F extends { readonly kind: "bool" }
|
|
@@ -271,35 +226,20 @@ function assertDeclarationOrderKey(where: string, name: string): void {
|
|
|
271
226
|
}
|
|
272
227
|
}
|
|
273
228
|
|
|
274
|
-
/**
|
|
275
|
-
|
|
276
|
-
return Object.freeze({ kind: "u64", domain, fresh: true })
|
|
277
|
-
}
|
|
229
|
+
/** The one fresh-marked u64 descriptor (the `.fresh` property of the unmarked one). */
|
|
230
|
+
const freshU64: FreshU64Field = Object.freeze({ kind: "u64", fresh: true })
|
|
278
231
|
|
|
279
232
|
/** The one `u64` constructor value. */
|
|
280
|
-
const u64:
|
|
281
|
-
kind: "u64",
|
|
282
|
-
domain: undefined,
|
|
283
|
-
fresh: freshU64(undefined),
|
|
284
|
-
as<const Domain extends string>(domain: Domain): U64Field<Domain> {
|
|
285
|
-
return Object.freeze({ kind: "u64", domain, fresh: freshU64(domain) })
|
|
286
|
-
}
|
|
287
|
-
})
|
|
233
|
+
const u64: U64Field = Object.freeze({ kind: "u64", fresh: freshU64 })
|
|
288
234
|
|
|
289
235
|
/** The one `i64` constructor value. */
|
|
290
|
-
const i64:
|
|
291
|
-
kind: "i64",
|
|
292
|
-
domain: undefined,
|
|
293
|
-
as<const Domain extends string>(domain: Domain): I64Field<Domain> {
|
|
294
|
-
return Object.freeze({ kind: "i64", domain })
|
|
295
|
-
}
|
|
296
|
-
})
|
|
236
|
+
const i64: I64Field = Object.freeze({ kind: "i64" })
|
|
297
237
|
|
|
298
238
|
/** The one `bool` constructor value. */
|
|
299
|
-
const bool: BoolField = Object.freeze({ kind: "bool"
|
|
239
|
+
const bool: BoolField = Object.freeze({ kind: "bool" })
|
|
300
240
|
|
|
301
241
|
/** The one `str` constructor value. */
|
|
302
|
-
const str: StrField = Object.freeze({ kind: "str"
|
|
242
|
+
const str: StrField = Object.freeze({ kind: "str" })
|
|
303
243
|
|
|
304
244
|
/**
|
|
305
245
|
* The `bytes<N>` field constructor. The width is mandatory and a
|
|
@@ -308,20 +248,13 @@ const str: StrField = Object.freeze({ kind: "str", domain: undefined })
|
|
|
308
248
|
* § the `schema!` grammar: N ∈ 1..=64 — bare `bytes` does not parse), the
|
|
309
249
|
* macro-expansion boundary's analog being construction.
|
|
310
250
|
*/
|
|
311
|
-
function bytes<const Width extends number>(width: Width):
|
|
251
|
+
function bytes<const Width extends number>(width: Width): BytesField<Width> {
|
|
312
252
|
if (!Number.isInteger(width) || width < 1 || width > 64) {
|
|
313
253
|
throw errors.new(
|
|
314
254
|
`bytes width must be an integer in 1..=64 (got ${width}) — docs/architecture/70-api.md pins the range at declaration`
|
|
315
255
|
)
|
|
316
256
|
}
|
|
317
|
-
return Object.freeze({
|
|
318
|
-
kind: "bytes",
|
|
319
|
-
width,
|
|
320
|
-
domain: undefined,
|
|
321
|
-
as<const Domain extends string>(domain: Domain): BytesField<Width, Domain> {
|
|
322
|
-
return Object.freeze({ kind: "bytes", width, domain })
|
|
323
|
-
}
|
|
324
|
-
})
|
|
257
|
+
return Object.freeze({ kind: "bytes", width })
|
|
325
258
|
}
|
|
326
259
|
|
|
327
260
|
/**
|
|
@@ -333,12 +266,12 @@ function bytes<const Width extends number>(width: Width): BytesCtor<Width> {
|
|
|
333
266
|
* (`docs/architecture/70-api.md`: w ≥ 1; `interval<u64, 0>` is an
|
|
334
267
|
* expansion error naming the field).
|
|
335
268
|
*/
|
|
336
|
-
function interval<Element extends
|
|
337
|
-
function interval<Element extends
|
|
269
|
+
function interval<Element extends U64Field | I64Field>(element: Element): IntervalField<Element["kind"], undefined>
|
|
270
|
+
function interval<Element extends U64Field | I64Field, const Width extends bigint>(
|
|
338
271
|
element: Element,
|
|
339
272
|
width: Width
|
|
340
|
-
):
|
|
341
|
-
function interval(element:
|
|
273
|
+
): IntervalField<Element["kind"], Width>
|
|
274
|
+
function interval(element: U64Field | I64Field, width?: bigint): IntervalField<"u64" | "i64", bigint | undefined> {
|
|
342
275
|
const elementKind = element.kind
|
|
343
276
|
if (elementKind !== "u64" && elementKind !== "i64") {
|
|
344
277
|
throw errors.new(`interval element must be the u64 or i64 field constructor (got ${elementKind})`)
|
|
@@ -348,15 +281,7 @@ function interval(element: U64Ctor | I64Ctor, width?: bigint): IntervalCtor<"u64
|
|
|
348
281
|
`interval width must be >= 1 (got ${width}) — docs/architecture/70-api.md pins w >= 1 at declaration`
|
|
349
282
|
)
|
|
350
283
|
}
|
|
351
|
-
return Object.freeze({
|
|
352
|
-
kind: "interval",
|
|
353
|
-
element: elementKind,
|
|
354
|
-
width,
|
|
355
|
-
domain: undefined,
|
|
356
|
-
as<const Domain extends string>(domain: Domain): IntervalField<"u64" | "i64", bigint | undefined, Domain> {
|
|
357
|
-
return Object.freeze({ kind: "interval", element: elementKind, width, domain })
|
|
358
|
-
}
|
|
359
|
-
})
|
|
284
|
+
return Object.freeze({ kind: "interval", element: elementKind, width })
|
|
360
285
|
}
|
|
361
286
|
|
|
362
287
|
/**
|
|
@@ -411,19 +336,15 @@ function literalOf(field: AnyField, value: unknown): LiteralSpec {
|
|
|
411
336
|
export type {
|
|
412
337
|
AnyField,
|
|
413
338
|
BoolField,
|
|
414
|
-
BytesCtor,
|
|
415
339
|
BytesField,
|
|
416
340
|
ClosedIdField,
|
|
417
341
|
ClosedRoster,
|
|
418
342
|
FreshU64Field,
|
|
419
|
-
I64Ctor,
|
|
420
343
|
I64Field,
|
|
421
344
|
Infer,
|
|
422
|
-
IntervalCtor,
|
|
423
345
|
IntervalField,
|
|
424
346
|
IntervalValue,
|
|
425
347
|
StrField,
|
|
426
|
-
U64Ctor,
|
|
427
348
|
U64Field
|
|
428
349
|
}
|
|
429
350
|
export { assertDeclarationOrderKey, bool, bytes, i64, interval, literalOf, span, str, u64 }
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @bjornpagen/bumbledb — the type-theoretic TypeScript SDK for the
|
|
3
3
|
* bumbledb embedded relational engine. Public surface: the structural type
|
|
4
|
-
* kernel (fields
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
4
|
+
* kernel (fields as pure structure, `relation()`, `closed()` — domains are
|
|
5
|
+
* never declared: THE LAWS TYPE THE COLUMNS, `schema()` computing every
|
|
6
|
+
* field's equivalence class FROM the statement list at both tiers), the
|
|
7
|
+
* statement algebra with `schema()` and `SchemaSpec` lowering (PRD-06), the `Db`
|
|
7
8
|
* runtime (path-cached stores, transactions, typed violations, scoped
|
|
8
9
|
* snapshot reads, the witnessed write loop with `abandon` — PRD-07, zero
|
|
9
10
|
* closables), the query surface (Datalog as values, kysely-shaped:
|
|
10
11
|
* `query(S).rule(r => r.match(...).where(...).select(...))` with
|
|
11
12
|
* string-named domain-typed vars, params typed by use, negation,
|
|
12
13
|
* conditions, aggregates, and stratified recursion via `program()`/`rec` —
|
|
13
|
-
* `db.prepare` as a plain value
|
|
14
|
+
* `db.prepare` as a plain value; the comparison/connective builders are
|
|
15
|
+
* also free exports, and the free names `eq`/`not`/`and`/`or` collide with
|
|
16
|
+
* common host identifiers — import aliasing is the answer; the SDK does
|
|
17
|
+
* not rename for collision-avoidance), and the exhume surface
|
|
14
18
|
* (`Db.exhume` — the one schema-independent read path: the store's
|
|
15
19
|
* self-described shapes and raw facts by name, typed at bare structural
|
|
16
20
|
* values, deliberately schema-free). The raw native bridge is not exported.
|
|
@@ -18,6 +22,7 @@
|
|
|
18
22
|
|
|
19
23
|
export type {
|
|
20
24
|
AnyClosed,
|
|
25
|
+
AnySelectedClosed,
|
|
21
26
|
AxiomRow,
|
|
22
27
|
Axioms,
|
|
23
28
|
Closed,
|
|
@@ -25,7 +30,9 @@ export type {
|
|
|
25
30
|
ClosedCore,
|
|
26
31
|
ClosedData,
|
|
27
32
|
ClosedRow,
|
|
28
|
-
|
|
33
|
+
ClosedSelectionInput,
|
|
34
|
+
PayloadField,
|
|
35
|
+
SelectedClosed
|
|
29
36
|
} from "#closed.ts"
|
|
30
37
|
export { closed } from "#closed.ts"
|
|
31
38
|
export type { Count } from "#count.ts"
|
|
@@ -43,7 +50,7 @@ export type {
|
|
|
43
50
|
WitnessedWriteResult,
|
|
44
51
|
WriteResult
|
|
45
52
|
} from "#db.ts"
|
|
46
|
-
export { abandon, Db } from "#db.ts"
|
|
53
|
+
export { abandon, Db, ErrNewtypeMismatch } from "#db.ts"
|
|
47
54
|
export type {
|
|
48
55
|
Exhumed,
|
|
49
56
|
ExhumedAxiom,
|
|
@@ -63,35 +70,33 @@ export type {
|
|
|
63
70
|
Face,
|
|
64
71
|
FaceArityMismatch,
|
|
65
72
|
FaceData,
|
|
66
|
-
FaceDomainMismatch,
|
|
67
|
-
FaceDomains,
|
|
68
73
|
FaceFields,
|
|
69
74
|
FaceOwner,
|
|
75
|
+
FaceShapeMismatch,
|
|
76
|
+
FaceShapes,
|
|
70
77
|
FaceSource,
|
|
71
78
|
OneOf,
|
|
79
|
+
OwnerOf,
|
|
72
80
|
SameArity,
|
|
73
|
-
|
|
81
|
+
SameShapes
|
|
74
82
|
} from "#face.ts"
|
|
75
83
|
export { on, oneOf } from "#face.ts"
|
|
76
84
|
export type {
|
|
77
85
|
AnyField,
|
|
78
86
|
BoolField,
|
|
79
|
-
BytesCtor,
|
|
80
87
|
BytesField,
|
|
81
88
|
ClosedIdField,
|
|
82
89
|
ClosedRoster,
|
|
83
90
|
FreshU64Field,
|
|
84
|
-
I64Ctor,
|
|
85
91
|
I64Field,
|
|
86
92
|
Infer,
|
|
87
|
-
IntervalCtor,
|
|
88
93
|
IntervalField,
|
|
89
94
|
IntervalValue,
|
|
90
95
|
StrField,
|
|
91
|
-
U64Ctor,
|
|
92
96
|
U64Field
|
|
93
97
|
} from "#fields.ts"
|
|
94
98
|
export { bool, bytes, i64, interval, span, str, u64 } from "#fields.ts"
|
|
99
|
+
export type { ClassesOf, ClassWall, LawfulStatements, RelationClasses, SchemaClasses } from "#law.ts"
|
|
95
100
|
export { lower, lowerClosed, lowerRelation } from "#lower.ts"
|
|
96
101
|
export type { KeyFact, Minted } from "#marshal.ts"
|
|
97
102
|
export type {
|
|
@@ -106,6 +111,8 @@ export type {
|
|
|
106
111
|
AnyCond,
|
|
107
112
|
BindingInput,
|
|
108
113
|
Cmp,
|
|
114
|
+
MatchFields,
|
|
115
|
+
MatchOwner,
|
|
109
116
|
MatchShape,
|
|
110
117
|
NotAtom,
|
|
111
118
|
RecData,
|
|
@@ -113,7 +120,7 @@ export type {
|
|
|
113
120
|
SelectColumn,
|
|
114
121
|
Tree
|
|
115
122
|
} from "#query/atom.ts"
|
|
116
|
-
export { ALLEN } from "#query/atom.ts"
|
|
123
|
+
export { ALLEN, allen, and, covers, eq, ge, gt, le, lt, ne, not, or, pointIn } from "#query/atom.ts"
|
|
117
124
|
export type {
|
|
118
125
|
AnyQuery,
|
|
119
126
|
AnyRuleValue,
|
|
@@ -136,7 +143,17 @@ export type {
|
|
|
136
143
|
export { lowerQuery, query } from "#query/lower.ts"
|
|
137
144
|
export type { ProgramScope, Rec } from "#query/predicate.ts"
|
|
138
145
|
export { program } from "#query/predicate.ts"
|
|
139
|
-
export type {
|
|
146
|
+
export type {
|
|
147
|
+
ClassedField,
|
|
148
|
+
Duration,
|
|
149
|
+
MaskParam,
|
|
150
|
+
Param,
|
|
151
|
+
ParamEntry,
|
|
152
|
+
ParamsRecord,
|
|
153
|
+
SetParam,
|
|
154
|
+
Var,
|
|
155
|
+
VarsRecord
|
|
156
|
+
} from "#query/scope.ts"
|
|
140
157
|
export type { Agg, SelectEntry } from "#query/select.ts"
|
|
141
158
|
export type {
|
|
142
159
|
AnyRelation,
|
|
@@ -172,5 +189,14 @@ export type {
|
|
|
172
189
|
WindowSpec
|
|
173
190
|
} from "#spec.ts"
|
|
174
191
|
export { renderLiteral, renderLiteralSet, renderWindow } from "#spec.ts"
|
|
175
|
-
export type {
|
|
192
|
+
export type {
|
|
193
|
+
ContainedStatement,
|
|
194
|
+
ContainmentData,
|
|
195
|
+
KeyData,
|
|
196
|
+
KeyStatement,
|
|
197
|
+
Statement,
|
|
198
|
+
StatementData,
|
|
199
|
+
WindowData,
|
|
200
|
+
WindowStatement
|
|
201
|
+
} from "#statements.ts"
|
|
176
202
|
export { contained, key, mirrors, renderStatement, window } from "#statements.ts"
|