@bjornpagen/bumbledb 0.1.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 +1450 -0
- package/README.md +69 -30
- package/dist/closed.d.ts +157 -38
- package/dist/closed.d.ts.map +1 -1
- package/dist/closed.js +232 -47
- package/dist/closed.js.map +1 -1
- package/dist/count.d.ts +64 -17
- package/dist/count.d.ts.map +1 -1
- package/dist/count.js +37 -14
- package/dist/count.js.map +1 -1
- package/dist/db.d.ts +27 -8
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +33 -10
- package/dist/db.js.map +1 -1
- package/dist/exhume.d.ts +12 -11
- package/dist/exhume.d.ts.map +1 -1
- package/dist/exhume.js +7 -6
- package/dist/exhume.js.map +1 -1
- package/dist/face.d.ts +135 -30
- package/dist/face.d.ts.map +1 -1
- package/dist/face.js +44 -19
- package/dist/face.js.map +1 -1
- package/dist/fields.d.ts +130 -130
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +60 -94
- package/dist/fields.js.map +1 -1
- package/dist/index.d.ts +29 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -14
- 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 -7
- package/dist/lower.d.ts.map +1 -1
- package/dist/lower.js +66 -24
- package/dist/lower.js.map +1 -1
- package/dist/marshal.d.ts +36 -21
- package/dist/marshal.d.ts.map +1 -1
- package/dist/marshal.js +41 -25
- package/dist/marshal.js.map +1 -1
- package/dist/native.d.ts +6 -2
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +2 -2
- package/dist/native.js.map +1 -1
- package/dist/query/atom.d.ts +370 -174
- package/dist/query/atom.d.ts.map +1 -1
- package/dist/query/atom.js +75 -172
- package/dist/query/atom.js.map +1 -1
- package/dist/query/lower.d.ts +312 -109
- package/dist/query/lower.d.ts.map +1 -1
- package/dist/query/lower.js +906 -387
- package/dist/query/lower.js.map +1 -1
- package/dist/query/predicate.d.ts +70 -88
- package/dist/query/predicate.d.ts.map +1 -1
- package/dist/query/predicate.js +118 -72
- package/dist/query/predicate.js.map +1 -1
- package/dist/query/run.d.ts +19 -16
- package/dist/query/run.d.ts.map +1 -1
- package/dist/query/run.js +31 -24
- package/dist/query/run.js.map +1 -1
- package/dist/query/scope.d.ts +178 -127
- package/dist/query/scope.d.ts.map +1 -1
- package/dist/query/scope.js +111 -108
- package/dist/query/scope.js.map +1 -1
- package/dist/query/select.d.ts +102 -80
- package/dist/query/select.d.ts.map +1 -1
- package/dist/query/select.js +39 -34
- package/dist/query/select.js.map +1 -1
- package/dist/relation.d.ts +48 -38
- package/dist/relation.d.ts.map +1 -1
- package/dist/relation.js +24 -19
- 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 +34 -9
- package/dist/schema.js.map +1 -1
- package/dist/spec.d.ts +7 -5
- package/dist/spec.d.ts.map +1 -1
- package/dist/spec.js.map +1 -1
- package/dist/statements.d.ts +91 -36
- package/dist/statements.d.ts.map +1 -1
- package/dist/statements.js +42 -12
- package/dist/statements.js.map +1 -1
- package/package.json +4 -3
- package/src/closed.ts +448 -95
- package/src/count.ts +112 -18
- package/src/db.ts +45 -17
- package/src/exhume.ts +12 -11
- package/src/face.ts +211 -41
- package/src/fields.ts +199 -234
- package/src/index.ts +78 -61
- package/src/law.ts +519 -0
- package/src/lower.ts +82 -27
- package/src/marshal.ts +48 -30
- package/src/native.ts +8 -4
- package/src/query/atom.ts +525 -374
- package/src/query/lower.ts +1469 -538
- package/src/query/predicate.ts +208 -161
- package/src/query/run.ts +35 -25
- package/src/query/scope.ts +264 -218
- package/src/query/select.ts +168 -93
- package/src/relation.ts +47 -47
- package/src/schema.ts +69 -18
- package/src/spec.ts +7 -5
- package/src/statements.ts +124 -41
- package/dist/brand.d.ts +0 -59
- package/dist/brand.d.ts.map +0 -1
- package/dist/brand.js +0 -47
- package/dist/brand.js.map +0 -1
- package/src/brand.ts +0 -82
package/src/index.ts
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @bjornpagen/bumbledb — the type-theoretic TypeScript SDK for the
|
|
3
|
-
* bumbledb embedded relational engine. Public surface: the type
|
|
4
|
-
* (
|
|
5
|
-
*
|
|
3
|
+
* bumbledb embedded relational engine. Public surface: the structural type
|
|
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`
|
|
6
8
|
* runtime (path-cached stores, transactions, typed violations, scoped
|
|
7
9
|
* snapshot reads, the witnessed write loop with `abandon` — PRD-07, zero
|
|
8
|
-
* closables), the query surface (Datalog as values:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* closables), the query surface (Datalog as values, kysely-shaped:
|
|
11
|
+
* `query(S).rule(r => r.match(...).where(...).select(...))` with
|
|
12
|
+
* string-named domain-typed vars, params typed by use, negation,
|
|
13
|
+
* conditions, aggregates, and stratified recursion via `program()`/`rec` —
|
|
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
|
|
11
18
|
* (`Db.exhume` — the one schema-independent read path: the store's
|
|
12
|
-
* self-described shapes and raw facts by name,
|
|
13
|
-
*
|
|
14
|
-
* PRD-03 stub died here as scheduled).
|
|
19
|
+
* self-described shapes and raw facts by name, typed at bare structural
|
|
20
|
+
* values, deliberately schema-free). The raw native bridge is not exported.
|
|
15
21
|
*/
|
|
16
22
|
|
|
17
|
-
export type { Brand, Interval, IntervalValue } from "#brand.ts"
|
|
18
|
-
export { span } from "#brand.ts"
|
|
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,
|
|
@@ -65,32 +72,31 @@ export type {
|
|
|
65
72
|
FaceData,
|
|
66
73
|
FaceFields,
|
|
67
74
|
FaceOwner,
|
|
75
|
+
FaceShapeMismatch,
|
|
76
|
+
FaceShapes,
|
|
68
77
|
FaceSource,
|
|
69
78
|
OneOf,
|
|
70
|
-
|
|
79
|
+
OwnerOf,
|
|
80
|
+
SameArity,
|
|
81
|
+
SameShapes
|
|
71
82
|
} from "#face.ts"
|
|
72
83
|
export { on, oneOf } from "#face.ts"
|
|
73
84
|
export type {
|
|
74
85
|
AnyField,
|
|
75
86
|
BoolField,
|
|
76
87
|
BytesField,
|
|
77
|
-
BytesNewtype,
|
|
78
88
|
ClosedIdField,
|
|
79
89
|
ClosedRoster,
|
|
80
|
-
|
|
81
|
-
FieldData,
|
|
82
|
-
FieldValue,
|
|
83
|
-
FreshU64Newtype,
|
|
90
|
+
FreshU64Field,
|
|
84
91
|
I64Field,
|
|
85
|
-
I64Newtype,
|
|
86
92
|
Infer,
|
|
87
93
|
IntervalField,
|
|
88
|
-
|
|
94
|
+
IntervalValue,
|
|
89
95
|
StrField,
|
|
90
|
-
U64Field
|
|
91
|
-
U64Newtype
|
|
96
|
+
U64Field
|
|
92
97
|
} from "#fields.ts"
|
|
93
|
-
export { bool, bytes, i64, interval, str, u64 } from "#fields.ts"
|
|
98
|
+
export { bool, bytes, i64, interval, span, str, u64 } from "#fields.ts"
|
|
99
|
+
export type { ClassesOf, ClassWall, LawfulStatements, RelationClasses, SchemaClasses } from "#law.ts"
|
|
94
100
|
export { lower, lowerClosed, lowerRelation } from "#lower.ts"
|
|
95
101
|
export type { KeyFact, Minted } from "#marshal.ts"
|
|
96
102
|
export type {
|
|
@@ -102,51 +108,53 @@ export type {
|
|
|
102
108
|
} from "#native.ts"
|
|
103
109
|
|
|
104
110
|
export type {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
ALLEN,
|
|
117
|
-
allen,
|
|
118
|
-
and,
|
|
119
|
-
covers,
|
|
120
|
-
duration,
|
|
121
|
-
ge,
|
|
122
|
-
gt,
|
|
123
|
-
is,
|
|
124
|
-
le,
|
|
125
|
-
lt,
|
|
126
|
-
match,
|
|
127
|
-
ne,
|
|
128
|
-
not,
|
|
129
|
-
or
|
|
111
|
+
AnyCond,
|
|
112
|
+
BindingInput,
|
|
113
|
+
Cmp,
|
|
114
|
+
MatchFields,
|
|
115
|
+
MatchOwner,
|
|
116
|
+
MatchShape,
|
|
117
|
+
NotAtom,
|
|
118
|
+
RecData,
|
|
119
|
+
RuleData,
|
|
120
|
+
SelectColumn,
|
|
121
|
+
Tree
|
|
130
122
|
} from "#query/atom.ts"
|
|
131
|
-
|
|
123
|
+
export { ALLEN, allen, and, covers, eq, ge, gt, le, lt, ne, not, or, pointIn } from "#query/atom.ts"
|
|
132
124
|
export type {
|
|
133
125
|
AnyQuery,
|
|
126
|
+
AnyRuleValue,
|
|
127
|
+
OutputRuleChain,
|
|
128
|
+
OutputRuleScope,
|
|
134
129
|
Query,
|
|
135
|
-
|
|
130
|
+
QueryData,
|
|
136
131
|
QueryParams,
|
|
132
|
+
QueryRelation,
|
|
137
133
|
QueryRow,
|
|
138
|
-
|
|
134
|
+
QueryRuleChain,
|
|
135
|
+
QueryRuleScope,
|
|
136
|
+
QueryStart,
|
|
137
|
+
RecRef,
|
|
138
|
+
RecRuleChain,
|
|
139
|
+
RecRuleScope,
|
|
140
|
+
RuleValue,
|
|
141
|
+
TermOps
|
|
139
142
|
} from "#query/lower.ts"
|
|
140
143
|
export { lowerQuery, query } from "#query/lower.ts"
|
|
144
|
+
export type { ProgramScope, Rec } from "#query/predicate.ts"
|
|
145
|
+
export { program } from "#query/predicate.ts"
|
|
141
146
|
export type {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
ClassedField,
|
|
148
|
+
Duration,
|
|
149
|
+
MaskParam,
|
|
150
|
+
Param,
|
|
151
|
+
ParamEntry,
|
|
152
|
+
ParamsRecord,
|
|
153
|
+
SetParam,
|
|
154
|
+
Var,
|
|
155
|
+
VarsRecord
|
|
156
|
+
} from "#query/scope.ts"
|
|
157
|
+
export type { Agg, SelectEntry } from "#query/select.ts"
|
|
150
158
|
export type {
|
|
151
159
|
AnyRelation,
|
|
152
160
|
AnySelected,
|
|
@@ -181,5 +189,14 @@ export type {
|
|
|
181
189
|
WindowSpec
|
|
182
190
|
} from "#spec.ts"
|
|
183
191
|
export { renderLiteral, renderLiteralSet, renderWindow } from "#spec.ts"
|
|
184
|
-
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"
|
|
185
202
|
export { contained, key, mirrors, renderStatement, window } from "#statements.ts"
|