litedbmodel 2.0.0 → 2.0.1

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 (146) hide show
  1. package/dist/scp/authoring-sql.d.ts +78 -0
  2. package/dist/scp/authoring-sql.d.ts.map +1 -1
  3. package/dist/scp/authoring-sql.js +110 -2
  4. package/dist/scp/authoring-sql.js.map +1 -1
  5. package/dist/scp/catalog.d.ts +1 -1
  6. package/dist/scp/catalog.d.ts.map +1 -1
  7. package/dist/scp/catalog.js +27 -0
  8. package/dist/scp/catalog.js.map +1 -1
  9. package/dist/scp/codegen.d.ts +46 -82
  10. package/dist/scp/codegen.d.ts.map +1 -1
  11. package/dist/scp/codegen.js +37 -80
  12. package/dist/scp/codegen.js.map +1 -1
  13. package/dist/scp/find-filter-guard.d.ts +68 -0
  14. package/dist/scp/find-filter-guard.d.ts.map +1 -0
  15. package/dist/scp/find-filter-guard.js +88 -0
  16. package/dist/scp/find-filter-guard.js.map +1 -0
  17. package/dist/scp/fragment/assemble.d.ts +61 -0
  18. package/dist/scp/fragment/assemble.d.ts.map +1 -0
  19. package/dist/scp/fragment/assemble.js +148 -0
  20. package/dist/scp/fragment/assemble.js.map +1 -0
  21. package/dist/scp/fragment/compile-pg.d.ts +107 -0
  22. package/dist/scp/fragment/compile-pg.d.ts.map +1 -0
  23. package/dist/scp/fragment/compile-pg.js +142 -0
  24. package/dist/scp/fragment/compile-pg.js.map +1 -0
  25. package/dist/scp/fragment/index.d.ts +16 -0
  26. package/dist/scp/fragment/index.d.ts.map +1 -0
  27. package/dist/scp/fragment/index.js +34 -0
  28. package/dist/scp/fragment/index.js.map +1 -0
  29. package/dist/scp/fragment/model.d.ts +119 -0
  30. package/dist/scp/fragment/model.d.ts.map +1 -0
  31. package/dist/scp/fragment/model.js +66 -0
  32. package/dist/scp/fragment/model.js.map +1 -0
  33. package/dist/scp/fragment/pg-array-type.d.ts +13 -0
  34. package/dist/scp/fragment/pg-array-type.d.ts.map +1 -0
  35. package/dist/scp/fragment/pg-array-type.js +34 -0
  36. package/dist/scp/fragment/pg-array-type.js.map +1 -0
  37. package/dist/scp/guard.d.ts +2 -6
  38. package/dist/scp/guard.d.ts.map +1 -1
  39. package/dist/scp/guard.js +19 -22
  40. package/dist/scp/guard.js.map +1 -1
  41. package/dist/scp/index.cjs +11284 -3826
  42. package/dist/scp/index.d.ts +38 -23
  43. package/dist/scp/index.d.ts.map +1 -1
  44. package/dist/scp/index.js +119 -45
  45. package/dist/scp/index.js.map +1 -1
  46. package/dist/scp/index.mjs +4231 -1412
  47. package/dist/scp/makesql/authoring-compile.d.ts +90 -0
  48. package/dist/scp/makesql/authoring-compile.d.ts.map +1 -0
  49. package/dist/scp/makesql/authoring-compile.js +494 -0
  50. package/dist/scp/makesql/authoring-compile.js.map +1 -0
  51. package/dist/scp/makesql/compile-crud.d.ts +133 -0
  52. package/dist/scp/makesql/compile-crud.d.ts.map +1 -0
  53. package/dist/scp/makesql/compile-crud.js +288 -0
  54. package/dist/scp/makesql/compile-crud.js.map +1 -0
  55. package/dist/scp/makesql/compile-relation.d.ts +157 -0
  56. package/dist/scp/makesql/compile-relation.d.ts.map +1 -0
  57. package/dist/scp/makesql/compile-relation.js +425 -0
  58. package/dist/scp/makesql/compile-relation.js.map +1 -0
  59. package/dist/scp/makesql/compile-select.d.ts +45 -0
  60. package/dist/scp/makesql/compile-select.d.ts.map +1 -0
  61. package/dist/scp/makesql/compile-select.js +58 -0
  62. package/dist/scp/makesql/compile-select.js.map +1 -0
  63. package/dist/scp/makesql/compile.d.ts +63 -0
  64. package/dist/scp/makesql/compile.d.ts.map +1 -0
  65. package/dist/scp/makesql/compile.js +99 -0
  66. package/dist/scp/makesql/compile.js.map +1 -0
  67. package/dist/scp/makesql/handler.d.ts +58 -0
  68. package/dist/scp/makesql/handler.d.ts.map +1 -0
  69. package/dist/scp/makesql/handler.js +113 -0
  70. package/dist/scp/makesql/handler.js.map +1 -0
  71. package/dist/scp/makesql/index.d.ts +33 -0
  72. package/dist/scp/makesql/index.d.ts.map +1 -0
  73. package/dist/scp/makesql/index.js +114 -0
  74. package/dist/scp/makesql/index.js.map +1 -0
  75. package/dist/scp/makesql/ir.d.ts +42 -0
  76. package/dist/scp/makesql/ir.d.ts.map +1 -0
  77. package/dist/scp/makesql/ir.js +66 -0
  78. package/dist/scp/makesql/ir.js.map +1 -0
  79. package/dist/scp/makesql/json-array.d.ts +84 -0
  80. package/dist/scp/makesql/json-array.d.ts.map +1 -0
  81. package/dist/scp/makesql/json-array.js +118 -0
  82. package/dist/scp/makesql/json-array.js.map +1 -0
  83. package/dist/scp/makesql/json-batch.d.ts +102 -0
  84. package/dist/scp/makesql/json-batch.d.ts.map +1 -0
  85. package/dist/scp/makesql/json-batch.js +269 -0
  86. package/dist/scp/makesql/json-batch.js.map +1 -0
  87. package/dist/scp/makesql/makesql.d.ts +99 -0
  88. package/dist/scp/makesql/makesql.d.ts.map +1 -0
  89. package/dist/scp/makesql/makesql.js +122 -0
  90. package/dist/scp/makesql/makesql.js.map +1 -0
  91. package/dist/scp/makesql/pool-executor.d.ts +47 -0
  92. package/dist/scp/makesql/pool-executor.d.ts.map +1 -0
  93. package/dist/scp/makesql/pool-executor.js +50 -0
  94. package/dist/scp/makesql/pool-executor.js.map +1 -0
  95. package/dist/scp/makesql/static-bundle.d.ts +185 -0
  96. package/dist/scp/makesql/static-bundle.d.ts.map +1 -0
  97. package/dist/scp/makesql/static-bundle.js +1024 -0
  98. package/dist/scp/makesql/static-bundle.js.map +1 -0
  99. package/dist/scp/makesql/tx.d.ts +216 -0
  100. package/dist/scp/makesql/tx.d.ts.map +1 -0
  101. package/dist/scp/makesql/tx.js +743 -0
  102. package/dist/scp/makesql/tx.js.map +1 -0
  103. package/dist/scp/relation.d.ts +86 -74
  104. package/dist/scp/relation.d.ts.map +1 -1
  105. package/dist/scp/relation.js +186 -120
  106. package/dist/scp/relation.js.map +1 -1
  107. package/dist/scp/runtime.d.ts +146 -210
  108. package/dist/scp/runtime.d.ts.map +1 -1
  109. package/dist/scp/runtime.js +228 -512
  110. package/dist/scp/runtime.js.map +1 -1
  111. package/dist/scp/typed-object.d.ts +12 -1
  112. package/dist/scp/typed-object.d.ts.map +1 -1
  113. package/dist/scp/typed-object.js +25 -4
  114. package/dist/scp/typed-object.js.map +1 -1
  115. package/docs/proposal/v0-coverage-matrix.md +157 -0
  116. package/docs/proposal/v2-completeness-plan.md +90 -0
  117. package/docs/proposal/v2-sql-parity-checklist.md +162 -0
  118. package/package.json +3 -3
  119. package/dist/scp/bridge.d.ts +0 -64
  120. package/dist/scp/bridge.d.ts.map +0 -1
  121. package/dist/scp/bridge.js +0 -329
  122. package/dist/scp/bridge.js.map +0 -1
  123. package/dist/scp/compile-dialect.d.ts +0 -39
  124. package/dist/scp/compile-dialect.d.ts.map +0 -1
  125. package/dist/scp/compile-dialect.js +0 -62
  126. package/dist/scp/compile-dialect.js.map +0 -1
  127. package/dist/scp/compile-sqlite.d.ts +0 -114
  128. package/dist/scp/compile-sqlite.d.ts.map +0 -1
  129. package/dist/scp/compile-sqlite.js +0 -149
  130. package/dist/scp/compile-sqlite.js.map +0 -1
  131. package/dist/scp/ir.d.ts +0 -92
  132. package/dist/scp/ir.d.ts.map +0 -1
  133. package/dist/scp/ir.js +0 -28
  134. package/dist/scp/ir.js.map +0 -1
  135. package/dist/scp/render.d.ts +0 -40
  136. package/dist/scp/render.d.ts.map +0 -1
  137. package/dist/scp/render.js +0 -170
  138. package/dist/scp/render.js.map +0 -1
  139. package/dist/scp/write-plan.d.ts +0 -161
  140. package/dist/scp/write-plan.d.ts.map +0 -1
  141. package/dist/scp/write-plan.js +0 -528
  142. package/dist/scp/write-plan.js.map +0 -1
  143. package/dist/scp/write-runtime.d.ts +0 -80
  144. package/dist/scp/write-runtime.d.ts.map +0 -1
  145. package/dist/scp/write-runtime.js +0 -167
  146. package/dist/scp/write-runtime.js.map +0 -1
