@bjornpagen/bumbledb 1.0.1 → 1.2.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.
Files changed (172) hide show
  1. package/COOKBOOK.md +176 -36
  2. package/README.md +70 -26
  3. package/dist/capacity.d.ts +15 -55
  4. package/dist/capacity.d.ts.map +1 -1
  5. package/dist/capacity.js +63 -12
  6. package/dist/capacity.js.map +1 -1
  7. package/dist/changes.d.ts +28 -6
  8. package/dist/changes.d.ts.map +1 -1
  9. package/dist/changes.js +119 -71
  10. package/dist/changes.js.map +1 -1
  11. package/dist/closed.d.ts +23 -51
  12. package/dist/closed.d.ts.map +1 -1
  13. package/dist/closed.js +110 -168
  14. package/dist/closed.js.map +1 -1
  15. package/dist/codec.d.ts +8 -14
  16. package/dist/codec.d.ts.map +1 -1
  17. package/dist/codec.js +113 -188
  18. package/dist/codec.js.map +1 -1
  19. package/dist/compile.d.ts +17 -18
  20. package/dist/compile.d.ts.map +1 -1
  21. package/dist/compile.js +41 -20
  22. package/dist/compile.js.map +1 -1
  23. package/dist/db-native.d.ts +76 -41
  24. package/dist/db-native.d.ts.map +1 -1
  25. package/dist/db-native.js +8 -0
  26. package/dist/db-native.js.map +1 -1
  27. package/dist/db.d.ts +61 -26
  28. package/dist/db.d.ts.map +1 -1
  29. package/dist/db.js +152 -85
  30. package/dist/db.js.map +1 -1
  31. package/dist/errors.d.ts +11 -3
  32. package/dist/errors.d.ts.map +1 -1
  33. package/dist/errors.js +13 -1
  34. package/dist/errors.js.map +1 -1
  35. package/dist/face.d.ts +19 -25
  36. package/dist/face.d.ts.map +1 -1
  37. package/dist/face.js +30 -24
  38. package/dist/face.js.map +1 -1
  39. package/dist/fields.d.ts +13 -26
  40. package/dist/fields.d.ts.map +1 -1
  41. package/dist/fields.js +89 -116
  42. package/dist/fields.js.map +1 -1
  43. package/dist/immutable.d.ts +10 -0
  44. package/dist/immutable.d.ts.map +1 -0
  45. package/dist/immutable.js +75 -0
  46. package/dist/immutable.js.map +1 -0
  47. package/dist/index.d.ts +16 -12
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +6 -4
  50. package/dist/index.js.map +1 -1
  51. package/dist/internal/log.d.ts +6 -4
  52. package/dist/internal/log.d.ts.map +1 -1
  53. package/dist/internal/log.js +3 -1
  54. package/dist/internal/log.js.map +1 -1
  55. package/dist/law.d.ts +11 -11
  56. package/dist/law.d.ts.map +1 -1
  57. package/dist/law.js +1 -1
  58. package/dist/law.js.map +1 -1
  59. package/dist/lower.d.ts.map +1 -1
  60. package/dist/lower.js +11 -6
  61. package/dist/lower.js.map +1 -1
  62. package/dist/migration.d.ts +2 -3
  63. package/dist/migration.d.ts.map +1 -1
  64. package/dist/migration.js +5 -5
  65. package/dist/migration.js.map +1 -1
  66. package/dist/native.d.ts +2 -2
  67. package/dist/native.d.ts.map +1 -1
  68. package/dist/native.js.map +1 -1
  69. package/dist/query/atom.d.ts +1 -1
  70. package/dist/query/atom.d.ts.map +1 -1
  71. package/dist/query/atom.js.map +1 -1
  72. package/dist/query/description.d.ts +33 -0
  73. package/dist/query/description.d.ts.map +1 -0
  74. package/dist/query/description.js +302 -0
  75. package/dist/query/description.js.map +1 -0
  76. package/dist/query/lower.d.ts +60 -4
  77. package/dist/query/lower.d.ts.map +1 -1
  78. package/dist/query/lower.js +126 -161
  79. package/dist/query/lower.js.map +1 -1
  80. package/dist/query/parse-ir.d.ts +7 -2
  81. package/dist/query/parse-ir.d.ts.map +1 -1
  82. package/dist/query/parse-ir.js +240 -53
  83. package/dist/query/parse-ir.js.map +1 -1
  84. package/dist/query/run.d.ts.map +1 -1
  85. package/dist/query/run.js +8 -10
  86. package/dist/query/run.js.map +1 -1
  87. package/dist/query/scope.d.ts +3 -4
  88. package/dist/query/scope.d.ts.map +1 -1
  89. package/dist/query/scope.js +5 -10
  90. package/dist/query/scope.js.map +1 -1
  91. package/dist/relation.d.ts +22 -48
  92. package/dist/relation.d.ts.map +1 -1
  93. package/dist/relation.js +30 -82
  94. package/dist/relation.js.map +1 -1
  95. package/dist/result.d.ts +10 -25
  96. package/dist/result.d.ts.map +1 -1
  97. package/dist/result.js +7 -12
  98. package/dist/result.js.map +1 -1
  99. package/dist/rows.d.ts +11 -14
  100. package/dist/rows.d.ts.map +1 -1
  101. package/dist/rows.js +49 -237
  102. package/dist/rows.js.map +1 -1
  103. package/dist/runtime-codes.d.ts +1 -1
  104. package/dist/runtime-codes.d.ts.map +1 -1
  105. package/dist/runtime-codes.js +1 -2
  106. package/dist/runtime-codes.js.map +1 -1
  107. package/dist/runtime-errors.d.ts +27 -15
  108. package/dist/runtime-errors.d.ts.map +1 -1
  109. package/dist/runtime-errors.js +44 -8
  110. package/dist/runtime-errors.js.map +1 -1
  111. package/dist/runtime-native.d.ts +16 -34
  112. package/dist/runtime-native.d.ts.map +1 -1
  113. package/dist/runtime-native.js.map +1 -1
  114. package/dist/runtime.d.ts +11 -28
  115. package/dist/runtime.d.ts.map +1 -1
  116. package/dist/runtime.js +14 -54
  117. package/dist/runtime.js.map +1 -1
  118. package/dist/schema.d.ts +9 -1
  119. package/dist/schema.d.ts.map +1 -1
  120. package/dist/schema.js +85 -24
  121. package/dist/schema.js.map +1 -1
  122. package/dist/selection.d.ts +27 -0
  123. package/dist/selection.d.ts.map +1 -0
  124. package/dist/selection.js +104 -0
  125. package/dist/selection.js.map +1 -0
  126. package/dist/shape.d.ts +6 -9
  127. package/dist/shape.d.ts.map +1 -1
  128. package/dist/statements.d.ts +17 -52
  129. package/dist/statements.d.ts.map +1 -1
  130. package/dist/statements.js +92 -111
  131. package/dist/statements.js.map +1 -1
  132. package/dist/values.d.ts +25 -0
  133. package/dist/values.d.ts.map +1 -0
  134. package/dist/values.js +203 -0
  135. package/dist/values.js.map +1 -0
  136. package/pack-provenance.json +3 -3
  137. package/package.json +4 -4
  138. package/src/capacity.ts +86 -76
  139. package/src/changes.ts +225 -94
  140. package/src/closed.ts +161 -314
  141. package/src/codec.ts +123 -213
  142. package/src/compile.ts +61 -38
  143. package/src/db-native.ts +73 -68
  144. package/src/db.ts +268 -165
  145. package/src/errors.ts +16 -1
  146. package/src/face.ts +44 -74
  147. package/src/fields.ts +100 -146
  148. package/src/immutable.ts +76 -0
  149. package/src/index.ts +38 -31
  150. package/src/internal/log.ts +4 -5
  151. package/src/law.ts +14 -14
  152. package/src/lower.ts +13 -10
  153. package/src/migration.ts +5 -12
  154. package/src/native.ts +2 -1
  155. package/src/query/atom.ts +1 -0
  156. package/src/query/description.ts +394 -0
  157. package/src/query/lower.ts +139 -173
  158. package/src/query/parse-ir.ts +247 -54
  159. package/src/query/run.ts +15 -9
  160. package/src/query/scope.ts +10 -18
  161. package/src/relation.ts +58 -142
  162. package/src/result.ts +16 -45
  163. package/src/rows.ts +57 -250
  164. package/src/runtime-codes.ts +1 -2
  165. package/src/runtime-errors.ts +48 -8
  166. package/src/runtime-native.ts +13 -46
  167. package/src/runtime.ts +51 -119
  168. package/src/schema.ts +99 -29
  169. package/src/selection.ts +124 -0
  170. package/src/shape.ts +9 -9
  171. package/src/statements.ts +138 -189
  172. package/src/values.ts +223 -0
