@bjornpagen/bumbledb 0.11.0 → 0.12.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 +4 -4
- package/README.md +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/native.d.ts +12 -5
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js.map +1 -1
- package/dist/query/atom.d.ts +1 -1
- package/dist/query/lower.d.ts +43 -30
- package/dist/query/lower.d.ts.map +1 -1
- package/dist/query/lower.js +102 -73
- package/dist/query/lower.js.map +1 -1
- package/dist/query/parse-ir.d.ts +4 -4
- package/dist/query/parse-ir.js +5 -5
- package/dist/query/parse-ir.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +3 -2
- package/src/native.ts +17 -8
- package/src/query/atom.ts +1 -1
- package/src/query/lower.ts +180 -138
- package/src/query/parse-ir.ts +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bjornpagen/bumbledb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Type-theoretic TypeScript SDK for the bumbledb embedded relational engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"private": false,
|
|
55
55
|
"optionalDependencies": {
|
|
56
|
-
"@bjornpagen/bumbledb-darwin-arm64": "0.
|
|
56
|
+
"@bjornpagen/bumbledb-darwin-arm64": "0.12.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "node scripts/build.ts",
|
package/src/index.ts
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
* statement algebra with `schema()` and `SchemaSpec` lowering (PRD-06), the `Db`
|
|
8
8
|
* runtime (exclusive-lock stores, transactions, typed violations, scoped
|
|
9
9
|
* snapshot reads, one-shot `write`/`writeFrom` with `abandon` — PRD-07, zero
|
|
10
|
-
* closables), the query surface (
|
|
10
|
+
* closables), the query surface (kysely-shaped:
|
|
11
11
|
* `query(S).rule(r => { const { id, name } = v(Holder); return r.match(Holder, { id, name }).find({ name }) })` —
|
|
12
12
|
* variables minted by `v()` and joined by OBJECT REFERENCE (reuse is the
|
|
13
13
|
* join), the head a `find` RECORD whose keys name the answer columns
|
|
14
14
|
* (renames are real), params still STRING-named, plus negation,
|
|
15
15
|
* conditions, aggregates, and interiors / one linear rec via
|
|
16
|
-
* `q.interior` / `q.
|
|
16
|
+
* `q.interior` / `q.reach` —
|
|
17
17
|
* `db.prepare` as a plain value; the comparison/connective builders are
|
|
18
18
|
* also free exports, and the free names `eq`/`not`/`and`/`or` collide with
|
|
19
19
|
* common host identifiers — import aliasing is the answer; the SDK does
|
|
@@ -132,6 +132,7 @@ export type {
|
|
|
132
132
|
Query,
|
|
133
133
|
QueryData,
|
|
134
134
|
QueryParams,
|
|
135
|
+
QueryReachStart,
|
|
135
136
|
QueryRelation,
|
|
136
137
|
QueryRow,
|
|
137
138
|
QueryRuleChain,
|
package/src/native.ts
CHANGED
|
@@ -73,14 +73,23 @@ type QueryParam = TaggedValue | { readonly kind: "set"; readonly values: readonl
|
|
|
73
73
|
/**
|
|
74
74
|
* The IR mirror (`bumbledb::ir`, 1:1): relations, fields, interiors, and
|
|
75
75
|
* params by NUMERIC id — the SDK resolves names through the manifest and
|
|
76
|
-
* sends ids; the bridge never sees names in queries.
|
|
76
|
+
* sends ids; the bridge never sees names in queries. Q1 is a tagged sum:
|
|
77
|
+
* CQ carries no rec; Reach carries `rec` by value.
|
|
77
78
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
type QueryIr =
|
|
80
|
+
| {
|
|
81
|
+
readonly kind: "cq"
|
|
82
|
+
readonly interiors: readonly InteriorIr[]
|
|
83
|
+
readonly head: readonly HeadTermIr[]
|
|
84
|
+
readonly rules: readonly RuleIr[]
|
|
85
|
+
}
|
|
86
|
+
| {
|
|
87
|
+
readonly kind: "reach"
|
|
88
|
+
readonly interiors: readonly InteriorIr[]
|
|
89
|
+
readonly rec: RecIr
|
|
90
|
+
readonly head: readonly HeadTermIr[]
|
|
91
|
+
readonly rules: readonly RuleIr[]
|
|
92
|
+
}
|
|
84
93
|
|
|
85
94
|
/** One named interior: the head shape its rules align against, and the rules. */
|
|
86
95
|
interface InteriorIr {
|
|
@@ -88,7 +97,7 @@ interface InteriorIr {
|
|
|
88
97
|
readonly rules: readonly RuleIr[]
|
|
89
98
|
}
|
|
90
99
|
|
|
91
|
-
/** The
|
|
100
|
+
/** The linear rec on a Reach query: shared head, base arms, rec arms. */
|
|
92
101
|
interface RecIr {
|
|
93
102
|
readonly head: readonly HeadTermIr[]
|
|
94
103
|
readonly base: readonly RuleIr[]
|
package/src/query/atom.ts
CHANGED
|
@@ -207,7 +207,7 @@ interface RecHead {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
|
-
* The
|
|
210
|
+
* The linear rec's runtime description — identity keys the dense
|
|
211
211
|
* `InteriorId` (`interiors.length`) at lowering. Base and rec arms are
|
|
212
212
|
* nonempty by type and sealed in one assignment.
|
|
213
213
|
*/
|