@@ -1,201 +1,144 @@
1
1
  /**
2
- * litedbmodel v2 SCP — the thin TS runtime (WS3, #23; spec §3 / §10 / §11).
3
- *
4
- * Consumes bc's runtime-core (`runBehavior` = plan stage execution + map/wire/skip
5
- * propagation + Φ output assembly) and adds ONLY the SQL-backend concerns (spec §11):
6
- * Backend-Compile bridge (WS1↔WS3), per-Catalog Handlers (render → driver execute →
7
- * row→model assembly), and Error Mapping. It re-implements NO generic execution.
8
- *
9
- * ## Execution pipeline (spec §3)
10
- *
11
- * validate → fragment select (SKIP) → array expand → Expression eval → bind → SQL execute
12
- * → assembly
13
- *
14
- * bc's `runBehavior` owns the orchestration (which node runs when, map iteration, wire
15
- * binding, output merge). But the SQL-structural ports (`where` fragment tree, `limit`, …)
16
- * MUST NOT go through bc's generic port evaluation — a `where` `{arr:[…]}` of comparison
17
- * Expressions would evaluate to bare booleans (losing the SQL structure), and a SKIP guard
18
- * over an ABSENT optional input would fail-closed with `UNKNOWN_BINDING`. So the runtime:
19
- *
20
- * 1. Backend-Compiles every SQL node up front ({@link import('./bridge').compileNode}) to a
21
- * WS1 `CompiledOperation` (SQL text + fragment tree + closed-set param slots).
22
- * 2. Rewrites the IR into a SURROGATE graph: each SQL node keeps its `id` / wiring / `map`
23
- * shape, but its ports collapse to ONE synthetic `__scope` port — a bc `{obj:…}` that
24
- * re-exports every binding head the op references (`input` names, wire node ids, the
25
- * `map` element `as`). bc evaluates `__scope` in ITS scope (so `input`, sibling results
26
- * and the map element all resolve through bc's own machinery) and hands the plain scope
27
- * to the handler. No SQL-structural port is ever evaluated by bc.
28
- * 3. Each handler renders its pre-compiled op against `ports.__scope` via WS1's normative
29
- * {@link renderOperation} (fragment select + array expand + Expression eval), binds the
30
- * params through the driver, executes REAL SQL, and returns the row list (assembly).
2
+ * litedbmodel v2 SCP — the thin TS runtime on the STATIC makeSQL bundle (WS3, #23; makeSQL
3
+ * flip, epic #43/#45 Phase B; spec §3 / §10 / §11).
4
+ *
5
+ * makeSQL is the SOLE SCP compile/execute path. A behavior method compiles (SYMBOLICALLY — no
6
+ * concrete input) to a {@link SqlBundle}:
7
+ * - a READ bundle carries a {@link ReadGraph} — the surrogate bc `ComponentGraphIR` (each SQL
8
+ * node → a `makeSQL` node) + per-node static statement templates. bc `runBehavior` drives
9
+ * map iteration / wire binding / Φ output; the makeSQL handler renders each node's statements
10
+ * (value-specs + skip evaluated per-input) and executes real SQL ("bc composes, makeSQL
11
+ * executes"). Read-relation batch ops ride the bundle too.
12
+ * - a WRITE bundle carries a single `makeSQL` statement (the base write) + the derived gate-first
13
+ * {@link TransactionPlan} for a Command with write-time relations.
14
+ *
15
+ * The reduced spine (`CompiledOperation` + `FragmentTree` + `renderOperation`) is RETIRED — this
16
+ * module carries no reduced IR. Reads execute via {@link import('./makesql/static-bundle')} (bc
17
+ * `runBehavior` + makeSQL handler); writes via {@link import('./makesql/tx')} (gate-first tx-DAG).
31
18
  *
32
19
  * ## Input normalization (SSoT — defaults live in the schema, not code)
33
20
  *
34
- * An OPTIONAL Input Port that the caller omits is normalized to `null` (present-as-null) so
35
- * a SKIP guard `{ne:[{refOpt:[port]}, null]}` evaluates to `false` and drops its fragment —
36
- * absent-key SKIP via `refOpt`. This is driven by the component's `inputPorts` schema
37
- * (`required !== true` ⇒ optional), NOT an ad-hoc `?? null` in engine code: the schema is
38
- * the single source of truth for which ports are optional.
21
+ * An OPTIONAL input head the caller omits is normalized to `null` (present-as-null) so a SKIP
22
+ * presence expression drops its fragment (absent-key SKIP). "Optional" comes from the bundle's
23
+ * `optionalHeads` (schema-optional + SKIP-guarded + every `refOpt` head) — the SSoT.
39
24
  */
