@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/dist/fields.d.ts
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
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
|
import type { LiteralSpec } from "#spec.ts";
|
|
21
18
|
/**
|
|
22
19
|
* A half-open interval `[start, end)` as a plain value object — the ONE
|
|
23
|
-
* interval value type, whatever the field's element
|
|
24
|
-
* The ray is representable (`end` = the element
|
|
20
|
+
* interval value type, whatever the field's element type or width label.
|
|
21
|
+
* The ray is representable (`end` = the element type's MAX_END); widths
|
|
25
22
|
* and signedness are NOT modeled on the value — they are descriptor-type
|
|
26
23
|
* labels the engine judges at the typed write boundary. Interval fields
|
|
27
24
|
* derive no order (the Rust refusal, `docs/architecture/10-data-model.md`),
|
|
@@ -42,61 +39,47 @@ declare function span(start: bigint, end: bigint): IntervalValue;
|
|
|
42
39
|
/**
|
|
43
40
|
* A closed relation's roster as seen from a referencing field: the handle
|
|
44
41
|
* namespace `where()` selections and ground axioms resolve bare handle ids
|
|
45
|
-
* through (the macro's own rule: a handle is legal exactly on a field
|
|
46
|
-
*
|
|
42
|
+
* through (the macro's own rule: a handle is legal exactly on a field that
|
|
43
|
+
* references a closed relation).
|
|
47
44
|
*/
|
|
48
45
|
interface ClosedRoster {
|
|
49
46
|
readonly name: string;
|
|
50
47
|
readonly handles: readonly string[];
|
|
51
48
|
}
|
|
52
|
-
/** The `bool` field descriptor: value type `boolean`. No `.
|
|
49
|
+
/** The `bool` field descriptor: value type `boolean`. No `.fresh` (macro parity). */
|
|
53
50
|
interface BoolField {
|
|
54
51
|
readonly kind: "bool";
|
|
55
|
-
readonly domain: undefined;
|
|
56
52
|
}
|
|
57
|
-
/** The `str` field descriptor: value type `string`. No `.
|
|
53
|
+
/** The `str` field descriptor: value type `string`. No `.fresh` (macro parity). */
|
|
58
54
|
interface StrField {
|
|
59
55
|
readonly kind: "str";
|
|
60
|
-
readonly domain: undefined;
|
|
61
56
|
}
|
|
62
57
|
/**
|
|
63
|
-
* A `fresh`-marked u64 field descriptor — `id: u64.
|
|
64
|
-
* (
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* (`
|
|
68
|
-
*
|
|
58
|
+
* A `fresh`-marked u64 field descriptor — `id: u64.fresh`. The mark is a
|
|
59
|
+
* structural label (`fresh: true`) in the descriptor type AND on the
|
|
60
|
+
* runtime value; it implies the key `R(field) -> R`, which the ENGINE
|
|
61
|
+
* materializes (`SchemaDescriptor::materialized_statements`), and it makes
|
|
62
|
+
* the field a GENERATOR — `schema()` names its equivalence class by the
|
|
63
|
+
* declaration coordinate (`"Account.id"`). Terminal: no builder property
|
|
64
|
+
* survives the mark.
|
|
69
65
|
*/
|
|
70
|
-
interface FreshU64Field
|
|
66
|
+
interface FreshU64Field {
|
|
71
67
|
readonly kind: "u64";
|
|
72
|
-
readonly domain: Domain;
|
|
73
68
|
readonly fresh: true;
|
|
74
69
|
}
|
|
75
70
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* descriptor
|
|
79
|
-
*
|
|
80
|
-
* on an unmarked descriptor it holds the marked descriptor, on a marked
|
|
81
|
-
* one it IS the literal `true` (one structural property, read either way).
|
|
71
|
+
* The `u64` field descriptor. `.fresh` marks the field as engine-minted —
|
|
72
|
+
* the property doubles as the mark itself: on an unmarked descriptor it
|
|
73
|
+
* holds the marked descriptor, on a marked one it IS the literal `true`
|
|
74
|
+
* (one structural property, read either way).
|
|
82
75
|
*/
|
|
83
|
-
interface U64Field
|
|
76
|
+
interface U64Field {
|
|
84
77
|
readonly kind: "u64";
|
|
85
|
-
readonly
|
|
86
|
-
readonly fresh: FreshU64Field<Domain>;
|
|
78
|
+
readonly fresh: FreshU64Field;
|
|
87
79
|
}
|
|
88
|
-
/** The `
|
|
89
|
-
interface
|
|
90
|
-
as<const Domain extends string>(domain: Domain): U64Field<Domain>;
|
|
91
|
-
}
|
|
92
|
-
/** A domain-labeled i64 field descriptor. Terminal: `.fresh` is legal on u64 only. */
|
|
93
|
-
interface I64Field<Domain extends string | undefined = undefined> {
|
|
80
|
+
/** The `i64` field descriptor. Terminal: `.fresh` is legal on u64 only. */
|
|
81
|
+
interface I64Field {
|
|
94
82
|
readonly kind: "i64";
|
|
95
|
-
readonly domain: Domain;
|
|
96
|
-
}
|
|
97
|
-
/** The `i64` constructor value: a bare i64 descriptor plus `.as`. */
|
|
98
|
-
interface I64Ctor extends I64Field<undefined> {
|
|
99
|
-
as<const Domain extends string>(domain: Domain): I64Field<Domain>;
|
|
100
83
|
}
|
|
101
84
|
/**
|
|
102
85
|
* A `bytes<N>` field descriptor. The width is a descriptor-type label
|
|
@@ -104,14 +87,9 @@ interface I64Ctor extends I64Field<undefined> {
|
|
|
104
87
|
* value type is bare `Uint8Array`. No order is derived — no comparators
|
|
105
88
|
* exist on the value type (the engine refuses order on bytes).
|
|
106
89
|
*/
|
|
107
|
-
interface BytesField<Width extends number = number
|
|
90
|
+
interface BytesField<Width extends number = number> {
|
|
108
91
|
readonly kind: "bytes";
|
|
109
92
|
readonly width: Width;
|
|
110
|
-
readonly domain: Domain;
|
|
111
|
-
}
|
|
112
|
-
/** A `bytes(n)` constructor value: a bare bytes descriptor plus `.as`. */
|
|
113
|
-
interface BytesCtor<Width extends number = number> extends BytesField<Width, undefined> {
|
|
114
|
-
as<const Domain extends string>(domain: Domain): BytesField<Width, Domain>;
|
|
115
93
|
}
|
|
116
94
|
/**
|
|
117
95
|
* An interval field descriptor — `interval(i64)` general (rays
|
|
@@ -119,35 +97,28 @@ interface BytesCtor<Width extends number = number> extends BytesField<Width, und
|
|
|
119
97
|
* width are descriptor-type labels; the value type is always the bare
|
|
120
98
|
* {@link IntervalValue}.
|
|
121
99
|
*/
|
|
122
|
-
interface IntervalField<Element extends "u64" | "i64" = "u64" | "i64", Width extends bigint | undefined = bigint | undefined
|
|
100
|
+
interface IntervalField<Element extends "u64" | "i64" = "u64" | "i64", Width extends bigint | undefined = bigint | undefined> {
|
|
123
101
|
readonly kind: "interval";
|
|
124
102
|
readonly element: Element;
|
|
125
103
|
readonly width: Width;
|
|
126
|
-
readonly domain: Domain;
|
|
127
|
-
}
|
|
128
|
-
/** An `interval(e[, w])` constructor value: a bare interval descriptor plus `.as`. */
|
|
129
|
-
interface IntervalCtor<Element extends "u64" | "i64" = "u64" | "i64", Width extends bigint | undefined = bigint | undefined> extends IntervalField<Element, Width, undefined> {
|
|
130
|
-
as<const Domain extends string>(domain: Domain): IntervalField<Element, Width, Domain>;
|
|
131
104
|
}
|
|
132
105
|
/**
|
|
133
106
|
* A closed relation's reference field descriptor (`Kind.id`) — a u64
|
|
134
|
-
* descriptor
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
107
|
+
* descriptor carrying the closed linkage: the roster resolves bare handle
|
|
108
|
+
* ids in selections and ground axioms, and `schema()` names the id's
|
|
109
|
+
* generator class `"Kind.id"`. Terminal: no `.fresh` — a vocabulary's rows
|
|
110
|
+
* are ground axioms, never minted.
|
|
138
111
|
*/
|
|
139
|
-
interface ClosedIdField
|
|
112
|
+
interface ClosedIdField {
|
|
140
113
|
readonly kind: "u64";
|
|
141
|
-
readonly domain: Domain;
|
|
142
114
|
readonly closed: ClosedRoster;
|
|
143
115
|
}
|
|
144
|
-
/** Any field descriptor, whatever its kind
|
|
145
|
-
type AnyField = BoolField | StrField | U64Field
|
|
116
|
+
/** Any field descriptor, whatever its kind or marks. */
|
|
117
|
+
type AnyField = BoolField | StrField | U64Field | FreshU64Field | I64Field | BytesField | IntervalField | ClosedIdField;
|
|
146
118
|
/**
|
|
147
119
|
* The bare structural VALUE type of a field descriptor — the one total
|
|
148
120
|
* definition every fact, result row, and query term reads: `bool` →
|
|
149
|
-
* `boolean`, `str` → `string`, `u64`/`i64` → `bigint`
|
|
150
|
-
* included — the label never touches the value), `bytes<N>` →
|
|
121
|
+
* `boolean`, `str` → `string`, `u64`/`i64` → `bigint`, `bytes<N>` →
|
|
151
122
|
* `Uint8Array`, intervals → {@link IntervalValue}.
|
|
152
123
|
*/
|
|
153
124
|
type Infer<F extends AnyField> = F extends {
|
|
@@ -175,9 +146,9 @@ type Infer<F extends AnyField> = F extends {
|
|
|
175
146
|
*/
|
|
176
147
|
declare function assertDeclarationOrderKey(where: string, name: string): void;
|
|
177
148
|
/** The one `u64` constructor value. */
|
|
178
|
-
declare const u64:
|
|
149
|
+
declare const u64: U64Field;
|
|
179
150
|
/** The one `i64` constructor value. */
|
|
180
|
-
declare const i64:
|
|
151
|
+
declare const i64: I64Field;
|
|
181
152
|
/** The one `bool` constructor value. */
|
|
182
153
|
declare const bool: BoolField;
|
|
183
154
|
/** The one `str` constructor value. */
|
|
@@ -189,7 +160,7 @@ declare const str: StrField;
|
|
|
189
160
|
* § the `schema!` grammar: N ∈ 1..=64 — bare `bytes` does not parse), the
|
|
190
161
|
* macro-expansion boundary's analog being construction.
|
|
191
162
|
*/
|
|
192
|
-
declare function bytes<const Width extends number>(width: Width):
|
|
163
|
+
declare function bytes<const Width extends number>(width: Width): BytesField<Width>;
|
|
193
164
|
/**
|
|
194
165
|
* The interval field constructor — `interval(u64)` / `interval(i64)` for
|
|
195
166
|
* the general type (rays representable), `interval(u64, w)` for the
|
|
@@ -199,8 +170,8 @@ declare function bytes<const Width extends number>(width: Width): BytesCtor<Widt
|
|
|
199
170
|
* (`docs/architecture/70-api.md`: w ≥ 1; `interval<u64, 0>` is an
|
|
200
171
|
* expansion error naming the field).
|
|
201
172
|
*/
|
|
202
|
-
declare function interval<Element extends
|
|
203
|
-
declare function interval<Element extends
|
|
173
|
+
declare function interval<Element extends U64Field | I64Field>(element: Element): IntervalField<Element["kind"], undefined>;
|
|
174
|
+
declare function interval<Element extends U64Field | I64Field, const Width extends bigint>(element: Element, width: Width): IntervalField<Element["kind"], Width>;
|
|
204
175
|
/**
|
|
205
176
|
* Lowers one host literal at its field position to the wire
|
|
206
177
|
* {@link LiteralSpec} — the selection-literal machine ground axioms and
|
|
@@ -211,6 +182,6 @@ declare function interval<Element extends U64Ctor | I64Ctor, const Width extends
|
|
|
211
182
|
* the field's structural kind.
|
|
212
183
|
*/
|
|
213
184
|
declare function literalOf(field: AnyField, value: unknown): LiteralSpec;
|
|
214
|
-
export type { AnyField, BoolField,
|
|
185
|
+
export type { AnyField, BoolField, BytesField, ClosedIdField, ClosedRoster, FreshU64Field, I64Field, Infer, IntervalField, IntervalValue, StrField, U64Field };
|
|
215
186
|
export { assertDeclarationOrderKey, bool, bytes, i64, interval, literalOf, span, str, u64 };
|
|
216
187
|
//# sourceMappingURL=fields.d.ts.map
|
package/dist/fields.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C;;;;;;;;GAQG;AACH,UAAU,aAAa;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;GA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AO1E;AAED;;;;;;;;GAQG;AACH,iBAAS,QAAQ,CAAC,OAAO,SAAS,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAA;AACnH,iBAAS,QAAQ,CAAC,OAAO,SAAS,QAAQ,GAAG,QAAQ,EAAE,KAAK,CAAC,KAAK,SAAS,MAAM,EAChF,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACV,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAA;AAcxC;;;;;;;;GAQG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,CAsC/D;AAED,YAAY,EACX,QAAQ,EACR,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,KAAK,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,CAAA;AACD,OAAO,EAAE,yBAAyB,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA"}
|
package/dist/fields.js
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
|
import * as errors from "@superbuilders/errors";
|
|
21
18
|
/**
|
|
@@ -88,31 +85,16 @@ function assertDeclarationOrderKey(where, name) {
|
|
|
88
85
|
throw errors.new(`${where}: name ${name} is an integer index — JavaScript object keys re-order integer indices, breaking the declaration-order law; use a non-numeric name`);
|
|
89
86
|
}
|
|
90
87
|
}
|
|
91
|
-
/**
|
|
92
|
-
|
|
93
|
-
return Object.freeze({ kind: "u64", domain, fresh: true });
|
|
94
|
-
}
|
|
88
|
+
/** The one fresh-marked u64 descriptor (the `.fresh` property of the unmarked one). */
|
|
89
|
+
const freshU64 = Object.freeze({ kind: "u64", fresh: true });
|
|
95
90
|
/** The one `u64` constructor value. */
|
|
96
|
-
const u64 = Object.freeze({
|
|
97
|
-
kind: "u64",
|
|
98
|
-
domain: undefined,
|
|
99
|
-
fresh: freshU64(undefined),
|
|
100
|
-
as(domain) {
|
|
101
|
-
return Object.freeze({ kind: "u64", domain, fresh: freshU64(domain) });
|
|
102
|
-
}
|
|
103
|
-
});
|
|
91
|
+
const u64 = Object.freeze({ kind: "u64", fresh: freshU64 });
|
|
104
92
|
/** The one `i64` constructor value. */
|
|
105
|
-
const i64 = Object.freeze({
|
|
106
|
-
kind: "i64",
|
|
107
|
-
domain: undefined,
|
|
108
|
-
as(domain) {
|
|
109
|
-
return Object.freeze({ kind: "i64", domain });
|
|
110
|
-
}
|
|
111
|
-
});
|
|
93
|
+
const i64 = Object.freeze({ kind: "i64" });
|
|
112
94
|
/** The one `bool` constructor value. */
|
|
113
|
-
const bool = Object.freeze({ kind: "bool"
|
|
95
|
+
const bool = Object.freeze({ kind: "bool" });
|
|
114
96
|
/** The one `str` constructor value. */
|
|
115
|
-
const str = Object.freeze({ kind: "str"
|
|
97
|
+
const str = Object.freeze({ kind: "str" });
|
|
116
98
|
/**
|
|
117
99
|
* The `bytes<N>` field constructor. The width is mandatory and a
|
|
118
100
|
* descriptor-type label; `width` is validated to 1..=64 here because the
|
|
@@ -124,14 +106,7 @@ function bytes(width) {
|
|
|
124
106
|
if (!Number.isInteger(width) || width < 1 || width > 64) {
|
|
125
107
|
throw errors.new(`bytes width must be an integer in 1..=64 (got ${width}) — docs/architecture/70-api.md pins the range at declaration`);
|
|
126
108
|
}
|
|
127
|
-
return Object.freeze({
|
|
128
|
-
kind: "bytes",
|
|
129
|
-
width,
|
|
130
|
-
domain: undefined,
|
|
131
|
-
as(domain) {
|
|
132
|
-
return Object.freeze({ kind: "bytes", width, domain });
|
|
133
|
-
}
|
|
134
|
-
});
|
|
109
|
+
return Object.freeze({ kind: "bytes", width });
|
|
135
110
|
}
|
|
136
111
|
function interval(element, width) {
|
|
137
112
|
const elementKind = element.kind;
|
|
@@ -141,15 +116,7 @@ function interval(element, width) {
|
|
|
141
116
|
if (width !== undefined && width < 1n) {
|
|
142
117
|
throw errors.new(`interval width must be >= 1 (got ${width}) — docs/architecture/70-api.md pins w >= 1 at declaration`);
|
|
143
118
|
}
|
|
144
|
-
return Object.freeze({
|
|
145
|
-
kind: "interval",
|
|
146
|
-
element: elementKind,
|
|
147
|
-
width,
|
|
148
|
-
domain: undefined,
|
|
149
|
-
as(domain) {
|
|
150
|
-
return Object.freeze({ kind: "interval", element: elementKind, width, domain });
|
|
151
|
-
}
|
|
152
|
-
});
|
|
119
|
+
return Object.freeze({ kind: "interval", element: elementKind, width });
|
|
153
120
|
}
|
|
154
121
|
/**
|
|
155
122
|
* Lowers one host literal at its field position to the wire
|
package/dist/fields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAiB/C;;;;;;GAMG;AACH,SAAS,IAAI,CAAC,KAAa,EAAE,GAAW;IACvC,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;QAClB,MAAM,MAAM,CAAC,GAAG,CAAC,gEAAgE,KAAK,KAAK,GAAG,GAAG,CAAC,CAAA;IACnG,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;AACrC,CAAC;AAkHD;;;GAGG;AACH,SAAS,iBAAiB,CAAC,QAAgB,EAAE,KAAc;IAC1D,OAAO,MAAM,CAAC,GAAG,CAAC,8CAA8C,QAAQ,SAAS,OAAO,KAAK,EAAE,CAAC,CAAA;AACjG,CAAC;AAED,yEAAyE;AACzE,SAAS,iBAAiB,CAAC,KAAc;IACxC,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAO,IAAI,KAAK;QAChB,KAAK,IAAI,KAAK;QACd,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAC/B,OAAO,KAAK,CAAC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AAM,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;YACzC,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAA;QACxD,CAAC;QACD,KAAK,KAAK,EAAE,CAAC;YACZ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC/B,MAAM,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;YACzC,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAA;QAC3D,CAAC;QACD,KAAK,OAAO,EAAE,CAAC;YACd,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE,CAAC;gBACpC,MAAM,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;YAC7C,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,CAAA;QAC/D,CAAC;QACD,KAAK,UAAU;YACd,OAAO,eAAe,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC9C,CAAC;AACF,CAAC;AAgBD,OAAO,EAAE,yBAAyB,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,42 +1,47 @@
|
|
|
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.
|
|
17
21
|
*/
|
|
18
|
-
export type { AnyClosed, AxiomRow, Axioms, Closed, ClosedColumn, ClosedCore, ClosedData, ClosedRow, PayloadField } from "#closed.ts";
|
|
22
|
+
export type { AnyClosed, AnySelectedClosed, AxiomRow, Axioms, Closed, ClosedColumn, ClosedCore, ClosedData, ClosedRow, ClosedSelectionInput, PayloadField, SelectedClosed } from "#closed.ts";
|
|
19
23
|
export { closed } from "#closed.ts";
|
|
20
24
|
export type { Count } from "#count.ts";
|
|
21
25
|
export { atLeast, atMost, between, exactly, none } from "#count.ts";
|
|
22
26
|
export type { Abandon, DeclaredKeyFact, DeltaBuild, MemberRelation, OffendingFact, Prepared, ReadScope, Tx, Violation, WitnessedWriteResult, WriteResult } from "#db.ts";
|
|
23
|
-
export { abandon, Db } from "#db.ts";
|
|
27
|
+
export { abandon, Db, ErrNewtypeMismatch } from "#db.ts";
|
|
24
28
|
export type { Exhumed, ExhumedAxiom, ExhumedDescriptor, ExhumedFact, ExhumedField, ExhumedRelation } from "#exhume.ts";
|
|
25
29
|
export { ErrExhumeCorruption, ErrExhumeFormatMismatch, ErrExhumeNoDescriptor } from "#exhume.ts";
|
|
26
|
-
export type { AnyFace, Arity, Face, FaceArityMismatch, FaceData,
|
|
30
|
+
export type { AnyFace, Arity, Face, FaceArityMismatch, FaceData, FaceFields, FaceOwner, FaceShapeMismatch, FaceShapes, FaceSource, OneOf, OwnerOf, SameArity, SameShapes } from "#face.ts";
|
|
27
31
|
export { on, oneOf } from "#face.ts";
|
|
28
|
-
export type { AnyField, BoolField,
|
|
32
|
+
export type { AnyField, BoolField, BytesField, ClosedIdField, ClosedRoster, FreshU64Field, I64Field, Infer, IntervalField, IntervalValue, StrField, U64Field } from "#fields.ts";
|
|
29
33
|
export { bool, bytes, i64, interval, span, str, u64 } from "#fields.ts";
|
|
34
|
+
export type { ClassesOf, ClassWall, LawfulStatements, RelationClasses, SchemaClasses } from "#law.ts";
|
|
30
35
|
export { lower, lowerClosed, lowerRelation } from "#lower.ts";
|
|
31
36
|
export type { KeyFact, Minted } from "#marshal.ts";
|
|
32
37
|
export type { FactValue, OccurrenceDrift, ProgramIr, Staleness, StatementKindTag } from "#native.ts";
|
|
33
|
-
export type { AnyCond, BindingInput, Cmp, MatchShape, NotAtom, RecData, RuleData, SelectColumn, Tree } from "#query/atom.ts";
|
|
34
|
-
export { ALLEN } from "#query/atom.ts";
|
|
38
|
+
export type { AnyCond, BindingInput, Cmp, MatchFields, MatchOwner, MatchShape, NotAtom, RecData, RuleData, SelectColumn, Tree } from "#query/atom.ts";
|
|
39
|
+
export { ALLEN, allen, and, covers, eq, ge, gt, le, lt, ne, not, or, pointIn } from "#query/atom.ts";
|
|
35
40
|
export type { AnyQuery, AnyRuleValue, OutputRuleChain, OutputRuleScope, Query, QueryData, QueryParams, QueryRelation, QueryRow, QueryRuleChain, QueryRuleScope, QueryStart, RecRef, RecRuleChain, RecRuleScope, RuleValue, TermOps } from "#query/lower.ts";
|
|
36
41
|
export { lowerQuery, query } from "#query/lower.ts";
|
|
37
42
|
export type { ProgramScope, Rec } from "#query/predicate.ts";
|
|
38
43
|
export { program } from "#query/predicate.ts";
|
|
39
|
-
export type { Duration, MaskParam, Param, ParamEntry, ParamsRecord, SetParam, Var } from "#query/scope.ts";
|
|
44
|
+
export type { ClassedField, Duration, MaskParam, Param, ParamEntry, ParamsRecord, SetParam, Var, VarsRecord } from "#query/scope.ts";
|
|
40
45
|
export type { Agg, SelectEntry } from "#query/select.ts";
|
|
41
46
|
export type { AnyRelation, AnySelected, Fact, FieldRef, FieldRefs, FieldsShape, FreshKeys, InsertFact, Relation, RelationData, RelationField, RelationFields, Selected, SelectionBinding, SelectionInput } from "#relation.ts";
|
|
42
47
|
export { relation } from "#relation.ts";
|
|
@@ -44,6 +49,6 @@ export type { AnySchema, Schema, SchemaRelation, SchemaRelations } from "#schema
|
|
|
44
49
|
export { schema } from "#schema.ts";
|
|
45
50
|
export type { FieldSpec, LiteralSetSpec, LiteralSpec, RelationSpec, RowSpec, SchemaSpec, SideSpec, StatementSpec, ValueSpec, ValueTypeSpec, WindowSpec } from "#spec.ts";
|
|
46
51
|
export { renderLiteral, renderLiteralSet, renderWindow } from "#spec.ts";
|
|
47
|
-
export type { KeyData, KeyStatement, Statement, StatementData } from "#statements.ts";
|
|
52
|
+
export type { ContainedStatement, ContainmentData, KeyData, KeyStatement, Statement, StatementData, WindowData, WindowStatement } from "#statements.ts";
|
|
48
53
|
export { contained, key, mirrors, renderStatement, window } from "#statements.ts";
|
|
49
54
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3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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.
|
|
17
21
|
*/
|
|
18
22
|
export { closed } from "#closed.ts";
|
|
19
23
|
export { atLeast, atMost, between, exactly, none } from "#count.ts";
|
|
20
|
-
export { abandon, Db } from "#db.ts";
|
|
24
|
+
export { abandon, Db, ErrNewtypeMismatch } from "#db.ts";
|
|
21
25
|
export { ErrExhumeCorruption, ErrExhumeFormatMismatch, ErrExhumeNoDescriptor } from "#exhume.ts";
|
|
22
26
|
export { on, oneOf } from "#face.ts";
|
|
23
27
|
export { bool, bytes, i64, interval, span, str, u64 } from "#fields.ts";
|
|
24
28
|
export { lower, lowerClosed, lowerRelation } from "#lower.ts";
|
|
25
|
-
export { ALLEN } from "#query/atom.ts";
|
|
29
|
+
export { ALLEN, allen, and, covers, eq, ge, gt, le, lt, ne, not, or, pointIn } from "#query/atom.ts";
|
|
26
30
|
export { lowerQuery, query } from "#query/lower.ts";
|
|
27
31
|
export { program } from "#query/predicate.ts";
|
|
28
32
|
export { relation } from "#relation.ts";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAgBH,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAcnE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AASxD,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,MAAM,YAAY,CAAA;AAiBnB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAepC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAEvE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAuB7D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAoBpG,OAAO,EAAE,UAAU,EA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