package/src/index.ts CHANGED
@@ -16,39 +16,35 @@ export type {
16
16
  WeightOnSource
17
17
  } from "#capacity.ts"
18
18
  export { duration, ref, weigh, within } from "#capacity.ts"
19
- export type { ChangeDraft } from "#changes.ts"
19
+ export type { ChangeCounts, ChangeDraft, ChangeRecord } from "#changes.ts"
20
20
  export { ChangeSet } from "#changes.ts"
21
21
  export type {
22
22
  AnyClosed,
23
- AnySelectedClosed,
24
23
  AxiomRow,
25
24
  Axioms,
26
25
  Closed,
27
- ClosedColumn,
28
- ClosedCore,
29
- ClosedData,
30
- ClosedRow,
31
- ClosedSelectionInput,
32
- PayloadField,
33
- SelectedClosed
26
+ PayloadField
34
27
  } from "#closed.ts"
35
- export { closed } from "#closed.ts"
28
+ export { closed, closedId } from "#closed.ts"
36
29
  export type { RowShape } from "#codec.ts"
37
30
  export { decodeBoundaryRows, decodeRows, encodeBoundaryRows, encodeRows, rowSchema, rowShape } from "#codec.ts"
38
31
  export type { CompiledSchema, SchemaId } from "#compile.ts"