40
- import { type Component, type Handlers, type Scope, type Value } from 'behavior-contracts';
25
+ import { type Scope, type Value } from 'behavior-contracts';
41
26
  import type { BehaviorModelContract } from './authoring';
42
- import type { CompiledOperation } from './ir';
43
27
  import { SqlFailure } from './errors';
44
- import { type RelationDecl, type RelationOp, type RelationDriver } from './relation';
28
+ import { type RelationDecl, type RelationOp } from './relation';
45
29
  import { type ReadOptions } from './typed-object';
46
- import { type TransactionPlan } from './write-plan';
47
- import { type TransactionResult } from './write-runtime';
30
+ import type { DialectName } from './dialect';
31
+ import { type ReadGraph, type StaticStatement, type SqliteDb as StaticSqliteDb, type SqlExecutorAsync } from './makesql/static-bundle';
32
+ import { type TransactionPlan, type TransactionResult } from './makesql/tx';
33
+ import { type InsertManyBuildOptions } from './makesql/compile-crud';
34
+ import type { UpdateManyBuildOptions } from '../drivers/types';
48
35
  import { type EntityWritesDefinition, type LifecycleContract, type WriteLifecyclePhase } from './writes';
49
- import { type Dialect, type DialectName } from './dialect';
50
- /**
51
- * The minimal synchronous SQLite driver surface the runtime needs (better-sqlite3
52
- * `Database`). `all` returns the row list of a SELECT / RETURNING statement; `run` executes
53
- * a non-returning write and reports `changes` + `lastInsertRowid`. In-process, synchronous
54
- * — the sanctioned in-proc substitute for a docker integration DB (#23 AC).
55
- */
56
- export interface SqliteDb {
57
- prepare(sql: string): {
58
- all(...params: unknown[]): unknown[];
59
- run(...params: unknown[]): {
60
- changes: number;
61
- lastInsertRowid: number | bigint;
62
- };
63
- reader?: boolean;
64
- };
65
- }
66
- /**
67
- * Build the SQL handler registry: one handler per SQL Catalog name (spec §11 item 4).
68
- *
69
- * Exported so the mode-3 codegen path (WS7f) binds the IDENTICAL SQL handlers into bc's
70
- * generated `bind(handlers)` accessor — the generated module bakes the surrogate IR literal and
71
- * calls the SAME `runBehavior`, so pairing it with THIS handler builder makes the codegen output
72
- * byte-identical to {@link executeBundle} by construction (not a parallel reimplementation).
73
- */
74
- export declare function buildHandlers(db: SqliteDb, compiled: Record<string, CompiledOperation>, dialect: Dialect): Handlers;
75
- /**
76
- * Normalize the caller input to `null` (present-as-null) for every OPTIONAL binding the
77
- * caller omitted, so a SKIP guard using `refOpt` evaluates to `false` and drops its
78
- * fragment (absent-key SKIP). "Optional" is determined from the SSoT, NOT an ad-hoc code
79
- * default — a head is optional iff EITHER (a) the component's Input Port schema marks the
80
- * port `required !== true`, OR (b) the head is SKIP-guarded in a compiled fragment (the
81
- * SKIP fragment declares its driving input optional — spec §7). A REQUIRED, non-SKIP head
82
- * that is missing is left absent so a real wiring bug surfaces loudly as bc's
83
- * `UNKNOWN_BINDING` rather than being silently defaulted.
84
- */
85
- export declare function normalizeInput(component: Component, optionalHeads: Set<string>, input: Scope): Scope;
36
+ /** The minimal synchronous SQLite driver surface the runtime needs (better-sqlite3 `Database`). */
37
+ export type SqliteDb = StaticSqliteDb;
86
38
  /** Execute options: the driver and the entry component (method) to run. */
