@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/dist/query/scope.js
CHANGED
|
@@ -1,134 +1,137 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Query scope terms
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
2
|
+
* Query scope terms, LAW-TYPED edition: string-named variables and
|
|
3
|
+
* parameters as plain frozen values. A `Var` is a NAME — it is typed by the
|
|
4
|
+
* field slot it first binds (the descriptor AND the slot's law-computed
|
|
5
|
+
* CLASS, read off the schema's class map through the rule builder's
|
|
6
|
+
* environment), reuse of the name within one rule IS the join, and a
|
|
7
|
+
* class-mismatched reuse is a compile error: a var joins only class-equal
|
|
8
|
+
* slots, and BARE PAIRS ONLY WITH BARE (ruling 3 — a slot in no law has no
|
|
9
|
+
* class and never joins a classed slot; the deliberate sum-domain pointer
|
|
10
|
+
* stays legal against other bare slots). Params are query-global by name
|
|
11
|
+
* and typed BY USE: the field position or comparison sibling that anchors
|
|
12
|
+
* a param types it, the query's inferred `Params` object is exactly the
|
|
13
|
+
* params the rules use, and a param value that no rule uses simply never
|
|
14
|
+
* registers — the query executes under its own inferred type (the
|
|
15
|
+
* bug-hunt law). This module also owns the environment/typing utilities
|
|
16
|
+
* the whole surface shares: the env shape (var name → classed slot), the
|
|
17
|
+
* class-equality judgment {@link JoinOk} with its runtime twin
|
|
18
|
+
* {@link fieldJoins}, and the record-folding helpers `Params` and `Row`
|
|
19
|
+
* inference ride.
|
|
14
20
|
*/
|
|
15
21
|
import * as errors from "@superbuilders/errors";
|
|
16
|
-
import { phantom } from "#brand.ts";
|
|
17
22
|
/**
|
|
18
23
|
* The runtime discriminant of query term values. Host literals (bigints,
|
|
19
|
-
* strings, interval objects
|
|
20
|
-
*
|
|
24
|
+
* strings, interval objects) never carry it, so "is this position a term
|
|
25
|
+
* or a literal" is one property probe, never a guess.
|
|
21
26
|
*/
|
|
22
27
|
const term = Symbol("bumbledb.query.term");
|
|
23
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* The carrier of a value's INFERRED types (a rule's row/params, a query's
|
|
30
|
+
* row/params, a rec's params). The property is never present at runtime —
|
|
31
|
+
* it exists so inference rides plain values without any brand on any
|
|
32
|
+
* field value.
|
|
33
|
+
*/
|
|
34
|
+
const inferred = Symbol("bumbledb.query.inferred");
|
|
35
|
+
/** Narrows an unknown position value to a scope term (vs a host literal). */
|
|
24
36
|
function isTerm(value) {
|
|
25
37
|
return typeof value === "object" && value !== null && term in value;
|
|
26
38
|
}
|
|
27
|
-
/**
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
vars: new Set(),
|
|
32
|
-
params: [],
|
|
33
|
-
paramIndex: new Map(),
|
|
34
|
-
predicates: []
|
|
35
|
-
};
|
|
39
|
+
/** Builds one variable term. */
|
|
40
|
+
function makeVar(name) {
|
|
41
|
+
const value = { [term]: "var", name };
|
|
42
|
+
return Object.freeze(value);
|
|
36
43
|
}
|
|
37
44
|
/**
|
|
38
|
-
* The
|
|
39
|
-
*
|
|
45
|
+
* The trusted seam of the vars mint: every requested name reads back as an
|
|
46
|
+
* own var term of exactly that name — verified before the record is
|
|
47
|
+
* admitted at the {@link VarsRecord} type (a name riding the
|
|
48
|
+
* object-protocol accessor instead of an own definition would fail exactly
|
|
49
|
+
* this check).
|
|
40
50
|
*/
|
|
41
|
-
function
|
|
42
|
-
return
|
|
51
|
+
function varsMinted(record, names) {
|
|
52
|
+
return names.every(function varMinted(name) {
|
|
53
|
+
if (!Object.hasOwn(record, name)) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const value = record[name];
|
|
57
|
+
return isTerm(value) && value[term] === "var" && value.name === name;
|
|
58
|
+
});
|
|
43
59
|
}
|
|
44
60
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
61
|
+
* Mints several variables at once — `const { service, w } = r.vars("service",
|
|
62
|
+
* "w")`: tuple-to-object, each name typed exactly (`Var<"service">`),
|
|
63
|
+
* inference identical to the one-at-a-time `r.var` spelling (one lowering,
|
|
64
|
+
* two entry flavors). Each key is defined as an OWN property (a name like
|
|
65
|
+
* `"__proto__"` is a record key like any other, never a prototype write),
|
|
66
|
+
* and a duplicate name in one call is a construction error: each name mints
|
|
67
|
+
* one variable — write it once and reuse the binding.
|
|
49
68
|
*/
|
|
50
|
-
function
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (fieldName === "id") {
|
|
57
|
-
return member.id.data;
|
|
69
|
+
function makeVars(...names) {
|
|
70
|
+
const out = {};
|
|
71
|
+
const seen = new Set();
|
|
72
|
+
for (const name of names) {
|
|
73
|
+
if (seen.has(name)) {
|
|
74
|
+
throw errors.new(`vars: duplicate name ${name} — each name mints one variable; write it once and reuse the binding`);
|
|
58
75
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
62
|
-
if (column === undefined) {
|
|
63
|
-
throw errors.new(`closed relation ${relationName} has no column ${fieldName}`);
|
|
64
|
-
}
|
|
65
|
-
return column.field;
|
|
76
|
+
seen.add(name);
|
|
77
|
+
Object.defineProperty(out, name, { value: makeVar(name), enumerable: true });
|
|
66
78
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (declared === undefined) {
|
|
71
|
-
throw errors.new(`relation ${relationName} has no field ${fieldName}`);
|
|
79
|
+
Object.freeze(out);
|
|
80
|
+
if (!varsMinted(out, names)) {
|
|
81
|
+
throw errors.new("vars: variable minting incomplete");
|
|
72
82
|
}
|
|
73
|
-
return
|
|
83
|
+
return out;
|
|
74
84
|
}
|
|
75
|
-
/**
|
|
76
|
-
function
|
|
77
|
-
const value =
|
|
78
|
-
|
|
79
|
-
relation: ref.relation,
|
|
80
|
-
field: ref.field,
|
|
81
|
-
data: resolveFieldData(registry.theory, ref.relation, ref.field)
|
|
82
|
-
});
|
|
83
|
-
registry.vars.add(value);
|
|
84
|
-
return value;
|
|
85
|
+
/** Builds one scalar-parameter term. */
|
|
86
|
+
function makeParam(name) {
|
|
87
|
+
const value = { [term]: "param", name };
|
|
88
|
+
return Object.freeze(value);
|
|
85
89
|
}
|
|
86
|
-
/**
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
});
|
|
91
|
-
if (taken) {
|
|
92
|
-
throw errors.new(`query scope already declares a param named ${name} — param names key the execute params object, one declaration each`);
|
|
93
|
-
}
|
|
90
|
+
/** Builds one set-parameter term. */
|
|
91
|
+
function makeSetParam(name) {
|
|
92
|
+
const value = { [term]: "setParam", name };
|
|
93
|
+
return Object.freeze(value);
|
|
94
94
|
}
|
|
95
|
-
/**
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const value = Object.freeze({
|
|
100
|
-
[term]: "param",
|
|
101
|
-
name,
|
|
102
|
-
relation: ref.relation,
|
|
103
|
-
field: ref.field,
|
|
104
|
-
data
|
|
105
|
-
});
|
|
106
|
-
registry.paramIndex.set(value, registry.params.length);
|
|
107
|
-
registry.params.push(Object.freeze({ name, shape: "value", data }));
|
|
108
|
-
return value;
|
|
95
|
+
/** Builds one Allen-mask-parameter term. */
|
|
96
|
+
function makeMaskParam(name) {
|
|
97
|
+
const value = { [term]: "maskParam", name };
|
|
98
|
+
return Object.freeze(value);
|
|
109
99
|
}
|
|
110
|
-
/**
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
100
|
+
/** Builds one measure term over an interval-typed variable's name. */
|
|
101
|
+
function makeDuration(name) {
|
|
102
|
+
const value = { [term]: "duration", name };
|
|
103
|
+
return Object.freeze(value);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The runtime twin of {@link JoinOk}: two bound slots join iff descriptor
|
|
107
|
+
* structure and class agree — the same comparison the type tier makes,
|
|
108
|
+
* judged on the honest runtime values (the descriptor and the schema
|
|
109
|
+
* value's frozen class map). The rule builders throw through this on a
|
|
110
|
+
* class-unequal variable reuse, so the wall holds for untyped callers too,
|
|
111
|
+
* not only where the compiler can see.
|
|
112
|
+
*/
|
|
113
|
+
function fieldJoins(a, b) {
|
|
114
|
+
const widthA = "width" in a.field ? a.field.width : undefined;
|
|
115
|
+
const widthB = "width" in b.field ? b.field.width : undefined;
|
|
116
|
+
const elementA = "element" in a.field ? a.field.element : undefined;
|
|
117
|
+
const elementB = "element" in b.field ? b.field.element : undefined;
|
|
118
|
+
return a.field.kind === b.field.kind && a.class === b.class && widthA === widthB && elementA === elementB;
|
|
124
119
|
}
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Renders one bound slot for join-mismatch diagnostics — the structural
|
|
122
|
+
* kind in the schema grammar's spelling plus the slot's law-computed class
|
|
123
|
+
* (`u64 in class Holder.id`; a lawless slot renders `bare`).
|
|
124
|
+
*/
|
|
125
|
+
function renderFieldKind(slot) {
|
|
126
|
+
const field = slot.field;
|
|
127
|
+
let base = field.kind;
|
|
128
|
+
if (field.kind === "bytes") {
|
|
129
|
+
base = `bytes<${field.width}>`;
|
|
130
|
+
}
|
|
131
|
+
if (field.kind === "interval") {
|
|
132
|
+
base = field.width === undefined ? `interval<${field.element}>` : `interval<${field.element}, ${field.width}>`;
|
|
133
|
+
}
|
|
134
|
+
return slot.class === undefined ? `${base} (bare)` : `${base} in class ${slot.class}`;
|
|
132
135
|
}
|
|
133
|
-
export {
|
|
136
|
+
export { fieldJoins, inferred, isTerm, makeDuration, makeMaskParam, makeParam, makeSetParam, makeVar, makeVars, renderFieldKind, term };
|
|
134
137
|
//# sourceMappingURL=scope.js.map
|
package/dist/query/scope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/query/scope.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/query/scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAG/C;;;;GAIG;AACH,MAAM,IAAI,GAAkB,MAAM,CAAC,qBAAqB,CAAC,CAAA;AAEzD;;;;;GAKG;AACH,MAAM,QAAQ,GAAkB,MAAM,CAAC,yBAAyB,CAAC,CAAA;AAgEjE,6EAA6E;AAC7E,SAAS,MAAM,CAAC,KAAc;IAC7B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,IAAI,KAAK,CAAA;AACpE,CAAC;AAED,gCAAgC;AAChC,SAAS,OAAO,CAA4B,IAAU;IACrD,MAAM,KAAK,GAAc,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC;AAKD;;;;;;GAMG;AACH,SAAS,UAAU,CAClB,MAAyC,EACzC,KAAuB;IAEvB,OAAO,KAAK,CAAC,KAAK,CAAC,SAAS,SAAS,CAAC,IAAI;QACzC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;YAClC,OAAO,KAAK,CAAA;QACb,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;QAC1B,OAAO,MAAM,CAAC,KAA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AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,IAAkB;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IACxB,IAAI,IAAI,GAAW,KAAK,CAAC,IAAI,CAAA;IAC7B,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,IAAI,GAAG,SAAS,KAAK,CAAC,KAAK,GAAG,CAAA;IAC/B,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,IAAI,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,KAAK,GAAG,CAAA;IAC/G,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,aAAa,IAAI,CAAC,KAAK,EAAE,CAAA;AACtF,CAAC;AAiDD,OAAO,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,aAAa,EACb,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,CAAA"}
|
package/dist/query/select.d.ts
CHANGED
|
@@ -1,86 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Select entries and aggregates
|
|
3
|
-
* the IR's aggregate roster exactly
|
|
4
|
-
* `
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* maximal segment), the result
|
|
2
|
+
* Select entries and aggregates, STRUCTURAL edition — the head vocabulary,
|
|
3
|
+
* mirroring the IR's aggregate roster exactly
|
|
4
|
+
* (`bumbledb/crates/bumbledb/src/ir.rs` `AggOp`/`FindTerm`;
|
|
5
|
+
* `docs/architecture/20-query-ir.md` § aggregation): `count` (nullary),
|
|
6
|
+
* `countDistinct`, `sum`/`min`/`max` (over an orderable variable or the
|
|
7
|
+
* measure), `argMax`/`argMin` (arg-restriction: carried value + orderable
|
|
8
|
+
* key; a tie yields every attaining row), and `pack` (the coalescing fold —
|
|
9
|
+
* RELATION-SHAPED: one answer row per (group, maximal segment), the result
|
|
10
|
+
* position interval-typed). Aggregates name their variables — `r.sum("m")`
|
|
11
|
+
* — and are typed by the rule environment at `.select`. Grouping is
|
|
10
12
|
* implicit: the non-aggregate select entries are the group key; over empty
|
|
11
13
|
* input an all-aggregate select yields the EMPTY SET, never a zero row.
|
|
14
|
+
* The creation quarantine is representational: a head position is a var
|
|
15
|
+
* name, the measure, or an aggregate — no minting or arithmetic term
|
|
16
|
+
* exists to spell (permanent law).
|
|
12
17
|
*/
|
|
13
|
-
import type {
|
|
14
|
-
import {
|
|
15
|
-
import type { Duration } from "#query/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/** The three folds the measure admits (and the plain-variable folds). */
|
|
19
|
-
type FoldOp = "sum" | "min" | "max";
|
|
20
|
-
/** One aggregate's runtime description. */
|
|
21
|
-
type AggregateData = {
|
|
22
|
-
readonly op: "count";
|
|
23
|
-
} | {
|
|
24
|
-
readonly op: "countDistinct";
|
|
25
|
-
readonly over: AnyVar;
|
|
26
|
-
} | {
|
|
27
|
-
readonly op: "fold";
|
|
28
|
-
readonly fold: FoldOp;
|
|
29
|
-
readonly over: AnyVar | Duration;
|
|
30
|
-
} | {
|
|
31
|
-
readonly op: "arg";
|
|
32
|
-
readonly direction: "argMax" | "argMin";
|
|
33
|
-
readonly key: AnyVar;
|
|
34
|
-
readonly over: AnyVar;
|
|
35
|
-
} | {
|
|
36
|
-
readonly op: "pack";
|
|
37
|
-
readonly over: AnyVar;
|
|
38
|
-
};
|
|
18
|
+
import type { Infer } from "#fields.ts";
|
|
19
|
+
import type { IntervalVarOk, OrderVarOk } from "#query/atom.ts";
|
|
20
|
+
import type { Duration, EnvShape, ShapeOf } from "#query/scope.ts";
|
|
21
|
+
/** One aggregate operator name of the select vocabulary. */
|
|
22
|
+
type AggOpName = "count" | "countDistinct" | "sum" | "min" | "max" | "argMax" | "argMin" | "pack";
|
|
39
23
|
/**
|
|
40
|
-
* One aggregate select
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
24
|
+
* One aggregate select VALUE: the op, the variable name (or measure) it
|
|
25
|
+
* folds, and — for the Arg forms — the orderable key's variable name. The
|
|
26
|
+
* runtime representation carries the types; the rule environment types the
|
|
27
|
+
* result at `.select`.
|
|
44
28
|
*/
|
|
45
|
-
interface
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
29
|
+
interface Agg<Op extends AggOpName, Over extends string | Duration<string> | undefined, Key extends string | undefined = undefined> {
|
|
30
|
+
readonly agg: Op;
|
|
31
|
+
readonly over: Over;
|
|
32
|
+
readonly key: Key;
|
|
48
33
|
}
|
|
49
|
-
/**
|
|
50
|
-
type
|
|
51
|
-
/**
|
|
52
|
-
type
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} ? Exclude<R, undefined> : T extends {
|
|
58
|
-
readonly measure: AnyVar;
|
|
59
|
-
} ? bigint : T extends {
|
|
60
|
-
readonly [term]: "var";
|
|
61
|
-
readonly [phantom]?: infer V;
|
|
62
|
-
} ? Exclude<V, undefined> : never;
|
|
63
|
-
/** The inferred answer-row object type of a select record. */
|
|
64
|
-
type RowOf<Sel extends SelectShape> = Flatten<{
|
|
65
|
-
[K in keyof Sel]: SelectValue<Sel[K]>;
|
|
66
|
-
}>;
|
|
67
|
-
/** Nullary count: |the group's set of distinct full bindings|, `bigint`. */
|
|
68
|
-
declare function count(): Aggregate<bigint>;
|
|
69
|
-
/** |the distinct values of `over` across the group|, `bigint`; legal over every type. */
|
|
70
|
-
declare function countDistinct<V>(over: Var<V>): Aggregate<bigint>;
|
|
34
|
+
/** Any aggregate select value. */
|
|
35
|
+
type AnyAgg = Agg<AggOpName, string | Duration<string> | undefined, string | undefined>;
|
|
36
|
+
/** One select entry: a projected var name, the measure, or an aggregate. */
|
|
37
|
+
type SelectEntry = string | Duration<string> | AnyAgg;
|
|
38
|
+
/** Nullary count: |the group's set of distinct full bindings|, `bigint`; the answer column is named `count`. */
|
|
39
|
+
declare function count(): Agg<"count", undefined>;
|
|
40
|
+
/** |the distinct values of the named variable across the group|, `bigint`; legal over every type. */
|
|
41
|
+
declare function countDistinct<const N extends string>(over: N): Agg<"countDistinct", N>;
|
|
71
42
|
/**
|
|
72
|
-
* Exact checked sum over
|
|
73
|
-
* finalize range check
|
|
74
|
-
* never a wrap
|
|
43
|
+
* Exact checked sum over an orderable (u64/i64) variable — wide
|
|
44
|
+
* accumulator, one finalize range check; overflow is the engine's typed
|
|
45
|
+
* runtime error, never a wrap — or over the measure
|
|
46
|
+
* (`r.sum(r.duration("w"))`).
|
|
75
47
|
*/
|
|
76
|
-
declare function sum<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
declare function
|
|
81
|
-
/** Maximum over a u64/i64 variable or the measure (orderable types only). */
|
|
82
|
-
declare function max<V extends bigint>(over: Var<V>): Aggregate<V>;
|
|
83
|
-
declare function max(over: Duration): Aggregate<bigint>;
|
|
48
|
+
declare function sum<const N extends string | Duration<string>>(over: N): Agg<"sum", N>;
|
|
49
|
+
/** Minimum over an orderable variable or the measure (orderable types only). */
|
|
50
|
+
declare function min<const N extends string | Duration<string>>(over: N): Agg<"min", N>;
|
|
51
|
+
/** Maximum over an orderable variable or the measure (orderable types only). */
|
|
52
|
+
declare function max<const N extends string | Duration<string>>(over: N): Agg<"max", N>;
|
|
84
53
|
/**
|
|
85
54
|
* Arg-restriction toward the maximum of `key` (`ir::AggOp::ArgMax`): the
|
|
86
55
|
* group's binding set is restricted to the bindings attaining the extreme
|
|
@@ -89,9 +58,9 @@ declare function max(over: Duration): Aggregate<bigint>;
|
|
|
89
58
|
* direction; Arg and fold aggregates never mix (both the engine's typed
|
|
90
59
|
* rules).
|
|
91
60
|
*/
|
|
92
|
-
declare function
|
|
93
|
-
/** Arg-restriction toward the minimum of `key`; rules as {@link
|
|
94
|
-
declare function
|
|
61
|
+
declare function argMax<const V extends string, const K extends string>(value: V, key: K): Agg<"argMax", V, K>;
|
|
62
|
+
/** Arg-restriction toward the minimum of `key`; rules as {@link argMax}. */
|
|
63
|
+
declare function argMin<const V extends string, const K extends string>(value: V, key: K): Agg<"argMin", V, K>;
|
|
95
64
|
/**
|
|
96
65
|
* The coalescing fold (Snodgrass coalesce, `ir::AggOp::Pack`): per group,
|
|
97
66
|
* the maximal disjoint half-open segments of the union of the group's
|
|
@@ -100,7 +69,60 @@ declare function argmin<K extends bigint, V>(key: Var<K>, value: Var<V>): Aggreg
|
|
|
100
69
|
* input's element type. At most one `pack` per select, never beside a
|
|
101
70
|
* fold or an Arg entry (the engine's typed rules).
|
|
102
71
|
*/
|
|
103
|
-
declare function pack<
|
|
104
|
-
|
|
105
|
-
|
|
72
|
+
declare function pack<const N extends string>(over: N): Agg<"pack", N>;
|
|
73
|
+
/** A fold input's judgment: an orderable variable, or the measure of an interval variable. */
|
|
74
|
+
type FoldOverOk<Env extends EnvShape, O> = O extends string ? OrderVarOk<Env, O> : O extends Duration<infer N extends string> ? IntervalVarOk<Env, N> : false;
|
|
75
|
+
/**
|
|
76
|
+
* One select entry's judgment against the rule environment: projected
|
|
77
|
+
* names must be bound, the measure and `pack` demand interval-typed
|
|
78
|
+
* variables, folds and Arg keys demand orderable ones.
|
|
79
|
+
*/
|
|
80
|
+
type SelectEntryOk<Env extends EnvShape, E> = E extends string ? E extends keyof Env ? true : false : E extends Duration<infer N extends string> ? IntervalVarOk<Env, N> : E extends Agg<"count", undefined> ? true : E extends Agg<"countDistinct", infer O extends string> ? O extends keyof Env ? true : false : E extends Agg<"sum" | "min" | "max", infer O> ? FoldOverOk<Env, O> : E extends Agg<"argMax" | "argMin", infer O extends string, infer K extends string> ? [O extends keyof Env ? true : false, OrderVarOk<Env, K>] extends [true, true] ? true : false : E extends Agg<"pack", infer O extends string> ? IntervalVarOk<Env, O> : false;
|
|
81
|
+
/** The validated select tuple (intersect with the inferred entries — errors land on the offending argument). */
|
|
82
|
+
type CheckSelect<Env extends EnvShape, S> = {
|
|
83
|
+
readonly [I in keyof S]: SelectEntryOk<Env, S[I]> extends true ? S[I] : never;
|
|
84
|
+
};
|
|
85
|
+
/** The validated names-only select tuple of a RECURSIVE rule (aggregates and the measure are unwritable there). */
|
|
86
|
+
type CheckNameSelect<Env extends EnvShape, S> = {
|
|
87
|
+
readonly [I in keyof S]: S[I] extends keyof Env ? S[I] : never;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* One select entry's answer-column fragment: the column is named by the
|
|
91
|
+
* variable it projects or folds (`count` names its column `count`), and
|
|
92
|
+
* its type reflects the entry — `count`/`countDistinct` are `bigint`
|
|
93
|
+
* whatever they counted, folds carry their input's type, the measure is
|
|
94
|
+
* `bigint`, the Arg forms carry the payload's type, `pack` its interval
|
|
95
|
+
* type.
|
|
96
|
+
*/
|
|
97
|
+
type SelectEntryRow<Env extends EnvShape, E> = E extends string ? {
|
|
98
|
+
readonly [K in E]: Infer<Env[E & keyof Env]["field"]>;
|
|
99
|
+
} : E extends Duration<infer N extends string> ? {
|
|
100
|
+
readonly [K in N]: bigint;
|
|
101
|
+
} : E extends Agg<"count", undefined> ? {
|
|
102
|
+
readonly count: bigint;
|
|
103
|
+
} : E extends Agg<"countDistinct", infer O extends string> ? {
|
|
104
|
+
readonly [K in O]: bigint;
|
|
105
|
+
} : E extends Agg<"sum" | "min" | "max", infer O> ? O extends string ? {
|
|
106
|
+
readonly [K in O]: Infer<Env[O & keyof Env]["field"]>;
|
|
107
|
+
} : O extends Duration<infer N extends string> ? {
|
|
108
|
+
readonly [K in N]: bigint;
|
|
109
|
+
} : never : E extends Agg<"argMax" | "argMin", infer O extends string, string> ? {
|
|
110
|
+
readonly [K in O]: Infer<Env[O & keyof Env]["field"]>;
|
|
111
|
+
} : E extends Agg<"pack", infer O extends string> ? {
|
|
112
|
+
readonly [K in O]: Infer<Env[O & keyof Env]["field"]>;
|
|
113
|
+
} : never;
|
|
114
|
+
/** The inferred answer-row object type of a select tuple. */
|
|
115
|
+
type RowOfSelect<Env extends EnvShape, S extends readonly SelectEntry[]> = ShapeOf<SelectEntryRow<Env, S[number]>>;
|
|
116
|
+
/**
|
|
117
|
+
* One projected name's answer-column fragment — a NAKED parameter, so the
|
|
118
|
+
* judgment distributes per name (the union of a multi-name select never
|
|
119
|
+
* smears into one column's type), mirroring {@link SelectEntryRow}.
|
|
120
|
+
*/
|
|
121
|
+
type NameSelectRow<Env extends EnvShape, N> = N extends string ? {
|
|
122
|
+
readonly [K in N]: Infer<Env[K & keyof Env]["field"]>;
|
|
123
|
+
} : never;
|
|
124
|
+
/** The inferred answer-row object type of a names-only (recursive-rule) select tuple. */
|
|
125
|
+
type RowOfNameSelect<Env extends EnvShape, S extends readonly string[]> = ShapeOf<NameSelectRow<Env, S[number]>>;
|
|
126
|
+
export type { Agg, AggOpName, AnyAgg, CheckNameSelect, CheckSelect, RowOfNameSelect, RowOfSelect, SelectEntry, SelectEntryOk, SelectEntryRow };
|
|
127
|
+
export { argMax, argMin, count, countDistinct, max, min, pack, sum };
|
|
106
128
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/query/select.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/query/select.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,i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