39
32
  export { Schema } from "#compile.ts"
40
33
  export type {
41
- ApplyExpected,
42
- ApplyOptions,
43
34
  ApplyOutcome,
44
35
  CoreWitness,
45
36
  DbInspection,
46
- ExecutionSession,
37
+ JudgeOutcome,
38
+ PreparedQuery,
47
39
  QueryReader,
48
- Snapshot
40
+ Snapshot,
41
+ StorageInspection,
42
+ WriteExpected,
43
+ WriteOptions
49
44
  } from "#db.ts"
50
45
  export { Db } from "#db.ts"
51
46
  export {
47
+ AuthoringDiagnostic,
52
48
  AuthoringError,
53
49
  NativeLoadError,
54
50
  NativeOperationError,
@@ -60,7 +56,6 @@ export type {
60
56
  Arity,
61
57
  Face,
62
58
  FaceArityMismatch,
63
- FaceData,
64
59
  FaceFields,
65
60
  FaceOwner,
66
61
  FaceShapeMismatch,
@@ -93,14 +88,32 @@ export type {
93
88
  U64Field,
94
89
  UuidField
95
90
  } from "#fields.ts"
96
- export { bool, bytes, f64, i64, interval, span, str, u64, uuid } from "#fields.ts"
91
+ export { bool, bytes, f64, i64, interval, str, u64, uuid } from "#fields.ts"
97
92
  export type { Same, SameLen } from "#judgment.ts"
98
93
  export type { ClassesOf, ClassWall, LawfulStatements, RelationClasses, SchemaClasses } from "#law.ts"
99
- export type { Violation, ViolationFact } from "#native.ts"
94
+ export type {
95
+ AtomIr,
96
+ AtomSourceIr,
97
+ CmpOpIr,
98
+ ComparisonIr,
99
+ ConditionTreeIr,
100
+ FindTermIr,
101
+ HeadTermIr,
102
+ InteriorIr,
103
+ QueryIr,
104
+ RecIr,
105
+ RuleIr,
106
+ ScalarExprIr,
107
+ TermIr,
108
+ Violation,
109
+ ViolationFact
110
+ } from "#native.ts"
100
111
  export type { FindColumn } from "#query/atom.ts"
101
112
  export { ALLEN } from "#query/atom.ts"
102
113
  export type { AnyComputeExpr, ComputeExpr, ComputeValue, QueryNode } from "#query/compute.ts"
103
114
  export { Compute } from "#query/compute.ts"
115
+ export type { DescriptionParameter, DescriptionRow, DescriptionTable, QueryDescription } from "#query/description.ts"
116
+ export { describeQuery, queryFromDescription } from "#query/description.ts"
104
117
  export type { Agg, RowOfFind } from "#query/find.ts"
105
118
  export type {
106
119
  AnyQuery,
@@ -135,22 +148,17 @@ export type {
135
148
  export { v } from "#query/scope.ts"
136
149
  export type {
137
150
  AnyRelation,
138
- AnySelected,
139
151
  Fact,
140
152
  FieldsShape,
141
153
  Relation,
142
- RelationData,
143
154
  RelationField,
144
- RelationFields,
145
- Selected,
146
- SelectionBinding,
147
- SelectionInput
155
+ RelationFields
148
156
  } from "#relation.ts"
149
157
  export { relation } from "#relation.ts"
150
158
  export type { CompleteResult } from "#result.ts"
151
159
  export type { CellValue } from "#rows.ts"
152
- export { cellBytes, cellOf, factOfCells, flatRowsOf, keyCellsOf } from "#rows.ts"
153
- export type { ExecutionPolicy, NativeRuntimeOptions } from "#runtime.ts"
160
+ export { cellOf, factOfCells, flatRowsOf, keyCellsOf } from "#rows.ts"
161
+ export type { NativeRuntimeOptions } from "#runtime.ts"
154
162
  export { NativeRuntime } from "#runtime.ts"
155
163
  export type { CloseReport, OutstandingWork } from "#runtime-errors.ts"
156
164
  export { CloseFailure, DbError, dbError, runtimeErrorCodes } from "#runtime-errors.ts"
@@ -168,6 +176,8 @@ export type {
168
176
  export { Scalar } from "#scalar.ts"
169
177
  export type { AnySchema, Schema as SchemaDeclaration, SchemaRelation, SchemaRelations } from "#schema.ts"
170
178
  export { schema } from "#schema.ts"
179
+ export type { AnySelected, FieldsOf, Selected, SelectionBinding, SelectionInput } from "#selection.ts"
180
+ export { select } from "#selection.ts"
171
181
  export type { Key, QueryTemplate, Rel } from "#shape.ts"
172
182
  export type {
173
183
  CapacityBoundSpec,
@@ -184,14 +194,11 @@ export type {
184
194
  ValueTypeSpec
185
195
  } from "#spec.ts"
186
196
  export type {
187
- CapacityData,
188
197
  CapacityStatement,
189
- ContainedStatement,
190
- ContainmentData,
191
- KeyData,
198
+ ContainmentStatement,
192
199
  KeyStatement,
193
- Statement,
194
- StatementData
200
+ MirrorsStatement,
201
+ Statement
195
202
  } from "#statements.ts"
196
203
  export { capacity, contained, key, mirrors, renderStatement } from "#statements.ts"
197
204
  export { Uuid } from "#uuid.ts"
@@ -8,7 +8,7 @@ export type { ChangeDraft } from "#changes.ts"
8
8
  export { ChangeSet, internalChanges } from "#changes.ts"
9
9
  export type { CompiledSchema, SchemaId } from "#compile.ts"
10
10
  export { Schema } from "#compile.ts"
11
- export type { ExecutionSession, QueryReader } from "#db.ts"
11
+ export type { PreparedQuery, QueryReader } from "#db.ts"
12
12
  export { Db, internalPublishedReader } from "#db.ts"
13
13
  export type { SnapshotHandle } from "#db-native.ts"
14
14
  export { lower } from "#lower.ts"
@@ -21,16 +21,15 @@ export {
21
21
  nativeBindingIsLoaded
22
22
  } from "#native.ts"
23
23
  export type { CompleteResult } from "#result.ts"
24
- export type { ExecutionPolicy, NativeRuntimeOptions, RepositoryLock } from "#runtime.ts"
24
+ export { factCellsOf } from "#rows.ts"
25
+ export type { NativeRuntimeOptions, RepositoryLock } from "#runtime.ts"
25
26
  export {
26
- deliveryResultBytes,
27
27
  finalizeClose,
28
28
  hashChunk,
29
29
  internalAcquireRepositoryLock,
30
30
  NativeRuntime,
31
31
  nativeOperation,
32
32
  nativeOperationWith,
33
- policyWire,
34
33
  runtimeHandle
35
34
  } from "#runtime.ts"
36
35
  export type { CloseReport, OutstandingWork } from "#runtime-errors.ts"
@@ -42,8 +41,8 @@ export type {
42
41
  InspectionWire,
43
42
  NativeKind,
44
43
  OperationHandle,
45
- PolicyWire,
46
44
  RepositoryLockHandle,
47
45
  RuntimeHandle
48
46
  } from "#runtime-native.ts"
49
47
  export { runtimeNative } from "#runtime-native.ts"
48
+ export { schemasAgree } from "#schema.ts"
package/src/law.ts CHANGED
@@ -50,7 +50,7 @@ import { AuthoringError } from "#errors.ts"
50
50
  * widened type) — the runtime map stays complete and authoritative, and
51
51
  * the wire lowering reads only the runtime map. Every loop below is
52
52
  * tail-recursive with an accumulator, so the machinery rides TypeScript's
53
- * tail-recursion elimination at primer scale (~40 relations, ~200 slots,
53
+ * tail-recursion elimination for large schemas (~40 relations, ~200 slots,
54
54
  * ~123 statements); should a schema ever exceed the compiler's limits, tsc
55
55
  * fails LOUDLY with its own instantiation-depth error — the map is never
56
56
  * silently widened.
@@ -58,7 +58,7 @@ import { AuthoringError } from "#errors.ts"
58
58
 
59
59
  import type { AnyClosed } from "#closed.ts"
60
60
  import { isClosedMember, sealedFieldsOf } from "#closed.ts"
61
- import type { FaceData } from "#face.ts"
61
+ import type { AnyFace } from "#face.ts"
62
62
  import type { Same } from "#judgment.ts"
63
63
  import type { AnyRelation, RelationFields } from "#relation.ts"
64
64
  import type { SchemaRelation, SchemaRelations } from "#schema.ts"
@@ -104,9 +104,9 @@ type ZipCoords<
104
104
  : Acc
105
105
  : Acc
106
106
 
107
- type StatementPairs<St extends Statement> = St["data"] extends {
108
- readonly source: infer S extends FaceData
109
- readonly target: infer T extends FaceData
107
+ type StatementPairs<St extends Statement> = St extends {
108
+ readonly source: infer S extends AnyFace
109
+ readonly target: infer T extends AnyFace
110
110
  }
111
111
  ? string extends S["owner"]["name"]
112
112
  ? []
@@ -208,7 +208,7 @@ type DeclaredKeysOf<Stmts extends readonly Statement[], Acc extends readonly Key
208
208
  infer H extends Statement,
209
209
  ...infer T extends readonly Statement[]
210
210
  ]
211
- ? H["data"] extends {
211
+ ? H extends {
212
212
  readonly kind: "key"
213
213
  readonly owner: infer O extends AnyRelation
214
214
  readonly projection: infer P extends readonly string[]
@@ -295,8 +295,8 @@ type DecidableRoster<Stmts extends readonly Statement[]> = [true] extends [IsMul
295
295
  : [Stmts] extends [readonly [infer H extends Statement, ...infer T extends readonly Statement[]]]
296
296
  ? [true] extends [IsMulti<H>]
297
297
  ? false
298
- : "key" extends H["data"]["kind"]
299
- ? [DecidableKeyData<H["data"]>] extends [true]
298
+ : "key" extends H["kind"]
299
+ ? [DecidableKeyData<H>] extends [true]
300
300
  ? DecidableRoster<T>
301
301
  : false
302
302
  : DecidableRoster<T>
@@ -322,7 +322,7 @@ type DeclaredKeyMatch<N extends string, PU extends string, Keys extends readonly
322
322
  : DeclaredKeyMatch<N, PU, T>
323
323
  : TargetKeyWall<N, PU>
324
324
 
325
- type JudgeTargetFace<F extends FaceData, Keys extends readonly KeyEntry[]> = string extends F["owner"]["name"]
325
+ type JudgeTargetFace<F extends AnyFace, Keys extends readonly KeyEntry[]> = string extends F["owner"]["name"]
326
326
  ? true
327
327
  : string extends F["projection"][number]
328
328
  ? true
@@ -334,9 +334,9 @@ type JudgeTargetFace<F extends FaceData, Keys extends readonly KeyEntry[]> = str
334
334
  ? DeclaredKeyMatch<F["owner"]["name"], F["projection"][number], Keys>
335
335
  : true
336
336
 
337
- type JudgeStatement<St extends Statement, Keys extends readonly KeyEntry[]> = St["data"] extends {
338
- readonly source: FaceData
339
- readonly target: infer Tg extends FaceData
337
+ type JudgeStatement<St extends Statement, Keys extends readonly KeyEntry[]> = St extends {
338
+ readonly source: AnyFace
339
+ readonly target: infer Tg extends AnyFace
340
340
  }
341
341
  ? JudgeTargetFace<Tg, Keys>
342
342
  : true
@@ -452,8 +452,8 @@ function makeUnionFind(): UnionFind {
452
452
  }
453
453
  }
454
454
 
455
- function statementFaces(statement: Statement): readonly [FaceData, FaceData] | undefined {
456
- const data = statement.data
455
+ function statementFaces(statement: Statement): readonly [AnyFace, AnyFace] | undefined {
456
+ const data = statement
457
457
  if (data.kind === "key") {
458
458
  return undefined
459
459
  }
package/src/lower.ts CHANGED
@@ -15,10 +15,10 @@ import { AuthoringError } from "#errors.ts"
15
15
 
16
16
  import type { AnyClosed } from "#closed.ts"
17
17
  import { isClosedMember } from "#closed.ts"
18
- import type { FaceData } from "#face.ts"
19
- import type { AnyField } from "#fields.ts"
18
+ import type { AnyFace } from "#face.ts"
19
+ import { type AnyField, literalOf } from "#fields.ts"
20
20
  import type { RelationClasses } from "#law.ts"
21
- import type { AnyRelation } from "#relation.ts"
21
+ import { type AnyRelation, relationFields } from "#relation.ts"
22
22
  import type { AnySchema } from "#schema.ts"
23
23
  import type {
24
24
  FieldSpec,
@@ -60,7 +60,7 @@ function lowerField(name: string, field: AnyField, newtype: string | undefined):
60
60
  }
61
61
  }
62
62
 
63
- function lowerFace(face: FaceData): SideSpec {
63
+ function lowerFace(face: AnyFace): SideSpec {
64
64
  return {
65
65
  relation: face.owner.name,
66
66
  projection: [...face.projection],
@@ -71,7 +71,7 @@ function lowerFace(face: FaceData): SideSpec {
71
71
  }
72
72
 
73
73
  function lowerStatement(statement: Statement): StatementSpec {
74
- const data = statement.data
74
+ const data = statement
75
75
  switch (data.kind) {
76
76
  case "key":
77
77
  return { kind: "fd", relation: data.owner.name, projection: [...data.projection] }
@@ -101,18 +101,21 @@ function lowerStatement(statement: Statement): StatementSpec {
101
101
  }
102
102
 
103
103
  function lowerRelation(relation: AnyRelation, classes: RelationClasses): RelationSpec {
104
- const fields: FieldSpec[] = relation.data.fields.map(function lowerDeclared(declared) {
104
+ const fields: FieldSpec[] = relationFields(relation).map(function lowerDeclared(declared) {
105
105
  return lowerField(declared.name, declared.field, classes[declared.name])
106
106
  })
107
107
  return { name: relation.name, fields, closed: undefined }
108
108
  }
109
109
 
110
110
  function lowerClosed(member: AnyClosed, classes: RelationClasses): RelationSpec {
111
- const fields: FieldSpec[] = member.data.columns.map(function lowerColumn(column) {
112
- return lowerField(column.name, column.field, classes[column.name])
111
+ const fields: FieldSpec[] = Object.entries(member.columns).map(function lowerColumn([name, field]) {
112
+ return lowerField(name, field, classes[name])
113
113
  })
114
- const rows = member.data.rows.map(function lowerRow(row) {
115
- return { handle: row.handle, values: row.values }
114
+ const rows = member.handles.map(function lowerRow(handle) {
115
+ return {
116
+ handle,
117
+ values: Object.entries(member.columns).map(([name, field]) => literalOf(field, member.axioms[handle]?.[name]))
118
+ }
116
119
  })
117
120
  const newtype = classes.id
118
121
  if (newtype === undefined) {
package/src/migration.ts CHANGED
@@ -14,8 +14,7 @@
14
14
  */
15
15
  import { Effect } from "effect"
16
16
  import { dbNative } from "#db-native.ts"
17
- import type { ExecutionPolicy } from "#runtime.ts"
18
- import { nativeOperationWith, policyWire, runtimeHandle } from "#runtime.ts"
17
+ import { nativeOperationWith, runtimeHandle } from "#runtime.ts"
19
18
  import { DbError, dbError } from "#runtime-errors.ts"
20
19
  import type { SchemaSpec } from "#spec.ts"
21
20
 
@@ -31,14 +30,11 @@ function owned(operation: string, value: Uint8Array | null): Uint8Array {
31
30
  * spec natively and yields bounded JSON bytes carrying the canonical
32
31
  * `schemaId` and the rendered schema snapshot.
33
32
  */
34
- const internalMigrationSchema = Effect.fn("internalMigrationSchema")(function* (
35
- spec: SchemaSpec,
36
- work: ExecutionPolicy
37
- ) {
33
+ const internalMigrationSchema = Effect.fn("internalMigrationSchema")(function* (spec: SchemaSpec) {
38
34
  const runtime = yield* runtimeHandle()
39
35
  return yield* nativeOperationWith(
40
36
  "internalMigrationSchema",
41
- (callback) => dbNative.runtimeMigrationSchema(runtime, policyWire(work, "internalMigrationSchema"), spec, callback),
37
+ (callback) => dbNative.runtimeMigrationSchema(runtime, spec, callback),
42
38
  dbNative.runtimeBytesTake,
43
39
  (bytes) => owned("internalMigrationSchema", bytes)
44
40
  )
@@ -49,17 +45,14 @@ const internalMigrationSchema = Effect.fn("internalMigrationSchema")(function* (
49
45
  * render/digest, manifest verify/append preview, plan-set digests): owned
50
46
  * JSON request bytes in, owned JSON response bytes out.
51
47
  */
52
- const internalMigrationRead = Effect.fn("internalMigrationRead")(function* (
53
- request: Uint8Array,
54
- work: ExecutionPolicy
55
- ) {
48
+ const internalMigrationRead = Effect.fn("internalMigrationRead")(function* (request: Uint8Array) {
56
49
  if (!(request instanceof Uint8Array) || !(request.buffer instanceof ArrayBuffer)) {
57
50
  return yield* Effect.fail(new DbError({ operation: "internalMigrationRead", reason: { _tag: "InvalidArgument" } }))
58
51
  }
59
52
  const runtime = yield* runtimeHandle()
60
53
  return yield* nativeOperationWith(
61
54
  "internalMigrationRead",
62
- (callback) => dbNative.runtimeMigrationRead(runtime, policyWire(work, "internalMigrationRead"), request, callback),
55
+ (callback) => dbNative.runtimeMigrationRead(runtime, request, callback),
63
56
  dbNative.runtimeBytesTake,
64
57
  (bytes) => owned("internalMigrationRead", bytes)
65
58
  )
package/src/native.ts CHANGED
@@ -461,7 +461,6 @@ type ErrorFamilyKind =
461
461
  | "foreignWitness"
462
462
  | "param"
463
463
  | "capacityRayMeasure"
464
- | "derivedBudgetExceeded"
465
464
  | "overflow"
466
465
  | "scalar"
467
466
  | "resultBytesOverflow"
@@ -664,6 +663,7 @@ export type {
664
663
  FindTermIr,
665
664
  HeadOpIr,
666
665
  HeadTermIr,
666
+ InteriorIr,
667
667
  IntervalValue,
668
668
  LogAccess,
669
669
  LogActivation,
@@ -693,6 +693,7 @@ export type {
693
693
  PrepareKind,
694
694
  QueryIr,
695
695
  QueryParam,
696
+ RecIr,
696
697
  RuleIr,
697
698
  ScalarExprIr,
698
699
  SealedDescriptor,
package/src/query/atom.ts CHANGED
@@ -582,6 +582,7 @@ type CondParamsShape<C> = ShapeOf<CondParams<C>>
582
582
  export type {
583
583
  AggData,
584
584
  AnyCond,
585
+ AnyTreeChild,
585
586
  AtomData,
586
587
  BindingEntry,
587
588
  BindingInput,