87
39
  export interface ExecuteOptions {
88
40
  /** The synchronous SQLite driver (better-sqlite3 `Database`). */
89
41
  readonly db: SqliteDb;
90
42
  /** The behavior method (component) name to run (default: the first component). */
91
43
  readonly entry?: string;
92
- /**
93
- * The model's read-relation declarations (spec §4/§5). Compiled ONCE into the bundle's
94
- * relation ops so the typed-object read surface ({@link read}) can batch-resolve both
95
- * declarative-select and lazy relations via the SAME compiled op.
96
- */
44
+ /** The model's read-relation declarations (spec §4/§5), compiled ONCE into the bundle. */
97
45
  readonly relations?: readonly RelationDecl[];
98
- /**
99
- * The target SQL dialect (spec §4/§10). Defaults to `'sqlite'` (the in-process runtime seam
100
- * is synchronous SQLite). A `'postgres'`/`'mysql'` bundle is Backend-Compiled dialect-tagged
101
- * for the dialect golden + a language runtime; the `?`→`$N` (PG) conversion is applied at
102
- * render time. The SSoT dialect strategy governs every dialect divergence.
103
- */
46
+ /** The target SQL dialect (spec §4/§10). Defaults to `'sqlite'` (the in-process runtime seam). */
104
47
  readonly dialect?: DialectName;
105
48
  }
106
49
  /**
107
- * The Backend-Compiled bundle of ONE behavior method (spec §8): the fully compiled SQL IR a
108
- * thin per-language runtime (bc runtime-core + a SQL handler) can execute WITHOUT
109
- * re-implementing litedbmodel's Backend-Compile. It is pure serializable JSON:
50
+ * The compiled bundle of ONE behavior method (spec §8) — pure serializable JSON a thin
51
+ * per-language runtime (bc + a SQL handler) can execute WITHOUT re-implementing litedbmodel's
52
+ * compile.
110
53
  *
111
- * - `component` — the bc component's WIRING ONLY (body node ids / parent / map `over`+`as` /
112
- * `cond` / output / plan / inputPorts). The catalog nodes' original Expression-IR ports
113
- * are replaced by the surrogate `__scope` port so a consumer runtime feeds bc's
114
- * `runBehavior` the plan/map/wire orchestration with NO SQL-structural port to mis-evaluate.
115
- * - `operations` — `nodeId → CompiledOperation` (§8: `sql` with the `{where}` splice,
116
- * `where` fragment tree with existence rules, `params` static slots, `assembly`). Param
117
- * slots stay as Expression IR (`{coalesce:[…]}`, `{ref:[…]}`) so bc runtime-core owns
118
- * value/SKIP evaluation per language (they are NOT pre-evaluated to literals).
119
- * - `optionalHeads` — the input heads normalized to present-as-null (absent-key SKIP), so a
120
- * consumer runtime reproduces the same normalization from the bundle (not from TS state).
54
+ * - READ (`readGraph` present): the surrogate `ComponentGraphIR` + per-node makeSQL statement
55
+ * templates; bc `runBehavior` owns orchestration, the makeSQL handler renders + executes.
56
+ * - WRITE (`statement` present): the single base-write makeSQL template; for a Command with
57
+ * write-time relations, `transaction` carries the derived gate-first plan.
58
+ * - `relations` — STATIC read-relation batch ops (spec §8 relation ops), keyed by name.
121
59
  *
122
- * `dialect` is the target SQL dialect (`'sqlite'`/`'postgres'`/`'mysql'`); the dialect axis is
123
- * compiled ONCE, TS-side (spec §10). A PG bundle's `operations[*].sql` still carries `?`
124
- * placeholders — the `?`→`$N` conversion is the render-time final one-pass, so the bundle stays
125
- * uniform and dialect-tagged.
60
+ * `dialect` is the target SQL dialect (compiled ONCE, TS-side); a PG bundle's `?`→`$N` conversion
61
+ * is the render-time final pass, so the bundle stays uniform and dialect-tagged.
126
62
  */
127
63
  export interface SqlBundle {
128
- readonly irVersion: number;
129
- readonly exprVersion: number;
130
64
  readonly dialect: DialectName;
131
- /** The surrogate component (wiring/plan/output only; catalog ports → `__scope`). */
132
- readonly component: Component;
133
- /** Backend-Compiled SQL IR per catalog node id (§8 shape). */
134
- readonly operations: Record<string, CompiledOperation>;
65
+ /** The behavior (component) name. */
66
+ readonly name: string;
67
+ /** READ bundles: the portable read graph (surrogate IR + per-node makeSQL statements). */
68
+ readonly readGraph?: ReadGraph;
69
+ /** WRITE bundles: the single base-write makeSQL statement template. */
70
+ readonly statement?: StaticStatement;
135
71
  /** Optional input heads normalized to present-as-null (absent-key SKIP). */
136
- readonly optionalHeads: string[];
137
- /**
138
- * Pre-compiled read-relation batch ops (spec §8 `relation ops`), keyed by relation name.
139
- * Derived ONCE (TS-side) from the model relation declarations, dialect-aware (SQLite).
140
- * Pure JSON (each op's `query` is a {@link CompiledOperation}) so a thin per-language
141
- * runtime gets the relation batch SQL for free (WS7). BOTH read surfaces (declarative
142
- * select + lazy) resolve through these ops — the identical compiled op.
143
- */
72
+ readonly optionalHeads: readonly string[];
73
+ /** Pre-compiled STATIC read-relation batch ops, keyed by relation name (pure JSON). */
144
74
  readonly relations: Record<string, RelationOp>;
145
- /**
146
- * The derived write-time-relations transaction plan (spec §6 / §8 `transaction plan`), present
147
- * ONLY for a Command bundle whose base write declares an `onWrite` lifecycle. Pure JSON:
148
- * ordered statements + gate-first rules + `$.entity` exposure. A WS7 runtime executes the SAME
149
- * plan via {@link executeTransactionBundle} (bc-core render + a SQL handler + BEGIN/COMMIT) —
150
- * no re-derivation per language (spec §6). Absent for read bundles and for Command bundles with
151
- * no write-time relations (those run through the ordinary {@link executeBundle} path).
152
- */
75
+ /** The derived write-time-relations transaction plan (present ONLY for a write Command bundle). */
153
76
  readonly transaction?: TransactionPlan;
154
77
  }
155
78
  /**
156
- * Execute a published behavior contract (WS2 {@link BehaviorModelContract}) end-to-end:
157
- * Backend-Compile every SQL node → surrogate IR → bc `runBehavior` (plan / map / wire /
158
- * output) with SQL handlers → REAL SQLite execution → assembled Φ output.
79
+ * Execute a published behavior contract (WS2 {@link BehaviorModelContract}) end-to-end via the
80
+ * static makeSQL bundle. Returns the component's output (a read Φ output / row list, or a write's
81
+ * RETURNING rows / `[{changes, lastInsertRowid}]` summary).
159
82
  *
160
- * This is α's vertical slice: authoring → IR → Backend-Compile → thin runtime → real
161
- * SQLite → assembly. The returned Value is the component's `output` (Φ merge) with each SQL
162
- * node's slot filled by its executed row list.
163
- *
164
- * @throws {SqlFailure} a mapped driver failure re-surfaced at the boundary (a `fail`-policy
165
- * node re-throws through `runPlan` as `OP_FAILED`; the runtime unwraps it back to the
166
- * structured {@link SqlFailure} so the caller sees `kind` / `policy` / `sqliteCode`).
83
+ * @throws {SqlFailure} a mapped driver failure re-surfaced at the boundary.
167
84
  */
168
85
  export declare function executeBehavior(contract: BehaviorModelContract, input: Scope, options: ExecuteOptions): Value;
169
86
  /**
170
- * Backend-Compile ONE behavior method of a contract into the serializable {@link SqlBundle}
171
- * (spec §8) — the published multi-language artifact. This runs the WS1↔WS3 bridge and the
172
- * surrogate rewrite ONCE, on the TS side (spec §10: the dialect axis is compiled once), and
173
- * emits pure JSON: no TS runtime state is captured, so `JSON.stringify(bundle)` round-trips
174
- * losslessly and a thin per-language runtime can execute it with bc runtime-core + a SQL
175
- * handler alone (proven by the bundle round-trip test).
87
+ * Compile ONE behavior method into the serializable STATIC {@link SqlBundle} (spec §8) — the
88
+ * published multi-language artifact. SYMBOLIC (no concrete input). A read method compiles to a
89
+ * {@link ReadGraph}; a single-write method to a `makeSQL` statement. Pure JSON throughout.
176
90
  */
177
91
  export declare function compileBundle(contract: BehaviorModelContract, entry?: string, relations?: readonly RelationDecl[], dialectName?: DialectName): SqlBundle;
178
92
  /**
179
- * Execute a {@link SqlBundle} (the §8 published artifact) end-to-end: feed bc `runBehavior`
180
- * the bundle's surrogate component (plan / map / wire / output orchestration) with SQL
181
- * handlers that render the bundle's `CompiledOperation`s and run REAL SQLite. This is the
182
- * SAME code path a thin per-language runtime follows — it consumes ONLY the serialized
183
- * bundle + bc runtime-core, never re-running litedbmodel's Backend-Compile. The bundle
184
- * round-trip test parses this from JSON (no TS state) to prove self-sufficiency (WS7).
93
+ * Execute a {@link SqlBundle} (the §8 published artifact) end-to-end via the static makeSQL
94
+ * runtime + REAL SQLite. Read bundles run the read graph via bc `runBehavior`; single-statement
95
+ * write bundles run the write (RETURNING rows / summary). The SAME code path a thin per-language
96
+ * runtime follows — it consumes ONLY the serialized bundle + bc, never re-running the compile.
185
97
  *
186
98
  * @throws {SqlFailure} a mapped driver failure re-surfaced at the boundary.
187
99
  */
188
100
  export declare function executeBundle(bundle: SqlBundle, input: Scope, options: ExecuteOptions): Value;
101
+ /** Async execute options: the pooled async SQL executor + the entry component (method) to run. */
102
+ export interface AsyncExecuteOptions {
103
+ /** The pooled async SQL executor (build via `pgPoolExecutor` / `mysqlPoolExecutor`). */
104
+ readonly exec: SqlExecutorAsync;
105
+ /** The behavior method (component) name to run (default: the first component). */
106
+ readonly entry?: string;
107
+ /** The model's read-relation declarations (spec §4/§5), compiled ONCE into the bundle. */
108
+ readonly relations?: readonly RelationDecl[];
109
+ /** The target SQL dialect (spec §4/§10). For the live async path this is `'postgres'`/`'mysql'`. */
110
+ readonly dialect?: DialectName;
111
+ }
189
112
  /**
190
- * Backend-Compile a Command method + its `entityWrites` save contract into a {@link SqlBundle}
191
- * that carries the derived, gate-first write-time-relations {@link TransactionPlan} (spec §6/§8).
192
- * The base write op is Backend-Compiled ONCE (the same {@link compileNode} bridge), and
193
- * {@link deriveTransactionPlan} lowers the lifecycle's §6 effect arrays around it into the ordered
194
- * statement list. The whole plan is pure JSON (it round-trips inside the bundle), so a WS7 runtime
195
- * honors the SAME plan via {@link executeTransactionBundle} — no re-derivation.
113
+ * Execute a READ {@link SqlBundle} end-to-end via the ASYNC PG / MySQL execution model (#40): bc
114
+ * `runBehaviorAsync` drives map iteration / wire binding / Φ output and dispatches independent
115
+ * sibling read nodes in bounded parallel against the pooled async executor. This is the PRODUCTION
116
+ * live-DB read entry point — the async twin of {@link executeBundle} for read bundles.
117
+ *
118
+ * Byte-identical composition (SAME IR, SAME per-node SQL text + params, SAME Φ output) to the
119
+ * serial `executeBundle`; concurrency changes only the wall-clock. A single-relation (zero-sibling)
120
+ * read graph runs exactly one query, so it is identical to the serial path either way.
196
121
  *
197
- * @throws if the method is not a Command, the phase lifecycle is not declared, the scope is not a
198
- * single base write, or a `$.entity.*` reference lacks a RETURNING body (all fail-closed).
122
+ * A single-statement WRITE bundle is NOT accepted here — the write-tx path stays sync + serial
123
+ * (`executeBundle` / `executeTransactionBundle`); this async path is READ-only.
124
+ *
125
+ * @throws {SqlFailure} a mapped driver failure re-surfaced at the boundary.
126
+ */
127
+ export declare function executeBundleAsync(bundle: SqlBundle, input: Scope, options: AsyncExecuteOptions): Promise<Value>;
128
+ /**
129
+ * Compile + execute a READ behavior method via the ASYNC PG / MySQL execution model (#40). The
130
+ * async twin of {@link executeBehavior} for reads: compile the contract to a {@link SqlBundle}
131
+ * (SYMBOLIC), then run its read graph through {@link executeBundleAsync}.
132
+ *
133
+ * @throws {SqlFailure} a mapped driver failure re-surfaced at the boundary.
134
+ */
135
+ export declare function executeBehaviorAsync(contract: BehaviorModelContract, input: Scope, options: AsyncExecuteOptions): Promise<Value>;
136
+ /**
137
+ * Compile a Command method + its `entityWrites` save contract into a {@link SqlBundle} carrying
138
+ * the derived, gate-first write-time-relations {@link TransactionPlan} (spec §6/§8). The base
139
+ * write op is compiled ONCE (the SAME `compileWriteNode` — complete tuned SQL + deferred
140
+ * Expression-IR params); {@link deriveTransactionPlan} lowers the lifecycle's §6 effect arrays
141
+ * around it into the ordered statement list. Pure JSON; a WS7 runtime honors the SAME plan.
199
142
  */
200
143
  export declare function compileWriteBundle(contract: BehaviorModelContract, entry: string, writes: EntityWritesDefinition, phase: WriteLifecyclePhase, dialectName?: DialectName): SqlBundle;
201
144
  /**
@@ -204,38 +147,57 @@ export declare function compileWriteBundle(contract: BehaviorModelContract, entr
204
147
  * `effects`. A later member references an earlier member's RETURNING row via `$.ref.<name>.<field>`.
205
148
  */
206
149
  export interface CompositeWriteEntry {
207
- /** The Command method whose sole base-write node is this member's body. */
208
150
  readonly entry: string;
209
- /** The member's stable name (downstream members address its row as `$.ref.<name>.<field>`). */
210
151
  readonly name: string;
211
- /** The member's write-time-relations lifecycle for this phase (its gates/derive/edges/emits). */
212
152
  readonly lifecycle: LifecycleContract;
213
153
  }
214
154
  /**
215
- * Backend-Compile a COMPOSITE (multi-write) Command into a {@link SqlBundle} carrying ONE derived,
216
- * gate-first, TOPOLOGICALLY-ORDERED transaction plan (spec §6 nested write / §14 "write-time tx DAG
217
- * 導出"). Each {@link CompositeWriteEntry} contributes a named base write + its effects; a later
218
- * member depends on an earlier via `$.ref.<name>.*` (e.g. a child INSERT keyed by the parent's
219
- * RETURNING id). {@link deriveTransactionPlan} builds the data-dependency graph + gate-first
220
- * constraint and derives the correct ordered plan (deterministic, stable tie-break; a cycle or
221
- * dangling ref is ESCALATED). The plan is pure JSON — the 5 language runtimes execute it verbatim
222
- * (they already bind each statement's `binds` row into scope for downstream `$.ref` resolution).
223
- *
224
- * @throws if an entry is missing/not a single-write node, or the DAG cannot be derived (cycle /
225
- * dangling `$.ref` / missing RETURNING on a referenced write) — all fail-closed.
155
+ * Compile a COMPOSITE (multi-write) Command into a {@link SqlBundle} carrying ONE derived,
156
+ * gate-first, TOPOLOGICALLY-ORDERED transaction plan (spec §6 nested write / §14). Each entry
157
+ * contributes a named base write + its effects; a later member depends on an earlier via
158
+ * `$.ref.<name>.*`. {@link deriveTransactionPlan} builds the DAG + gate-first constraint and
159
+ * derives the ordered plan; a cycle / dangling ref is ESCALATED. Pure JSON.
226
160
  */
227
161
  export declare function compileCompositeWriteBundle(contract: BehaviorModelContract, entries: readonly CompositeWriteEntry[], phase: WriteLifecyclePhase, dialectName?: DialectName): SqlBundle;
162
+ /**
163
+ * Compile a `createMany` into a batch write {@link SqlBundle} carrying a gate-free
164
+ * {@link TransactionPlan}. Heterogeneous column-set groups become MULTIPLE ordered INSERT
165
+ * statements — byte-identical to what `DBModel._insert` emits per group (via `compileInsertMany`).
166
+ *
167
+ * `pk` (the target PK descriptor) is REQUIRED when the createMany carries a RETURNING clause on the
168
+ * MySQL dialect: a batch INSERT persists N rows, so the MySQL RETURNING emulation must re-select ALL
169
+ * N (a range on the AUTO_INCREMENT column, or the client-supplied PK values), not a single `id`.
170
+ */
171
+ export declare function compileCreateManyBundle(name: string, options: InsertManyBuildOptions & {
172
+ pk?: {
173
+ columns: readonly string[];
174
+ autoInc: string | null;
175
+ };
176
+ }, dialectName?: DialectName): SqlBundle;
177
+ /**
178
+ * Compile an `updateMany` into a batch write {@link SqlBundle} (one UNNEST/JSON/CASE statement,
179
+ * byte-identical to `compileUpdateMany` driving the v1 `buildUpdateMany` / JSON-batch builder).
180
+ */
181
+ export declare function compileUpdateManyBundle(name: string, options: UpdateManyBuildOptions, dialectName?: DialectName): SqlBundle;
182
+ /**
183
+ * Compile a `deleteMany` into a batch write {@link SqlBundle} — a PK-set IN-list DELETE (single-key)
184
+ * or one DELETE per composite-key group, driven by the v1 `DBConditions` builder (`compileDeleteMany`).
185
+ */
186
+ export declare function compileDeleteManyBundle(name: string, options: {
187
+ tableName: string;
188
+ keyColumns: string[];
189
+ keys: Record<string, unknown>[];
190
+ returning?: string;
191
+ }, dialectName?: DialectName): SqlBundle;
228
192
  /**
229
193
  * Execute a COMPOSITE (multi-write) Command end-to-end as ONE real SQLite transaction with gate-
230
- * first short-circuit + DAG-ordered statements (spec §6 / §14): Backend-Compile the members into a
231
- * bundle with the derived tx-DAG plan, then run {@link executeTransactionBundle}.
194
+ * first short-circuit + DAG-ordered statements (spec §6 / §14).
232
195
  */
233
196
  export declare function executeCompositeCommand(contract: BehaviorModelContract, entries: readonly CompositeWriteEntry[], phase: WriteLifecyclePhase, input: Scope, options: ExecuteOptions): TransactionResult;
234
197
  /**
235
198
  * Execute a Command end-to-end as ONE real SQLite transaction with gate-first short-circuit
236
- * (spec §6): Backend-Compile the Command + its save contract into a {@link SqlBundle} with a
237
- * transaction plan, then run {@link executeTransactionBundle}. This is the v2 public write path
238
- * ("write-time relations が自動導出 → 1 tx", spec §2.3).
199
+ * (spec §6): compile the Command + its save contract into a {@link SqlBundle} with a transaction
200
+ * plan, then run {@link executeTransactionBundle}. The v2 public write path.
239
201
  *
240
202
  * @throws {SqlFailure} a mapped driver failure (the transaction ROLLBACKs first).
241
203
  */
@@ -244,52 +206,26 @@ export declare function executeCommand(contract: BehaviorModelContract, writes:
244
206
  }): TransactionResult;
245
207
  /**
246
208
  * Execute a {@link SqlBundle}'s derived transaction plan (spec §6/§8) as ONE real SQLite
247
- * transaction. This is the SAME code path a thin per-language runtime follows: it consumes ONLY
248
- * the serialized {@link TransactionPlan} (pure JSON) + the render pipeline + a SQL driver, never
249
- * re-deriving the plan. The bundle round-trip test parses this from JSON (no TS state) to prove
250
- * WS7 self-sufficiency.
209
+ * transaction. The SAME code path a thin per-language runtime follows: it consumes ONLY the
210
+ * serialized {@link TransactionPlan} (pure JSON) + a SQL driver, never re-deriving the plan.
251
211
  *
252
- * @throws if the bundle carries no transaction plan (it is not a write-time-relations Command
253
- * bundle), or {@link SqlFailure} on a mapped driver failure.
212
+ * @throws if the bundle carries no transaction plan, or {@link SqlFailure} on a driver failure.
254
213
  */
255
214
  export declare function executeTransactionBundle(bundle: SqlBundle, input: Scope, options: ExecuteOptions): TransactionResult;
256
215
  /** Options for the typed-object {@link read} surface: base execution + relation read opts. */
257
216
  export interface ReadRuntimeOptions<R = Record<string, unknown>> extends ExecuteOptions, ReadOptions<R> {
258
217
  }
259
218
  /**
260
- * The v2 typed-object read surface (spec §4/§5/§12): run a read behavior whose output is a
261
- * row list (a Select), then wrap each raw row in a plain TYPED-OBJECT (own props = data only,
262
- * NOT a DBModel instance) with read relations attached.
219
+ * The v2 typed-object read surface (spec §4/§5/§12): run a read behavior whose output is a row
220
+ * list (a Select), then wrap each raw row in a plain TYPED-OBJECT with read relations attached.
221
+ * A relation named in `options.with` is declaratively batch-prefetched; every other declared
222
+ * relation is lazy (a prototype getter firing the SAME compiled op over the sibling set). Both
223
+ * surfaces share the ONE compiled relation op in the bundle.
263
224
  *
264
- * - A relation named in `options.with` is DECLARATIVELY selected: batch-prefetched ONCE over
265
- * the whole page (staged, no N+1) and attached as an OWN prop.
266
- * - Every OTHER declared relation is LAZY: a prototype getter that, on `await result.author`,
267
- * fires the SAME compiled relation op over the sibling set (batched — still no N+1).
268
- * - `options.hydrate` recovers host objects (`(raw) => new Domain(raw)`) — the consumer-side
269
- * method-UX recovery. It stays in the runtime and never enters the bundle.
270
- *
271
- * Both surfaces share the ONE compiled relation op in the bundle (spec §5). The base row list
272
- * is produced by the SAME {@link executeBundle} path (bc runtime-core + SQL handlers), so the
273
- * read query itself is fully IR-driven; relations are the runtime's staged-batch concern.
274
- *
275
- * @throws if the behavior output is not a row list (the typed-object surface is for reads).
225
+ * @throws if the behavior output is not a row list (the typed-object read surface is for reads).
276
226
  */
277
227
  export declare function read<R = Record<string, unknown>>(contract: BehaviorModelContract, input: Scope, options: ReadRuntimeOptions<R>): R[];
278
228
  /** {@link read} against an already-compiled {@link SqlBundle} (the published §8 artifact). */
279
229
  export declare function readBundle<R = Record<string, unknown>>(bundle: SqlBundle, input: Scope, options: ReadRuntimeOptions<R>): R[];
280
- /**
281
- * Resolve ONE relation for a page of parent rows by driving bc's PLAN mechanism (spec §5:
282
- * `deriveExecutionPlan` — result path → stage groups + concurrency). This is the staged-batch
283
- * path: it builds a bc component with a single `map.batched` node over the parent rows and
284
- * runs it through {@link runBehavior} (the SAME multi-language execution core WS7 languages
285
- * use). Because the map is `batched`, bc evaluates every parent's key port and invokes the
286
- * relation handler EXACTLY ONCE with `{items:[…]}` — so the relation op fires ONE batched
287
- * query for the whole page (structurally no N+1, enforced by bc's batch contract). The
288
- * handler runs the IDENTICAL compiled {@link RelationOp} the declarative-select and lazy
289
- * surfaces use, and `into` attaches each parent's resolved child(ren).
290
- *
291
- * Returns the parent rows augmented with the relation under `op.name` (per cardinality).
292
- */
293
- export declare function resolveRelationViaPlan(op: RelationOp, parents: readonly Record<string, unknown>[], db: RelationDriver): Record<string, unknown>[];
294
230
  export { SqlFailure };
295
231
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@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