@prisma/orm-family-sql 8.0.0-rc.18-dev.17 → 8.0.0-rc.18-dev.19

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 (108) hide show
  1. package/dist/{authoring-type-constructors-0Iv2zdwS-MFIpJ4fA.mjs → authoring-type-constructors-0Iv2zdwS-BJjO5EnA.mjs} +2 -2
  2. package/dist/{authoring-type-constructors-0Iv2zdwS-MFIpJ4fA.mjs.map → authoring-type-constructors-0Iv2zdwS-BJjO5EnA.mjs.map} +1 -1
  3. package/dist/{config-types-ComQZUlA.mjs → config-types-DopEiXtk.mjs} +2 -2
  4. package/dist/{config-types-ComQZUlA.mjs.map → config-types-DopEiXtk.mjs.map} +1 -1
  5. package/dist/{contract-builder-fQ3gkIR5.mjs → contract-builder-C1X8KoEM.mjs} +3 -3
  6. package/dist/{contract-builder-fQ3gkIR5.mjs.map → contract-builder-C1X8KoEM.mjs.map} +1 -1
  7. package/dist/contract-prisma7__provider.d.mts +3 -3
  8. package/dist/contract-prisma7__provider.d.mts.map +1 -1
  9. package/dist/contract-prisma7__provider.mjs +19 -47
  10. package/dist/contract-prisma7__provider.mjs.map +1 -1
  11. package/dist/contract-psl.mjs +1 -1
  12. package/dist/contract-psl__attribute-specs.mjs +1 -1
  13. package/dist/contract-psl__provider.mjs +2 -2
  14. package/dist/contract-psl__provider.mjs.map +1 -1
  15. package/dist/contract-ts.mjs +3 -3
  16. package/dist/contract-ts__config-types.mjs +1 -1
  17. package/dist/contract-ts__contract-builder.mjs +2 -2
  18. package/dist/contract.d.mts +2 -2
  19. package/dist/contract.mjs +3 -3
  20. package/dist/contract__data-type.d.mts +1 -1
  21. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  22. package/dist/contract__foreign-key-materialization.mjs +2 -2
  23. package/dist/contract__validators.mjs +1 -1
  24. package/dist/{control-mpACqp72.d.mts → control-BqS5MMDh.d.mts} +21 -12
  25. package/dist/control-BqS5MMDh.d.mts.map +1 -0
  26. package/dist/{control-ClahTAD-.mjs → control-C7MNvu5Q.mjs} +27 -13
  27. package/dist/control-C7MNvu5Q.mjs.map +1 -0
  28. package/dist/{control-adapter-BCopdpsT-DIHCWbq_.d.mts → control-adapter-BCopdpsT-Bou0wWLF.d.mts} +3 -3
  29. package/dist/{control-adapter-BCopdpsT-DIHCWbq_.d.mts.map → control-adapter-BCopdpsT-Bou0wWLF.d.mts.map} +1 -1
  30. package/dist/control-adapter-CUwBiImd.d.mts +1 -0
  31. package/dist/{data-type-B8N33s-_.d.mts → data-type-DuzmTpzK.d.mts} +3 -3
  32. package/dist/{data-type-B8N33s-_.d.mts.map → data-type-DuzmTpzK.d.mts.map} +1 -1
  33. package/dist/{derived-checks-CrvMQTJF-DlxFFtNM.mjs → derived-checks-sRZp_gTF-UGwFWkVX.mjs} +7 -20
  34. package/dist/derived-checks-sRZp_gTF-UGwFWkVX.mjs.map +1 -0
  35. package/dist/{diff-Bd9ILpZL.d.mts → diff-D6PbCUWL.d.mts} +5 -5
  36. package/dist/{diff-Bd9ILpZL.d.mts.map → diff-D6PbCUWL.d.mts.map} +1 -1
  37. package/dist/exports-DVsHk8HP-DrH_2a-H.mjs +2371 -0
  38. package/dist/exports-DVsHk8HP-DrH_2a-H.mjs.map +1 -0
  39. package/dist/family.d.mts +10 -10
  40. package/dist/family.mjs +6 -6
  41. package/dist/family__control-adapter.d.mts +2 -2
  42. package/dist/family__control.d.mts +3 -3
  43. package/dist/family__control.mjs +2 -2
  44. package/dist/family__diff.d.mts +1 -1
  45. package/dist/family__ir.mjs +1 -1
  46. package/dist/family__migration.d.mts +1 -1
  47. package/dist/family__pack.mjs +2 -2
  48. package/dist/family__psl-build.d.mts +2 -2
  49. package/dist/family__psl-build.mjs +2 -2
  50. package/dist/family__psl-infer.d.mts +1 -1
  51. package/dist/family__psl-infer.mjs +1 -1
  52. package/dist/{foreign-key-materialization-DfNPQL9G.mjs → foreign-key-materialization-BIvQTfz8.mjs} +2 -2
  53. package/dist/{foreign-key-materialization-DfNPQL9G.mjs.map → foreign-key-materialization-BIvQTfz8.mjs.map} +1 -1
  54. package/dist/{foreign-key-materialization-DCaDnUs-.d.mts → foreign-key-materialization-BiWTp2vi.d.mts} +3 -3
  55. package/dist/{foreign-key-materialization-DCaDnUs-.d.mts.map → foreign-key-materialization-BiWTp2vi.d.mts.map} +1 -1
  56. package/dist/{index-DWNoqFzr.d.mts → index-BxlXOVeT.d.mts} +14 -7
  57. package/dist/{index-DWNoqFzr.d.mts.map → index-BxlXOVeT.d.mts.map} +1 -1
  58. package/dist/{index-equivalence-DswCiq5l-BsphajRC.mjs → index-equivalence-DswCiq5l-Cp2V5nhL.mjs} +2 -2
  59. package/dist/{index-equivalence-DswCiq5l-BsphajRC.mjs.map → index-equivalence-DswCiq5l-Cp2V5nhL.mjs.map} +1 -1
  60. package/dist/{interpreter-CFj2aTEP-BHL3TOqk.mjs → interpreter-B9wNACvu-CjrIm-Jo.mjs} +5 -5
  61. package/dist/{interpreter-CFj2aTEP-BHL3TOqk.mjs.map → interpreter-B9wNACvu-CjrIm-Jo.mjs.map} +1 -1
  62. package/dist/{migration-lg_VgP_F.d.mts → migration-CJ0xK_7n.d.mts} +2 -2
  63. package/dist/{migration-lg_VgP_F.d.mts.map → migration-CJ0xK_7n.d.mts.map} +1 -1
  64. package/dist/orm-client.d.mts +12 -44
  65. package/dist/orm-client.d.mts.map +1 -1
  66. package/dist/orm-client.mjs +505 -187
  67. package/dist/orm-client.mjs.map +1 -1
  68. package/dist/psl-build-ClY62mZM.d.mts +157 -0
  69. package/dist/psl-build-ClY62mZM.d.mts.map +1 -0
  70. package/dist/{psl-build-BsJ6eChh.mjs → psl-build-pU0gKdVI.mjs} +146 -7
  71. package/dist/psl-build-pU0gKdVI.mjs.map +1 -0
  72. package/dist/{psl-field-resolution-o9sXqIlE-BJnlxQ4z.mjs → psl-field-resolution-BOJPyV5I-0zJJ0fOo.mjs} +20 -14
  73. package/dist/{psl-field-resolution-o9sXqIlE-BJnlxQ4z.mjs.map → psl-field-resolution-BOJPyV5I-0zJJ0fOo.mjs.map} +1 -1
  74. package/dist/{psl-infer-B6iemK9i.d.mts → psl-infer-1C9FqGO2.d.mts} +3 -3
  75. package/dist/{psl-infer-B6iemK9i.d.mts.map → psl-infer-1C9FqGO2.d.mts.map} +1 -1
  76. package/dist/{psl-infer-HPi_YMeE.mjs → psl-infer-CvUWefHM.mjs} +2 -2
  77. package/dist/{psl-infer-HPi_YMeE.mjs.map → psl-infer-CvUWefHM.mjs.map} +1 -1
  78. package/dist/runtime.d.mts +2 -2
  79. package/dist/runtime.mjs +1 -2289
  80. package/dist/{schema-differ-DmP74bB8-BGA6fzOv.d.mts → schema-differ-DmP74bB8-GfOUaGGy.d.mts} +3 -3
  81. package/dist/{schema-differ-DmP74bB8-BGA6fzOv.d.mts.map → schema-differ-DmP74bB8-GfOUaGGy.d.mts.map} +1 -1
  82. package/dist/schema-ir.d.mts +2 -2
  83. package/dist/schema-ir.mjs +1 -1
  84. package/dist/schema-ir__types.d.mts +3 -3
  85. package/dist/schema-ir__types.mjs +1 -1
  86. package/dist/{sql-contract-serializer-sMY3prTx-C8IEwSsf.mjs → sql-contract-serializer-sMY3prTx-BKQ4Yh-n.mjs} +2 -2
  87. package/dist/{sql-contract-serializer-sMY3prTx-C8IEwSsf.mjs.map → sql-contract-serializer-sMY3prTx-BKQ4Yh-n.mjs.map} +1 -1
  88. package/dist/{types-c1iIhJep-DdMj6TNl.d.mts → types-Bqe0AXuw-xqQnkIj4.d.mts} +25 -6
  89. package/dist/types-Bqe0AXuw-xqQnkIj4.d.mts.map +1 -0
  90. package/dist/types-CTdsm45r.d.mts +1 -0
  91. package/dist/{types-CaVn_xxe-D9WdU3Iy.mjs → types-CfPB-Kz_-ByWDfwMj.mjs} +31 -6
  92. package/dist/types-CfPB-Kz_-ByWDfwMj.mjs.map +1 -0
  93. package/dist/{types-DaYtBAYT-B22gkh5z.d.mts → types-DaYtBAYT-DbsbDMTk.d.mts} +4 -4
  94. package/dist/{types-DaYtBAYT-B22gkh5z.d.mts.map → types-DaYtBAYT-DbsbDMTk.d.mts.map} +1 -1
  95. package/dist/{validators-Bvfk0aN7.mjs → validators-V8vN9R85.mjs} +2 -2
  96. package/dist/{validators-Bvfk0aN7.mjs.map → validators-V8vN9R85.mjs.map} +1 -1
  97. package/package.json +18 -18
  98. package/dist/control-ClahTAD-.mjs.map +0 -1
  99. package/dist/control-adapter-BsSf5pqM.d.mts +0 -1
  100. package/dist/control-mpACqp72.d.mts.map +0 -1
  101. package/dist/derived-checks-CrvMQTJF-DlxFFtNM.mjs.map +0 -1
  102. package/dist/psl-build-BHQfP1_C.d.mts +0 -73
  103. package/dist/psl-build-BHQfP1_C.d.mts.map +0 -1
  104. package/dist/psl-build-BsJ6eChh.mjs.map +0 -1
  105. package/dist/runtime.mjs.map +0 -1
  106. package/dist/types-BLyhYk6B.d.mts +0 -1
  107. package/dist/types-CaVn_xxe-D9WdU3Iy.mjs.map +0 -1
  108. package/dist/types-c1iIhJep-DdMj6TNl.d.mts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.mjs","names":["runtimeError","#count","#started","#drainWaiters","#ast","#holdFinishedChildren","#openTransactions","#heldQueryables","#openActivityHandles","#inFlight","#refusing","#preparedStatementHandles"],"sources":["../../../../2-sql/5-runtime/dist/exports-DEoQjOnB.mjs"],"sourcesContent":["import { a as wasRefusedBeforeBegin, c as preparedStatementExecute, i as transactionStart, l as runPreparedExecute, n as settlementOf, o as preparedStatementQuery, r as transactionSettlement, s as runPreparedQuery, t as createTransactionStart } from \"./transaction-state-BfXhs7D7.mjs\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { materializeCodec, resolveCodecDescriptorOrThrow } from \"@internal/framework-components/codec\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createContextBeneath, executeStatement, raceAgainstAbort, runtimeError, startClientActivity, startTransactionActivity, streamStatement } from \"@internal/framework-components/runtime\";\nimport { PreparedParamRef, collectOrderedParamRefs, isQueryAst } from \"@internal/sql-relational-core/ast\";\nimport { assertNever, isInternalError } from \"@internal/utils/internal-error\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { checkContractComponentRequirements, mergeCapabilityMatrices } from \"@internal/framework-components/components\";\nimport { createExecutionStack } from \"@internal/framework-components/execution\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { createSqlOperationRegistry } from \"@internal/sql-operations\";\nimport { buildSqlAggregateDescriptorRegistry } from \"@internal/sql-relational-core/aggregate-descriptor-registry\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\nimport { createSqlParamRefMutator } from \"@internal/sql-relational-core/middleware\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { hashContent } from \"@internal/utils/hash-content\";\nimport { createHash } from \"node:crypto\";\n//#region src/activity-handle.ts\n/** The symbol-keyed member through which a runtime, connection, transaction, `withTransaction` context or activity handle starts activities; user-facing types do not show it. */\nconst activitySource = Symbol(\"activitySource\");\nfunction hasActivitySourceMember(target) {\n\treturn activitySource in target;\n}\n/** The `activitySource` member of a queryable; `undefined` for a queryable that cannot start activities, such as a test stub. */\nfunction findActivitySource(target) {\n\treturn hasActivitySourceMember(target) ? target[activitySource] : void 0;\n}\nfunction activitySourceOf(target) {\n\tconst source = findActivitySource(target);\n\tinvariant(source !== void 0, \"The queryable cannot start activities\");\n\treturn source;\n}\n/** An activity source that starts activities on whatever queryable `target()` returns when called, for an object that sends its statements to a queryable it looks up each time. */\nfunction delegatingActivitySource(target) {\n\treturn {\n\t\tstartActivity: (activity) => startActivityOn(target(), activity),\n\t\tplanContentHash: (plan) => planContentHashOn(target(), plan)\n\t};\n}\n/** Starts an activity on a queryable through its `activitySource` member. */\nfunction startActivityOn(target, activity) {\n\treturn activitySourceOf(target).startActivity(activity);\n}\nfunction planContentHashOn(target, plan) {\n\treturn activitySourceOf(target).planContentHash(plan);\n}\n//#endregion\n//#region src/codecs/ast-codec-resolver.ts\n/**\n* Build an {@link AstCodecResolver} bound to a descriptor registry and a per-call instance-context factory.\n*\n* The instance-context factory lets callers control `name` / `usedAt` for refs the AST supplies (e.g. AST-embedded migration ops where the materialisation site is the AST node, not a contract column). The contract-walk pre-population path constructs its own contexts and invokes the resolver with those refs to seed the cache.\n*/\nfunction createAstCodecResolver(descriptors, instanceContextFor) {\n\tconst cache = /* @__PURE__ */ new Map();\n\treturn { forCodecRef(ref) {\n\t\tconst key = `${ref.codecId}:${canonicalizeJson(ref.typeParams)}`;\n\t\tconst cached = cache.get(key);\n\t\tif (cached) return cached;\n\t\tconst codec = materializeCodec(resolveCodecDescriptorOrThrow((id) => descriptors.descriptorFor(id), ref, \"RUNTIME.CODEC_DESCRIPTOR_MISSING\"), ref, instanceContextFor(ref));\n\t\tcache.set(key, codec);\n\t\treturn codec;\n\t} };\n}\n//#endregion\n//#region src/codecs/ast-codec-registry.ts\n/**\n* Build a contract-free {@link ContractCodecRegistry} that resolves codecs\n* purely from AST-supplied {@link import('@internal/framework-components/codec').CodecRef}s\n* against a target's descriptor registry.\n*\n* Dispatch is driven entirely by `CodecRef`s embedded in AST nodes; no\n* contract walk is needed. `forColumn` always returns `undefined` — this\n* registry carries no column-to-codec mappings.\n*/\nfunction createAstCodecRegistry(descriptors) {\n\tconst resolver = createAstCodecResolver(descriptors, (ref) => ({\n\t\tname: ref.codecId,\n\t\tusedAt: []\n\t}));\n\treturn {\n\t\tforColumn: () => void 0,\n\t\tforCodecRef: (ref) => resolver.forCodecRef(ref)\n\t};\n}\n//#endregion\n//#region src/codecs/encoding.ts\nconst NO_METADATA = Object.freeze({\n\tcodec: void 0,\n\tname: void 0\n});\nfunction deriveParamMetadata(ast) {\n\treturn collectOrderedParamRefs(ast).map((ref) => {\n\t\treturn {\n\t\t\tcodec: ref.codec,\n\t\t\tname: ref.name\n\t\t};\n\t});\n}\nfunction resolveParamCodec(metadata, contractCodecs) {\n\tif (metadata.codec && contractCodecs) return contractCodecs.forCodecRef(metadata.codec);\n}\nfunction paramLabel(metadata, paramIndex) {\n\treturn metadata.name ?? `param[${paramIndex}]`;\n}\nfunction wrapEncodeFailure(error, metadata, paramIndex, codecId) {\n\tif (isInternalError(error)) throw error;\n\tconst label = paramLabel(metadata, paramIndex);\n\tconst wrapped = runtimeError(\"RUNTIME.ENCODE_FAILED\", `Failed to encode parameter ${label} with codec '${codecId}': ${error instanceof Error ? error.message : String(error)}`, {\n\t\tlabel,\n\t\tcodec: codecId,\n\t\tparamIndex\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\nasync function encodeParamValue(value, metadata, paramIndex, ctx, contractCodecs) {\n\tif (value === null || value === void 0) return null;\n\tconst codec = resolveParamCodec(metadata, contractCodecs);\n\tif (!codec) return value;\n\tif (metadata.codec?.many) {\n\t\tif (!Array.isArray(value)) wrapEncodeFailure(/* @__PURE__ */ new TypeError(`expected an array for many-typed parameter, got ${typeof value}`), metadata, paramIndex, codec.id);\n\t\tconst encoded = [];\n\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\tconst elem = value[i];\n\t\t\tif (elem === null || elem === void 0) {\n\t\t\t\tencoded.push(null);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tencoded.push(await codec.toWire(elem, ctx));\n\t\t\t} catch (error) {\n\t\t\t\tif (isStructuredError(error)) throw error;\n\t\t\t\twrapEncodeFailure(error, metadata, paramIndex, codec.id);\n\t\t\t}\n\t\t}\n\t\treturn encoded;\n\t}\n\ttry {\n\t\treturn await codec.toWire(value, ctx);\n\t} catch (error) {\n\t\tif (isStructuredError(error)) throw error;\n\t\twrapEncodeFailure(error, metadata, paramIndex, codec.id);\n\t}\n}\n/**\n* Encodes all parameters concurrently via `Promise.all`. Per parameter, sync-and async-authored codecs share the same path: `codec.encode → await → return`. Param-level failures are wrapped in `RUNTIME.ENCODE_FAILED`.\n*\n* When `ctx.signal` is provided:\n*\n* - **Already-aborted at entry** short-circuits with `RUNTIME.ABORTED` (`{ phase: 'encode' }`) before any `codec.encode` call is made — codecs can pin this with a per-call counter that stays at zero.\n* - **Mid-flight abort** races the per-param `Promise.all` against `abortable(ctx.signal)`. The runtime returns `RUNTIME.ABORTED` promptly even if codec bodies ignore the signal; the in-flight bodies are abandoned and run to completion in the background (cooperative cancellation, see ADR 204).\n* - Existing structured envelopes (any dotted-code error passing `isStructuredError`, e.g. `RUNTIME.ENCODE_FAILED`) that surface from a codec body before the runtime observes the abort pass through unchanged (no double wrap).\n*/\nasync function encodeParams(plan, ctx, contractCodecs) {\n\treturn encodeParamsWithMetadata(plan.params, deriveParamMetadata(plan.ast), ctx, contractCodecs);\n}\nasync function encodeParamsWithMetadata(values, metadata, ctx, contractCodecs) {\n\tcheckAborted(ctx, \"encode\");\n\tconst signal = ctx.signal;\n\tif (values.length === 0) return values;\n\tconst tasks = values.map((value, i) => encodeParamValue(value, metadata[i] ?? NO_METADATA, i, ctx, contractCodecs));\n\tconst settled = await raceAgainstAbort(Promise.all(tasks), signal, \"encode\");\n\treturn Object.freeze(settled);\n}\n//#endregion\n//#region src/codecs/validation.ts\nfunction extractCodecIds(contract) {\n\tconst codecIds = /* @__PURE__ */ new Set();\n\tfor (const ns of Object.values(contract.storage.namespaces)) for (const table of Object.values(ns.entries.table ?? {})) for (const column of Object.values(table.columns)) {\n\t\tconst codecId = column.codecId;\n\t\tcodecIds.add(codecId);\n\t}\n\treturn codecIds;\n}\nfunction extractColumnCodecRefs(contract) {\n\tconst refs = [];\n\tfor (const [namespaceId, ns] of Object.entries(contract.storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [columnName, column] of Object.entries(table.columns)) refs.push({\n\t\tnamespaceId,\n\t\ttable: tableName,\n\t\tcolumn: columnName,\n\t\tcodecId: column.codecId\n\t});\n\treturn refs;\n}\nfunction validateContractCodecMappings(registry, contract) {\n\tconst invalidCodecs = extractColumnCodecRefs(contract).filter((ref) => registry.descriptorFor(ref.codecId) === void 0);\n\tif (invalidCodecs.length > 0) {\n\t\tconst details = {\n\t\t\tcontractTarget: contract.target,\n\t\t\tinvalidCodecs\n\t\t};\n\t\tthrow runtimeError(\"RUNTIME.CODEC_MISSING\", `Missing codec implementations for column codecIds: ${invalidCodecs.map((c) => `${c.namespaceId}.${c.table}.${c.column} (${c.codecId})`).join(\", \")}`, details);\n\t}\n}\nfunction validateCodecRegistryCompleteness(registry, contract) {\n\tvalidateContractCodecMappings(registry, contract);\n}\n//#endregion\n//#region src/lower-sql-plan.ts\n/**\n* Lowers a SQL query plan to an executable Plan by calling the adapter's lower method.\n*\n* Ad-hoc lowerings produce only `{kind: 'literal'}` slots; this helper\n* unwraps them into the bare-value array `SqlExecutionPlan` exposes.\n* Encountering a `{kind: 'bind'}` slot here means the caller passed an\n* AST containing `PreparedParamRef` to the ad-hoc execute path — that's a\n* caller error, surfaced as `RUNTIME.PREPARE_BIND_ON_ADHOC`.\n*/\nfunction lowerSqlPlan(adapter, contract, queryPlan) {\n\tconst lowered = adapter.lower(queryPlan.ast, {\n\t\tcontract,\n\t\tparams: queryPlan.params\n\t});\n\tconst params = lowered.params.map((slot) => {\n\t\tif (slot.kind === \"literal\") return slot.value;\n\t\tthrow runtimeError(\"RUNTIME.PREPARE_BIND_ON_ADHOC\", `Ad-hoc execute received a bind-site slot for '${slot.name}' — bind-site references are only valid inside runtime.prepare(...).`, { name: slot.name });\n\t});\n\treturn Object.freeze({\n\t\tsql: lowered.sql,\n\t\tparams,\n\t\tast: queryPlan.ast,\n\t\tmeta: queryPlan.meta\n\t});\n}\n//#endregion\n//#region src/middleware/budgets.ts\nfunction hasAggregateWithoutGroupBy(ast) {\n\tif (ast.groupBy !== void 0) return false;\n\treturn ast.projection.some((item) => item.expr.kind === \"aggregate\");\n}\nfunction primaryTableFromAst(ast) {\n\tif (ast.from === void 0) return void 0;\n\tswitch (ast.from.kind) {\n\t\tcase \"table-source\": return ast.from.name;\n\t\tcase \"derived-table-source\": return ast.from.alias;\n\t\tcase \"function-source\": return ast.from.fn;\n\t\t// v8 ignore next 4\n\t\tdefault: return assertNever(ast.from, `Unsupported source kind: ${ast.from.kind}`);\n\t}\n}\nfunction estimateRowsFromAst(ast, tableRows, defaultTableRows, hasAggregateWithoutGroup) {\n\tif (hasAggregateWithoutGroup) return 1;\n\tconst primaryTable = primaryTableFromAst(ast);\n\tconst tableEstimate = (primaryTable !== void 0 ? tableRows[primaryTable] : void 0) ?? defaultTableRows;\n\tif (typeof ast.limit === \"number\") return Math.min(ast.limit, tableEstimate);\n\treturn tableEstimate;\n}\nfunction emitBudgetViolation(error, shouldBlock, ctx) {\n\tif (shouldBlock) throw error;\n\tctx.log.warn({\n\t\tcode: error.code,\n\t\tmessage: error.message,\n\t\tdetails: error.details\n\t});\n}\nconst observedRows = Symbol(\"budgets.observedRows\");\nfunction budgets(options) {\n\tconst maxRows = options?.maxRows ?? 1e4;\n\tconst defaultTableRows = options?.defaultTableRows ?? 1e4;\n\tconst tableRows = options?.tableRows ?? {};\n\tconst maxLatencyMs = options?.maxLatencyMs ?? 1e3;\n\tconst rowSeverity = options?.severities?.rowCount ?? \"error\";\n\tconst latencySeverity = options?.severities?.latency ?? \"warn\";\n\treturn Object.freeze({\n\t\tname: \"budgets\",\n\t\tfamilyId: \"sql\",\n\t\tasync beforeEncode(plan, ctx) {\n\t\t\tif (isQueryAst(plan.ast) && plan.ast.kind === \"select\") evaluateSelectAst(plan.ast, ctx);\n\t\t},\n\t\tasync onRow(_row, _plan, ctx) {\n\t\t\tconst observed = ctx.state(observedRows);\n\t\t\tconst count = (typeof observed[\"count\"] === \"number\" ? observed[\"count\"] : 0) + 1;\n\t\t\tobserved[\"count\"] = count;\n\t\t\tif (count <= maxRows || observed[\"warned\"] === true) return;\n\t\t\tconst shouldBlock = rowSeverity === \"error\" || ctx.mode === \"strict\";\n\t\t\tif (!shouldBlock) observed[\"warned\"] = true;\n\t\t\temitBudgetViolation(runtimeError(\"BUDGET.ROWS_EXCEEDED\", \"Observed row count exceeds budget\", {\n\t\t\t\tsource: \"observed\",\n\t\t\t\tobservedRows: count,\n\t\t\t\tmaxRows\n\t\t\t}), shouldBlock, ctx);\n\t\t},\n\t\tasync activityEnded(_activity, result, ctx) {\n\t\t\tif (result.kind === \"statement\") checkLatency(result.latencyMs, ctx);\n\t\t}\n\t});\n\tfunction checkLatency(latencyMs, ctx) {\n\t\tif (latencyMs > maxLatencyMs) {\n\t\t\tconst shouldBlock = latencySeverity === \"error\" || ctx.mode === \"strict\";\n\t\t\temitBudgetViolation(runtimeError(\"BUDGET.TIME_EXCEEDED\", \"Query latency exceeds budget\", {\n\t\t\t\tlatencyMs,\n\t\t\t\tmaxLatencyMs\n\t\t\t}), shouldBlock, ctx);\n\t\t}\n\t}\n\tfunction evaluateSelectAst(ast, ctx) {\n\t\tconst hasAggNoGroup = hasAggregateWithoutGroupBy(ast);\n\t\tconst estimated = estimateRowsFromAst(ast, tableRows, defaultTableRows, hasAggNoGroup);\n\t\tconst isUnbounded = ast.limit === void 0 && !hasAggNoGroup;\n\t\tconst shouldBlock = rowSeverity === \"error\" || ctx.mode === \"strict\";\n\t\tif (isUnbounded) {\n\t\t\temitBudgetViolation(runtimeError(\"BUDGET.ROWS_EXCEEDED\", \"Unbounded SELECT query exceeds budget\", estimated >= maxRows ? {\n\t\t\t\tsource: \"ast\",\n\t\t\t\testimatedRows: estimated,\n\t\t\t\tmaxRows\n\t\t\t} : {\n\t\t\t\tsource: \"ast\",\n\t\t\t\tmaxRows\n\t\t\t}), shouldBlock, ctx);\n\t\t\treturn;\n\t\t}\n\t\tif (estimated > maxRows) emitBudgetViolation(runtimeError(\"BUDGET.ROWS_EXCEEDED\", \"Estimated row count exceeds budget\", {\n\t\t\tsource: \"ast\",\n\t\t\testimatedRows: estimated,\n\t\t\tmaxRows\n\t\t}), shouldBlock, ctx);\n\t}\n}\n//#endregion\n//#region src/guardrails/raw.ts\nconst SELECT_STAR_REGEX = /select\\s+\\*/i;\nconst LIMIT_REGEX = /\\blimit\\b/i;\nconst MUTATION_PREFIX_REGEX = /^(insert|update|delete|create|alter|drop|truncate)\\b/i;\nconst READ_ONLY_INTENTS = /* @__PURE__ */ new Set([\n\t\"read\",\n\t\"report\",\n\t\"readonly\"\n]);\nfunction evaluateRawGuardrails(plan, config) {\n\tconst lints = [];\n\tconst budgets = [];\n\tconst normalized = normalizeWhitespace(plan.sql);\n\tconst statementType = classifyStatement(normalized);\n\tif (statementType === \"select\") {\n\t\tif (SELECT_STAR_REGEX.test(normalized)) lints.push(createLint(\"LINT.SELECT_STAR\", \"error\", \"Raw SQL plan selects all columns via *\", { sql: snippet(plan.sql) }));\n\t\tif (!LIMIT_REGEX.test(normalized)) {\n\t\t\tconst severity = config?.budgets?.unboundedSelectSeverity ?? \"error\";\n\t\t\tlints.push(createLint(\"LINT.NO_LIMIT\", \"warn\", \"Raw SQL plan omits LIMIT clause\", { sql: snippet(plan.sql) }));\n\t\t\tbudgets.push(createBudget(\"BUDGET.ROWS_EXCEEDED\", severity, \"Raw SQL plan is unbounded and may exceed row budget\", {\n\t\t\t\tsql: snippet(plan.sql),\n\t\t\t\t...config?.budgets?.estimatedRows !== void 0 ? { estimatedRows: config.budgets.estimatedRows } : {}\n\t\t\t}));\n\t\t}\n\t}\n\tif (isMutationStatement(statementType) && isReadOnlyIntent(plan.meta)) lints.push(createLint(\"LINT.READ_ONLY_MUTATION\", \"error\", \"Raw SQL plan mutates data despite read-only intent\", {\n\t\tsql: snippet(plan.sql),\n\t\tintent: plan.meta.annotations?.[\"intent\"]\n\t}));\n\treturn {\n\t\tlints,\n\t\tbudgets,\n\t\tstatement: statementType\n\t};\n}\nfunction classifyStatement(sql) {\n\tconst trimmed = sql.trim();\n\tconst lower = trimmed.toLowerCase();\n\tif (lower.startsWith(\"with\")) {\n\t\tif (lower.includes(\"select\")) return \"select\";\n\t}\n\tif (lower.startsWith(\"select\")) return \"select\";\n\tif (MUTATION_PREFIX_REGEX.test(trimmed)) return \"mutation\";\n\treturn \"other\";\n}\nfunction isMutationStatement(statement) {\n\treturn statement === \"mutation\";\n}\nfunction isReadOnlyIntent(meta) {\n\tconst annotations = meta.annotations;\n\tconst intent = typeof annotations?.intent === \"string\" ? annotations.intent.toLowerCase() : void 0;\n\treturn intent !== void 0 && READ_ONLY_INTENTS.has(intent);\n}\nfunction normalizeWhitespace(value) {\n\treturn value.replace(/\\s+/g, \" \").trim();\n}\nfunction snippet(sql) {\n\treturn normalizeWhitespace(sql).slice(0, 200);\n}\nfunction createLint(code, severity, message, details) {\n\treturn {\n\t\tcode,\n\t\tseverity,\n\t\tmessage,\n\t\t...details ? { details } : {}\n\t};\n}\nfunction createBudget(code, severity, message, details) {\n\treturn {\n\t\tcode,\n\t\tseverity,\n\t\tmessage,\n\t\t...details ? { details } : {}\n\t};\n}\n//#endregion\n//#region src/middleware/lints.ts\nfunction getFromSourceTableDetail(source) {\n\tswitch (source.kind) {\n\t\tcase \"table-source\": return source.name;\n\t\tcase \"derived-table-source\": return source.alias;\n\t\tcase \"function-source\": return source.fn;\n\t\t// v8 ignore next 4\n\t\tdefault: return assertNever(source, `Unsupported source kind: ${source.kind}`);\n\t}\n}\nfunction evaluateAstLints(ast) {\n\tconst findings = [];\n\tswitch (ast.kind) {\n\t\tcase \"delete\":\n\t\t\tif (ast.where === void 0) findings.push({\n\t\t\t\tcode: \"LINT.DELETE_WITHOUT_WHERE\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tmessage: \"DELETE without WHERE clause blocks execution to prevent accidental full-table deletion\",\n\t\t\t\tdetails: { table: ast.table.name }\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"update\":\n\t\t\tif (ast.where === void 0) findings.push({\n\t\t\t\tcode: \"LINT.UPDATE_WITHOUT_WHERE\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tmessage: \"UPDATE without WHERE clause blocks execution to prevent accidental full-table update\",\n\t\t\t\tdetails: { table: ast.table.name }\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"select\":\n\t\t\tif (ast.limit === void 0) {\n\t\t\t\tconst table = ast.from !== void 0 ? getFromSourceTableDetail(ast.from) : void 0;\n\t\t\t\tfindings.push({\n\t\t\t\t\tcode: \"LINT.NO_LIMIT\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\tmessage: \"Unbounded SELECT may return large result sets\",\n\t\t\t\t\t...ifDefined(\"details\", table !== void 0 ? { table } : void 0)\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (ast.selectAllIntent !== void 0) {\n\t\t\t\tconst table = ast.selectAllIntent.table;\n\t\t\t\tfindings.push({\n\t\t\t\t\tcode: \"LINT.SELECT_STAR\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\tmessage: \"Query selects all columns via selectAll intent\",\n\t\t\t\t\t...ifDefined(\"details\", table !== void 0 ? { table } : void 0)\n\t\t\t\t});\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"insert\": break;\n\t\tcase \"raw-query\": break;\n\t\t// v8 ignore next 2\n\t\tdefault: assertNever(ast, `Unsupported AST kind: ${ast.kind}`);\n\t}\n\treturn findings;\n}\nfunction getConfiguredSeverity(code, options) {\n\tconst severities = options?.severities;\n\tif (!severities) return void 0;\n\tswitch (code) {\n\t\tcase \"LINT.SELECT_STAR\": return severities.selectStar;\n\t\tcase \"LINT.NO_LIMIT\": return severities.noLimit;\n\t\tcase \"LINT.DELETE_WITHOUT_WHERE\": return severities.deleteWithoutWhere;\n\t\tcase \"LINT.UPDATE_WITHOUT_WHERE\": return severities.updateWithoutWhere;\n\t\tcase \"LINT.READ_ONLY_MUTATION\": return severities.readOnlyMutation;\n\t\tdefault: return;\n\t}\n}\n/**\n* AST-first lint middleware for SQL plans. When `plan.ast` is a SQL QueryAst, inspects\n* the AST structurally. When `plan.ast` is missing, falls back to raw heuristic\n* guardrails or skips linting depending on `fallbackWhenAstMissing`.\n*\n* Rules (AST-based):\n* - DELETE without WHERE: blocks execution (configurable severity, default error)\n* - UPDATE without WHERE: blocks execution (configurable severity, default error)\n* - Unbounded SELECT: warn/error (severity from noLimit)\n* - SELECT * intent: warn/error (severity from selectStar)\n*\n* Fallback: When ast is missing, `fallbackWhenAstMissing: 'raw'` uses heuristic\n* SQL parsing; `'skip'` skips all lints. Default is `'raw'`.\n*/\nfunction lints(options) {\n\tconst fallback = options?.fallbackWhenAstMissing ?? \"raw\";\n\tconst beforeOperation = async (plan, ctx) => {\n\t\tconst findings = [];\n\t\tif (isQueryAst(plan.ast)) {\n\t\t\tfindings.push(...evaluateAstLints(plan.ast));\n\t\t\tif (plan.ast.kind === \"raw-query\") findings.push(...evaluateRawGuardrails(plan).lints);\n\t\t} else if (fallback !== \"skip\") findings.push(...evaluateRawGuardrails(plan).lints);\n\t\tfor (const lint of findings) {\n\t\t\tconst effectiveSeverity = getConfiguredSeverity(lint.code, options) ?? lint.severity;\n\t\t\tif (effectiveSeverity === \"error\") throw runtimeError(lint.code, lint.message, lint.details);\n\t\t\tif (effectiveSeverity === \"warn\") ctx.log.warn({\n\t\t\t\tcode: lint.code,\n\t\t\t\tmessage: lint.message,\n\t\t\t\tdetails: lint.details\n\t\t\t});\n\t\t}\n\t};\n\treturn Object.freeze({\n\t\tname: \"lints\",\n\t\tfamilyId: \"sql\",\n\t\tbeforeEncode: beforeOperation\n\t});\n}\n//#endregion\n//#region src/prepared/prepared-statement.ts\nvar PreparedStatementImpl = class {\n\tsql;\n\tast;\n\tmeta;\n\tslots;\n\tdecodeContext;\n\tparamMetadata;\n\tconstructor(internals) {\n\t\tthis.sql = internals.sql;\n\t\tthis.ast = internals.ast;\n\t\tthis.meta = internals.meta;\n\t\tthis.slots = internals.slots;\n\t\tthis.decodeContext = internals.decodeContext;\n\t\tthis.paramMetadata = internals.paramMetadata;\n\t\tObject.freeze(this);\n\t}\n\tquery(target, params, options) {\n\t\treturn runPreparedQuery(target, this, params, options);\n\t}\n};\n/**\n* The statistics-reporting sibling of {@link PreparedStatementImpl}. A plan\n* declaring an affected-row count prepares into one of these, which carries\n* the same lowered statement and bind slots and is consumed by executing it.\n*\n* The two classes are separate so the consumption a plan did not declare is\n* absent from the value, not merely from its type.\n*/\nvar PreparedExecutionImpl = class {\n\tsql;\n\tast;\n\tmeta;\n\tslots;\n\tdecodeContext;\n\tparamMetadata;\n\tconstructor(internals) {\n\t\tthis.sql = internals.sql;\n\t\tthis.ast = internals.ast;\n\t\tthis.meta = internals.meta;\n\t\tthis.slots = internals.slots;\n\t\tthis.decodeContext = internals.decodeContext;\n\t\tthis.paramMetadata = internals.paramMetadata;\n\t\tObject.freeze(this);\n\t}\n\texecute(target, params, options) {\n\t\treturn runPreparedExecute(target, this, params, options);\n\t}\n};\n//#endregion\n//#region src/sql-context.ts\nfunction documentScopedCodecTypes(contract) {\n\treturn blindCast(contract.storage.types);\n}\nfunction createSqlExecutionStack(options) {\n\treturn createExecutionStack({\n\t\ttarget: options.target,\n\t\tadapter: options.adapter,\n\t\tdriver: options.driver,\n\t\textensions: options.extensions\n\t});\n}\nfunction assertExecutionStackContractRequirements(contract, stack) {\n\tconst providedComponentIds = /* @__PURE__ */ new Set([\n\t\tstack.target.id,\n\t\tstack.adapter.id,\n\t\t...stack.extensions.map((pack) => pack.id)\n\t]);\n\tconst result = checkContractComponentRequirements({\n\t\tcontract,\n\t\texpectedTargetFamily: \"sql\",\n\t\texpectedTargetId: stack.target.targetId,\n\t\tprovidedComponentIds\n\t});\n\tif (result.familyMismatch) throw runtimeError(\"RUNTIME.CONTRACT_FAMILY_MISMATCH\", `Contract target family '${result.familyMismatch.actual}' does not match runtime family '${result.familyMismatch.expected}'.`, {\n\t\tactual: result.familyMismatch.actual,\n\t\texpected: result.familyMismatch.expected\n\t});\n\tif (result.targetMismatch) throw runtimeError(\"RUNTIME.CONTRACT_TARGET_MISMATCH\", `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`, {\n\t\tactual: result.targetMismatch.actual,\n\t\texpected: result.targetMismatch.expected\n\t});\n\tif (result.missingExtensionPackIds.length > 0) {\n\t\tconst packIds = result.missingExtensionPackIds;\n\t\tthrow runtimeError(\"RUNTIME.MISSING_EXTENSION_PACK\", `Contract requires extension pack(s) ${packIds.map((id) => `'${id}'`).join(\", \")}, but runtime descriptors do not provide matching component(s).`, { packIds });\n\t}\n}\nfunction validateTypeParams(typeParams, descriptor, context) {\n\tconst result = descriptor.paramsSchema[\"~standard\"].validate(typeParams);\n\tif (result instanceof Promise) throw runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `paramsSchema for codec '${descriptor.codecId}' returned a Promise; runtime validation requires a synchronous Standard Schema validator.`, {\n\t\t...context,\n\t\tcodecId: descriptor.codecId,\n\t\ttypeParams\n\t});\n\tif (result.issues) {\n\t\tconst messages = result.issues.map((issue) => issue.message).join(\"; \");\n\t\tthrow runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid typeParams for ${context.typeName ? `type '${context.typeName}'` : `column '${context.tableName}.${context.columnName}'`} (codecId: ${descriptor.codecId}): ${messages}`, {\n\t\t\t...context,\n\t\t\tcodecId: descriptor.codecId,\n\t\t\ttypeParams\n\t\t});\n\t}\n\treturn blindCast(result.value);\n}\n/**\n* Collect every {@link CodecDescriptor} contributed by the SQL stack and partition into \"parameterized\" vs \"non-parameterized\" via the descriptor's own {@link CodecDescriptorImpl.isParameterized} getter: a descriptor is parameterized when it has a `paramsSchema`.\n*\n* The unified descriptor list collapses the legacy split (a separate slot used to register parameterized codecs) — every codec id resolves through the same map (codec-registry-unification spec § Decision).\n*/\nfunction collectCodecDescriptors(contributors) {\n\tconst all = [];\n\tconst parameterized = /* @__PURE__ */ new Map();\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const contributor of contributors) for (const descriptor of contributor.codecs()) {\n\t\tif (seen.has(descriptor.codecId)) throw runtimeError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate codec descriptor for codecId '${descriptor.codecId}'.`, { codecId: descriptor.codecId });\n\t\tseen.add(descriptor.codecId);\n\t\tall.push(descriptor);\n\t\tif (descriptor.isParameterized) parameterized.set(descriptor.codecId, blindCast(descriptor));\n\t}\n\treturn {\n\t\tall,\n\t\tparameterized\n\t};\n}\n/**\n* Flatten every aggregate descriptor the SQL stack contributes. Shape validation, single-ownership of each `(operation, input)` pair, and trait-overlap resolution all happen inside {@link buildSqlAggregateDescriptorRegistry}, so contributions reach it unchecked and fail there — at composition, never mid-query.\n*/\nfunction collectAggregateDescriptorContributions(contributors) {\n\treturn contributors.flatMap((contributor) => contributor.types?.aggregateDescriptors ?? []);\n}\nfunction collectTypeRefSites(storage) {\n\tconst sites = /* @__PURE__ */ new Map();\n\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [columnName, column] of Object.entries(table.columns)) {\n\t\tif (typeof column.typeRef !== \"string\") continue;\n\t\tconst list = sites.get(column.typeRef);\n\t\tconst entry = {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName\n\t\t};\n\t\tif (list) list.push(entry);\n\t\telse sites.set(column.typeRef, [entry]);\n\t}\n\treturn sites;\n}\nfunction initializeTypeHelpers(storage, documentTypes, codecDescriptors) {\n\tconst helpers = {};\n\tif (!documentTypes) return helpers;\n\tconst typeRefSites = collectTypeRefSites(storage);\n\tfor (const [typeName, typeInstance] of Object.entries(documentTypes)) {\n\t\tconst codecId = typeInstance.codecId;\n\t\tconst typeParams = typeInstance.typeParams;\n\t\tconst descriptor = codecDescriptors.get(codecId);\n\t\tif (!descriptor) {\n\t\t\thelpers[typeName] = typeInstance;\n\t\t\tcontinue;\n\t\t}\n\t\tconst validatedParams = validateTypeParams(typeParams ?? {}, descriptor, { typeName });\n\t\tconst ctx = {\n\t\t\tname: typeName,\n\t\t\tusedAt: typeRefSites.get(typeName) ?? []\n\t\t};\n\t\thelpers[typeName] = descriptor.factory(validatedParams)(ctx);\n\t}\n\treturn helpers;\n}\nfunction validateColumnTypeParams(storage, codecDescriptors) {\n\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [columnName, column] of Object.entries(table.columns)) if (column.typeParams) {\n\t\tconst descriptor = codecDescriptors.get(column.codecId);\n\t\tif (descriptor) validateTypeParams(column.typeParams, descriptor, {\n\t\t\ttableName,\n\t\t\tcolumnName\n\t\t});\n\t}\n}\n/**\n* Build-time contract-integrity check: every `(table, column)` resolves to a {@link CodecRef} whose `codecId` is registered and whose `typeParams` presence matches the descriptor's `isParameterized` flag.\n*\n* Surfaces three classes of malformed contract that AST-bound codec resolution would otherwise mask silently:\n*\n* - column references a codecId no contributor registered → `RUNTIME.CODEC_DESCRIPTOR_MISSING`.\n* - parameterized codec, no `typeParams` (legacy \"tolerate refs without params\" shape) → `RUNTIME.CODEC_PARAMETERIZATION_MISMATCH`.\n* - non-parameterized codec, `typeParams` supplied → `RUNTIME.CODEC_PARAMETERIZATION_MISMATCH`.\n*\n* Runs unconditionally from `createExecutionContext` so contract bugs fail fast at construction time instead of silently skipping affected columns in the codec registry's pre-population walk.\n*/\nfunction assertColumnCodecIntegrity(storage, codecDescriptors) {\n\tfor (const [namespaceId, ns] of Object.entries(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const columnName of Object.keys(table.columns)) {\n\t\tconst ref = codecDescriptors.codecRefForColumn(namespaceId, tableName, columnName);\n\t\tif (!ref) continue;\n\t\tconst descriptor = codecDescriptors.descriptorFor(ref.codecId);\n\t\tif (!descriptor) throw runtimeError(\"RUNTIME.CODEC_DESCRIPTOR_MISSING\", `Column '${tableName}.${columnName}' references codec '${ref.codecId}' but no contributor registered a codec descriptor for that codecId. Add the extension pack that owns the codec to the runtime stack.`, {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName,\n\t\t\tcodecId: ref.codecId\n\t\t});\n\t\tconst paramsSchema = descriptor.paramsSchema;\n\t\tif (paramsSchema !== void 0 && ref.typeParams === void 0) {\n\t\t\tconst probe = paramsSchema[\"~standard\"].validate({});\n\t\t\tif (probe instanceof Promise) {\n\t\t\t\tprobe.catch(() => {});\n\t\t\t\tthrow runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Column '${tableName}.${columnName}' uses parameterized codec '${ref.codecId}' whose paramsSchema returned a Promise; paramsSchema must be a synchronous Standard Schema validator. Return a value/issues result directly instead of a Promise.`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcolumn: columnName,\n\t\t\t\t\tcodecId: ref.codecId\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (\"issues\" in probe && !!probe.issues) throw runtimeError(\"RUNTIME.CODEC_PARAMETERIZATION_MISMATCH\", `Column '${tableName}.${columnName}' uses parameterized codec '${ref.codecId}' but no typeParams are supplied. Provide typeParams on the column, or use a typeRef pointing at a storage.types entry that carries them.`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: columnName,\n\t\t\t\tcodecId: ref.codecId,\n\t\t\t\texpected: \"parameterized\",\n\t\t\t\tactual: \"no typeParams\"\n\t\t\t});\n\t\t}\n\t\tconst refTypeParams = ref.typeParams;\n\t\tconst refHasTypeParamKeys = refTypeParams !== void 0 && refTypeParams !== null && typeof refTypeParams === \"object\" && !Array.isArray(refTypeParams) && Object.keys(refTypeParams).length > 0;\n\t\tif (!descriptor.isParameterized && refHasTypeParamKeys) throw runtimeError(\"RUNTIME.CODEC_PARAMETERIZATION_MISMATCH\", `Column '${tableName}.${columnName}' supplies typeParams to non-parameterized codec '${ref.codecId}'. Remove the typeParams or switch to a parameterized codec id.`, {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName,\n\t\t\tcodecId: ref.codecId,\n\t\t\texpected: \"non-parameterized\",\n\t\t\tactual: \"has typeParams\"\n\t\t});\n\t}\n}\n/**\n* Build a {@link ContractCodecRegistry} that resolves codecs exclusively through the `forCodecRef` content-keyed cache.\n*\n* One pre-population pass walks `storage.types` and `storage.tables[].columns[]` to seed the resolver's per-ref instance context with the *aggregated* `usedAt` set for each canonical `(codecId, typeParams)` key. The same codec materialised through `forColumn` or `forCodecRef` is therefore one instance with one `SqlCodecInstanceContext` — stateful codecs reading `usedAt` see the full column set regardless of which surface the caller used.\n*\n* Per-key instance-name policy:\n*\n* - typeRef-shared columns use the `storage.types[name]` name.\n* - inline-`typeParams` columns use `<col:Table.column>` (the first column observed at that key; additional columns sharing the key extend `usedAt`).\n* - non-parameterized codec ids use `<codec:codecId>`, aggregating every column on that codec id into one `usedAt` set.\n* - ad-hoc refs the contract walk did not pre-populate (e.g. AST-supplied refs from deserialised migration ops) fall back to the canonical cache key `${codecId}:${canonicalizeJson(typeParams)}` — the only structurally honest identity for an ad-hoc ref, distinct per `(codecId, typeParams)`.\n*\n* Contract integrity is enforced upstream by {@link assertColumnCodecIntegrity}: every column must reference a registered `codecId` whose `descriptor.isParameterized` flag matches the presence of `typeParams` (via `codecRefForColumn`). The pre-population walk and `forColumn` therefore make no defensive checks — malformed columns fail fast at `createExecutionContext` construction with `RUNTIME.CODEC_DESCRIPTOR_MISSING` or `RUNTIME.CODEC_PARAMETERIZATION_MISMATCH` rather than being silently skipped here.\n*\n* `forColumn(ns, t, c)` is a thin delegate over `forCodecRef(codecRefForColumn(ns, t, c))`; encode/decode hot paths read the resolver directly via `forCodecRef`. The only `undefined` `forColumn` returns is the legitimate \"no such column in the contract\" case.\n*/\nfunction buildContractCodecRegistry(contract, codecDescriptors) {\n\tconst refKeyOf = (ref) => `${ref.codecId}:${canonicalizeJson(ref.typeParams)}`;\n\tconst usedAtByKey = /* @__PURE__ */ new Map();\n\tconst nameByKey = /* @__PURE__ */ new Map();\n\tconst typeRefSites = collectTypeRefSites(contract.storage);\n\tfor (const [typeName, typeInstance] of Object.entries(documentScopedCodecTypes(contract) ?? {})) {\n\t\tconst instanceTypeParams = typeInstance.typeParams;\n\t\tconst key = refKeyOf(instanceTypeParams !== void 0 && Object.keys(instanceTypeParams).length > 0 ? {\n\t\t\tcodecId: typeInstance.codecId,\n\t\t\ttypeParams: blindCast(instanceTypeParams)\n\t\t} : { codecId: typeInstance.codecId });\n\t\tconst sites = typeRefSites.get(typeName) ?? [];\n\t\tconst existing = usedAtByKey.get(key);\n\t\tif (existing) existing.push(...sites);\n\t\telse {\n\t\t\tusedAtByKey.set(key, [...sites]);\n\t\t\tnameByKey.set(key, typeName);\n\t\t}\n\t}\n\tfor (const [namespaceId, ns] of Object.entries(contract.storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [columnName, column] of Object.entries(table.columns)) {\n\t\tif (column.typeRef !== void 0) continue;\n\t\tconst ref = codecDescriptors.codecRefForColumn(namespaceId, tableName, columnName);\n\t\tif (!ref) continue;\n\t\tconst key = refKeyOf(ref);\n\t\tconst site = {\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName\n\t\t};\n\t\tconst existing = usedAtByKey.get(key);\n\t\tif (existing) existing.push(site);\n\t\telse {\n\t\t\tusedAtByKey.set(key, [site]);\n\t\t\tconst name = ref.typeParams !== void 0 ? `<col:${tableName}.${columnName}>` : `<codec:${ref.codecId}>`;\n\t\t\tnameByKey.set(key, name);\n\t\t}\n\t}\n\tconst resolver = createAstCodecResolver(codecDescriptors, (ref) => {\n\t\tconst key = refKeyOf(ref);\n\t\treturn {\n\t\t\tname: nameByKey.get(key) ?? key,\n\t\t\tusedAt: usedAtByKey.get(key) ?? []\n\t\t};\n\t});\n\tfor (const [namespaceId, ns] of Object.entries(contract.storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const columnName of Object.keys(table.columns)) {\n\t\tconst ref = codecDescriptors.codecRefForColumn(namespaceId, tableName, columnName);\n\t\tif (!ref) continue;\n\t\tresolver.forCodecRef(ref);\n\t}\n\treturn {\n\t\tforColumn(namespaceId, table, column) {\n\t\t\tconst ref = codecDescriptors.codecRefForColumn(namespaceId, table, column);\n\t\t\treturn ref ? resolver.forCodecRef(ref) : void 0;\n\t\t},\n\t\tforCodecRef(ref) {\n\t\t\treturn resolver.forCodecRef(ref);\n\t\t}\n\t};\n}\nfunction createExecutionContext(options) {\n\tconst { stack, driver } = options;\n\tassertExecutionStackContractRequirements(options.contract, stack);\n\tconst capabilityContributors = [\n\t\tstack.target,\n\t\tstack.adapter,\n\t\t...driver ? [driver] : [],\n\t\t...stack.extensions\n\t];\n\tconst mergedCapabilities = mergeCapabilityMatrices(options.contract.capabilities, capabilityContributors);\n\tconst contract = {\n\t\t...options.contract,\n\t\tcapabilities: mergedCapabilities\n\t};\n\tconst contributors = [\n\t\tstack.target,\n\t\tstack.adapter,\n\t\t...stack.extensions\n\t];\n\tconst { all: allCodecDescriptors, parameterized: parameterizedCodecDescriptors } = collectCodecDescriptors(contributors);\n\tconst queryOperationRegistry = createSqlOperationRegistry();\n\tfor (const contributor of contributors) {\n\t\tconst ops = contributor.queryOperations?.() ?? {};\n\t\tfor (const [name, op] of Object.entries(ops)) queryOperationRegistry.register(name, op);\n\t}\n\tconst codecDescriptors = buildCodecDescriptorRegistry(allCodecDescriptors, contract.storage);\n\tassertColumnCodecIntegrity(contract.storage, codecDescriptors);\n\tconst aggregateDescriptors = buildSqlAggregateDescriptorRegistry(collectAggregateDescriptorContributions(contributors), codecDescriptors);\n\tconst mutationDefaultGeneratorRegistry = collectMutationDefaultGenerators(contributors);\n\tassertMutationDefaultGeneratorsAvailable(contract.execution, mutationDefaultGeneratorRegistry);\n\tif (parameterizedCodecDescriptors.size > 0) validateColumnTypeParams(contract.storage, parameterizedCodecDescriptors);\n\tconst types = initializeTypeHelpers(contract.storage, documentScopedCodecTypes(contract), parameterizedCodecDescriptors);\n\treturn {\n\t\tcontract,\n\t\tcontractCodecs: buildContractCodecRegistry(contract, codecDescriptors),\n\t\tcodecDescriptors,\n\t\taggregateDescriptors,\n\t\tqueryOperations: queryOperationRegistry,\n\t\ttypes,\n\t\trawCodecInferer: stack.adapter.rawCodecInferer,\n\t\tcollectionMethods: contributors.flatMap((contributor) => contributor.collectionMethods?.() ?? []),\n\t\tapplyMutationDefaults: (options) => applyMutationDefaults(contract.execution, mutationDefaultGeneratorRegistry, options)\n\t};\n}\n//#endregion\n//#region src/codecs/decoding.ts\nconst sqlNativeArrayListDecoder = async (wireValue, decodeElement) => {\n\tif (!Array.isArray(wireValue)) throw new TypeError(`expected an array from the driver for many-typed column, got ${typeof wireValue}`);\n\tconst decoded = [];\n\tfor (const elem of wireValue) decoded.push(await decodeElement(elem));\n\treturn decoded;\n};\nconst WIRE_PREVIEW_LIMIT = 100;\nconst EMPTY_INCLUDE_ALIASES = /* @__PURE__ */ new Set();\nfunction projectionListFromAst(ast) {\n\tif (ast.kind === \"select\") return ast.projection;\n\treturn ast.returning;\n}\nfunction resolveProjectionCodec(item, contractCodecs) {\n\tif (item.codec && contractCodecs) return contractCodecs.forCodecRef(item.codec);\n}\nconst EMPTY_MANY_ALIASES = /* @__PURE__ */ new Set();\nfunction undecodedContext() {\n\treturn {\n\t\taliases: void 0,\n\t\tcodecs: /* @__PURE__ */ new Map(),\n\t\tcolumnRefs: /* @__PURE__ */ new Map(),\n\t\tincludeAliases: EMPTY_INCLUDE_ALIASES,\n\t\tmanyAliases: EMPTY_MANY_ALIASES,\n\t\taliasSource: \"projection\"\n\t};\n}\n/**\n* Decode context for a raw statement: the columns come from the row spec its\n* author declared at the terminator, and each carries the codec that decodes\n* it. A statement that reports an affected-row count declares no columns, so\n* its single stats row passes through undecoded.\n*\n* The spec is the only description of the result — the runtime never parses\n* the SQL — so it is also what a mismatched result set is measured against.\n*/\nfunction rawQueryDecodeContext(ast, contractCodecs) {\n\tif (ast.result.kind === \"affected-count\") return undecodedContext();\n\tconst aliases = [];\n\tconst codecs = /* @__PURE__ */ new Map();\n\tfor (const [name, column] of Object.entries(ast.result.columns)) {\n\t\taliases.push(name);\n\t\tif (contractCodecs) codecs.set(name, contractCodecs.forCodecRef({ codecId: column.codecId }));\n\t}\n\treturn {\n\t\taliases,\n\t\tcodecs,\n\t\tcolumnRefs: /* @__PURE__ */ new Map(),\n\t\tincludeAliases: EMPTY_INCLUDE_ALIASES,\n\t\tmanyAliases: EMPTY_MANY_ALIASES,\n\t\taliasSource: \"row-spec\"\n\t};\n}\nfunction buildDecodeContext(ast, contractCodecs) {\n\tif (ast.kind === \"raw-query\") return rawQueryDecodeContext(ast, contractCodecs);\n\tconst projection = projectionListFromAst(ast);\n\tif (!projection || projection.length === 0) return undecodedContext();\n\tconst aliases = [];\n\tconst codecs = /* @__PURE__ */ new Map();\n\tconst columnRefs = /* @__PURE__ */ new Map();\n\tconst includeAliases = /* @__PURE__ */ new Set();\n\tconst manyAliases = /* @__PURE__ */ new Set();\n\tfor (const item of projection) {\n\t\taliases.push(item.alias);\n\t\tconst codec = resolveProjectionCodec(item, contractCodecs);\n\t\tif (codec) codecs.set(item.alias, codec);\n\t\tif (item.codec?.many) manyAliases.add(item.alias);\n\t\tif (item.expr.kind === \"column-ref\") columnRefs.set(item.alias, {\n\t\t\ttable: item.expr.table,\n\t\t\tcolumn: item.expr.column\n\t\t});\n\t\telse if (item.expr.kind === \"subquery\" || item.expr.kind === \"json-array-agg\") includeAliases.add(item.alias);\n\t}\n\treturn {\n\t\taliases,\n\t\tcodecs,\n\t\tcolumnRefs,\n\t\tincludeAliases,\n\t\tmanyAliases,\n\t\taliasSource: \"projection\"\n\t};\n}\nfunction previewWireValue(wireValue) {\n\tif (typeof wireValue === \"string\") return wireValue.length > WIRE_PREVIEW_LIMIT ? `${wireValue.substring(0, WIRE_PREVIEW_LIMIT)}...` : wireValue;\n\treturn String(wireValue).substring(0, WIRE_PREVIEW_LIMIT);\n}\nfunction wrapDecodeFailure(error, alias, ref, codec, wireValue) {\n\tif (isInternalError(error)) throw error;\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst wrapped = runtimeError(\"RUNTIME.DECODE_FAILED\", `Failed to decode column ${ref ? `${ref.table}.${ref.column}` : alias} with codec '${codec.id}': ${message}`, {\n\t\t...ref ? {\n\t\t\ttable: ref.table,\n\t\t\tcolumn: ref.column\n\t\t} : { alias },\n\t\tcodec: codec.id,\n\t\twirePreview: previewWireValue(wireValue)\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\nfunction wrapIncludeAggregateFailure(error, alias, wireValue) {\n\tconst wrapped = runtimeError(\"RUNTIME.DECODE_FAILED\", `Failed to parse JSON array for include alias '${alias}': ${error instanceof Error ? error.message : String(error)}`, {\n\t\talias,\n\t\twirePreview: previewWireValue(wireValue)\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\nfunction decodeIncludeAggregate(alias, wireValue) {\n\tif (wireValue === null || wireValue === void 0) return [];\n\ttry {\n\t\tif (typeof wireValue === \"string\") return JSON.parse(wireValue);\n\t\tif (typeof wireValue === \"object\") return blindCast(wireValue);\n\t\treturn JSON.parse(String(wireValue));\n\t} catch (error) {\n\t\twrapIncludeAggregateFailure(error, alias, wireValue);\n\t}\n}\n/**\n* Decodes a single field. Single-armed: every cell takes the same path — `codec.decode → await → return plain value` — so sync- and async-authored codecs are indistinguishable to callers. JSON-Schema validation, when required, lives inside the resolved codec's `decode` body (e.g. `arktype-json` validates against its rehydrated schema and throws `RUNTIME.JSON_SCHEMA_VALIDATION_FAILED` from `decode` directly); there is\n* no separate validator-registry pass.\n*\n* The row-level `rowCtx` is repackaged into a per-cell `SqlCodecCallContext` whose `column = { table, name }` is a structural projection of the per-cell `ColumnRef = { table, column }` resolved from the AST-backed `DecodeContext` (the same resolution `wrapDecodeFailure` uses for envelope construction — one resolution per cell, two consumers). Cells the runtime cannot resolve to a single underlying column (aggregate\n* aliases, computed projections without a simple ref) get `column: undefined`, matching the spec contract that the runtime never silently defaults this field.\n*\n* For `many`-flagged aliases this function delegates frame traversal to the selected `ListDecoder`, passing `null` elements through unchanged and mapping the same element codec over every non-null element. SQL runtimes without a target-owned contribution select `sqlNativeArrayListDecoder` explicitly before row decoding. Element-level failures surface through the existing `RUNTIME.DECODE_FAILED` envelope with the column/codec context from the parent cell.\n*/\nasync function decodeField(alias, wireValue, decodeCtx, rowCtx, listDecoder) {\n\tif (wireValue === null) return null;\n\tconst codec = decodeCtx.codecs.get(alias);\n\tif (!codec) return wireValue;\n\tconst ref = decodeCtx.columnRefs.get(alias);\n\tlet cellCtx;\n\tif (ref) cellCtx = {\n\t\t...rowCtx,\n\t\tcolumn: {\n\t\t\ttable: ref.table,\n\t\t\tname: ref.column\n\t\t}\n\t};\n\telse {\n\t\tconst { column: _drop, ...rowCtxWithoutColumn } = rowCtx;\n\t\tcellCtx = rowCtxWithoutColumn;\n\t}\n\tconst decodeElement = async (elem) => {\n\t\tif (elem === null || elem === void 0) return null;\n\t\ttry {\n\t\t\treturn await codec.fromWire(elem, cellCtx);\n\t\t} catch (error) {\n\t\t\tif (isStructuredError(error)) throw error;\n\t\t\twrapDecodeFailure(error, alias, ref, codec, elem);\n\t\t}\n\t};\n\tif (decodeCtx.manyAliases.has(alias)) try {\n\t\treturn await listDecoder(wireValue, decodeElement);\n\t} catch (error) {\n\t\tif (isStructuredError(error)) throw error;\n\t\twrapDecodeFailure(error, alias, ref, codec, wireValue);\n\t}\n\ttry {\n\t\treturn await codec.fromWire(wireValue, cellCtx);\n\t} catch (error) {\n\t\tif (isStructuredError(error)) throw error;\n\t\twrapDecodeFailure(error, alias, ref, codec, wireValue);\n\t}\n}\n/**\n* Decodes a row by dispatching all per-cell codec calls concurrently via `Promise.all`. Each cell follows the single-armed `decodeField` path. Structured envelopes thrown by codec bodies (anything passing `isStructuredError`) and an `InternalError` pass through unchanged; all other failures are wrapped in `RUNTIME.DECODE_FAILED` with `{ table, column, codec }` (or `{ alias, codec }` when no column ref is resolvable) and the original error attached on `cause`.\n*\n* When `rowCtx.signal` is provided:\n*\n* - **Already-aborted at entry** short-circuits with `RUNTIME.ABORTED` (`{ phase: 'decode' }`) before any `codec.decode` call is made.\n* - **Mid-flight aborts** race the per-cell `Promise.all` against the signal so the runtime returns promptly even when codec bodies ignore it. In-flight bodies that ignore the signal complete in the background (cooperative cancellation).\n* - Existing structured envelopes (any dotted-code error passing `isStructuredError`, e.g. `RUNTIME.DECODE_FAILED`) from codec bodies pass through unchanged (no double wrap).\n*/\nasync function decodeRow(row, decodeCtx, rowCtx, listDecoder) {\n\tcheckAborted(rowCtx, \"decode\");\n\tconst signal = rowCtx.signal;\n\tconst aliases = decodeCtx.aliases ?? Object.keys(row);\n\tif (decodeCtx.aliases !== void 0) {\n\t\tfor (const alias of decodeCtx.aliases) if (!Object.hasOwn(row, alias)) throw decodeCtx.aliasSource === \"row-spec\" ? runtimeError(\"RUNTIME.RAW_ROW_COLUMN_MISSING\", `Raw statement result has no column \"${alias}\", which its row spec declares`, {\n\t\t\tcolumn: alias,\n\t\t\tdeclaredColumns: decodeCtx.aliases,\n\t\t\tresultColumns: Object.keys(row)\n\t\t}) : runtimeError(\"RUNTIME.DECODE_FAILED\", `Row missing projection alias \"${alias}\"`, {\n\t\t\talias,\n\t\t\texpectedAliases: decodeCtx.aliases,\n\t\t\tpresentKeys: Object.keys(row)\n\t\t});\n\t}\n\tconst tasks = [];\n\tconst includeIndices = [];\n\tfor (let i = 0; i < aliases.length; i++) {\n\t\tconst alias = blindCast(aliases[i]);\n\t\tconst wireValue = row[alias];\n\t\tif (decodeCtx.includeAliases.has(alias)) {\n\t\t\tincludeIndices.push({\n\t\t\t\tindex: i,\n\t\t\t\talias,\n\t\t\t\tvalue: wireValue\n\t\t\t});\n\t\t\ttasks.push(Promise.resolve(void 0));\n\t\t\tcontinue;\n\t\t}\n\t\ttasks.push(decodeField(alias, wireValue, decodeCtx, rowCtx, listDecoder));\n\t}\n\tconst settled = await raceAgainstAbort(Promise.all(tasks), signal, \"decode\");\n\tfor (const entry of includeIndices) settled[entry.index] = decodeIncludeAggregate(entry.alias, entry.value);\n\tconst decoded = {};\n\tfor (let i = 0; i < aliases.length; i++) {\n\t\tconst alias = blindCast(aliases[i]);\n\t\tdecoded[alias] = settled[i];\n\t}\n\treturn decoded;\n}\n//#endregion\n//#region src/content-hash.ts\n/**\n* Computes a stable content hash for a lowered SQL execution plan.\n*\n* Internally builds an unambiguous canonical-stringified preimage from\n* three components:\n*\n* 1. `meta.storageHash` — discriminates by schema. A migration changes the\n* storage hash, which invalidates cached entries automatically.\n* 2. `exec.sql` — the raw lowered SQL text. Two queries with different\n* structure produce different keys. Note that we deliberately do **not**\n* use `computeSqlFingerprint` here: that helper strips literals to group\n* executions by statement shape (used by telemetry), which is the\n* opposite of what a content hash needs — we want per-execution\n* discrimination, not per-statement-shape grouping.\n* 3. `exec.params` — the bound parameters. `canonicalStringify` produces a\n* deterministic serialization that is stable across object key\n* insertion order and that distinguishes types JSON would otherwise\n* conflate (e.g. `BigInt(1)` vs `1`).\n*\n* The components are wrapped in an object and canonicalized as a single\n* unit (rather than concatenated with a delimiter) so component\n* boundaries are unambiguous: any character appearing inside `sql` or\n* `storageHash` cannot bleed across components and produce a collision\n* with a different split of the same characters.\n*\n* The canonical string is then piped through `hashContent` to produce a\n* bounded, opaque digest. See `@internal/utils/hash-content` for the\n* rationale.\n*\n* @internal\n*/\nfunction computeSqlContentHash(exec) {\n\treturn hashContent(canonicalStringify({\n\t\tstorageHash: exec.meta.storageHash,\n\t\tsql: exec.sql,\n\t\tparams: exec.params\n\t}));\n}\n//#endregion\n//#region src/fingerprint.ts\nconst STRING_LITERAL_REGEX = /'(?:''|[^'])*'/g;\nconst NUMERIC_LITERAL_REGEX = /\\b\\d+(?:\\.\\d+)?\\b/g;\nconst WHITESPACE_REGEX = /\\s+/g;\n/**\n* Computes a literal-stripped, normalized fingerprint of a SQL statement.\n*\n* The function strips string and numeric literals, collapses whitespace, and\n* lowercases the result before hashing — so two structurally equivalent\n* statements (with different parameter values) produce the same fingerprint.\n* Used by SQL telemetry to group queries.\n*/\nfunction computeSqlFingerprint(sql) {\n\tconst normalized = sql.replace(STRING_LITERAL_REGEX, \"?\").replace(NUMERIC_LITERAL_REGEX, \"?\").replace(WHITESPACE_REGEX, \" \").trim().toLowerCase();\n\treturn createHash(\"sha256\").update(normalized).digest(\"hex\");\n}\n//#endregion\n//#region src/in-flight-operations.ts\nvar InFlightOperations = class {\n\t#count = 0;\n\t#started = 0;\n\t#drainWaiters = [];\n\t/** Records one operation as in flight; the returned callback ends it and ignores later calls. */\n\tbegin() {\n\t\tthis.#count += 1;\n\t\tthis.#started += 1;\n\t\tlet ended = false;\n\t\treturn () => {\n\t\t\tif (ended) return;\n\t\t\tended = true;\n\t\t\tthis.#count -= 1;\n\t\t\tif (this.#count === 0) for (const wake of this.#drainWaiters.splice(0)) wake();\n\t\t};\n\t}\n\t/** How many operations have begun so far; a change between two reads means work started in between. */\n\tget started() {\n\t\treturn this.#started;\n\t}\n\t/** How many operations are in flight. */\n\tget count() {\n\t\treturn this.#count;\n\t}\n\tget active() {\n\t\treturn this.#count > 0;\n\t}\n\tdrained() {\n\t\tif (this.#count === 0) return Promise.resolve();\n\t\treturn new Promise((resolve) => this.#drainWaiters.push(resolve));\n\t}\n\t/** Records `work` as in flight until it settles. */\n\tasync track(work) {\n\t\tconst end = this.begin();\n\t\ttry {\n\t\t\treturn await work();\n\t\t} finally {\n\t\t\tend();\n\t\t}\n\t}\n};\n//#endregion\n//#region src/middleware/before-compile-chain.ts\nasync function runBeforeCompileChain(middleware, initial, ctx) {\n\tlet current = initial;\n\tfor (const mw of middleware) {\n\t\tif (!mw.beforeCompile) continue;\n\t\tconst result = await mw.beforeCompile(current, ctx);\n\t\tif (result === void 0) continue;\n\t\tif (result.ast === current.ast) continue;\n\t\tctx.log.debug?.({\n\t\t\tevent: \"middleware.rewrite\",\n\t\t\tmiddleware: mw.name,\n\t\t\tlane: current.meta.lane\n\t\t});\n\t\tcurrent = result;\n\t}\n\treturn current;\n}\n//#endregion\n//#region src/owned-transaction.ts\n/**\n* Begins a transaction on a connection the transaction owns. The connection is released once the transaction has committed or rolled back, and destroyed after a failed rollback or a failed start other than a refusal before `BEGIN`. After a failed commit it stays held for the rollback that follows. A release that fails after the transaction settled is passed to `log.error`, and `commit()` or `rollback()` keeps its own outcome.\n*/\nasync function beginOwnedTransaction(connection, begin, log) {\n\tlet transaction;\n\ttry {\n\t\ttransaction = await begin();\n\t} catch (error) {\n\t\tif (wasRefusedBeforeBegin(connection)) await connection.release().catch(() => void 0);\n\t\telse await connection.destroy(error).catch(() => void 0);\n\t\tthrow error;\n\t}\n\tlet disposed = false;\n\tconst dispose = async (destroyReason) => {\n\t\tif (disposed) return;\n\t\tdisposed = true;\n\t\tif (destroyReason !== void 0) {\n\t\t\tawait connection.destroy(destroyReason.reason).catch(() => void 0);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait connection.release();\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tlog.error({\n\t\t\t\t\tevent: \"runtime.connection.release.error\",\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t} catch {}\n\t\t}\n\t};\n\treturn Object.assign(castAs(Object.create(transaction)), {\n\t\tasync commit() {\n\t\t\ttry {\n\t\t\t\tawait transaction.commit();\n\t\t\t} catch (error) {\n\t\t\t\tif (settlementOf(transaction)?.committed === true) await dispose();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tawait dispose();\n\t\t},\n\t\tasync rollback() {\n\t\t\ttry {\n\t\t\t\tawait transaction.rollback();\n\t\t\t} catch (error) {\n\t\t\t\tconst settlement = settlementOf(transaction);\n\t\t\t\tconst settled = settlement?.rolledBack === true || settlement?.committed === true;\n\t\t\t\tawait dispose(settled ? void 0 : { reason: error });\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tawait dispose();\n\t\t}\n\t});\n}\n//#endregion\n//#region src/prepared/bind-site-params.ts\nfunction normalizeSpec(spec) {\n\tif (typeof spec === \"string\") return {\n\t\tcodec: { codecId: spec },\n\t\tnullable: false\n\t};\n\treturn {\n\t\tcodec: spec.typeParams !== void 0 ? {\n\t\t\tcodecId: spec.codecId,\n\t\t\ttypeParams: spec.typeParams\n\t\t} : { codecId: spec.codecId },\n\t\tnullable: spec.nullable === true\n\t};\n}\nvar BindSiteExpression = class {\n\treturnType;\n\t#ast;\n\tconstructor(ref, returnType) {\n\t\tthis.#ast = ref;\n\t\tthis.returnType = returnType;\n\t}\n\tbuildAst() {\n\t\treturn this.#ast;\n\t}\n};\nfunction buildBindSiteParams(declaration) {\n\tconst params = {};\n\tfor (const [name, spec] of Object.entries(declaration)) {\n\t\tconst { codec, nullable } = normalizeSpec(spec);\n\t\tparams[name] = new BindSiteExpression(PreparedParamRef.of(name, codec, nullable), {\n\t\t\tcodecId: codec.codecId,\n\t\t\tnullable\n\t\t});\n\t}\n\treturn blindCast(Object.freeze(params));\n}\n//#endregion\n//#region src/prepared/encode-prepared.ts\n/**\n* Resolve a PreparedStatement's slot order to the unencoded values it\n* will carry into encode. Literal slots come from the lowered AST;\n* bind slots are looked up by name on `userParams`. Missing user params\n* surface `RUNTIME.PREPARE_MISSING_PARAM` so the caller cannot silently\n* bind `undefined`.\n*/\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction resolvePreparedSlotValues(ps, userParams) {\n\tif (!isRecord(userParams)) throw runtimeError(\"RUNTIME.PREPARE_MISSING_PARAM\", \"Prepared statement parameters must be an object\");\n\treturn ps.slots.map((slot) => {\n\t\tif (slot.kind === \"literal\") return slot.value;\n\t\tif (!Object.hasOwn(userParams, slot.name)) throw runtimeError(\"RUNTIME.PREPARE_MISSING_PARAM\", `Prepared statement query is missing parameter '${slot.name}'`, { name: slot.name });\n\t\treturn userParams[slot.name];\n\t});\n}\n//#endregion\n//#region src/sql-family-adapter.ts\nvar SqlFamilyAdapter = class {\n\tcontract;\n\tmarkerReader;\n\tconstructor(contract, adapterProfile) {\n\t\tthis.contract = contract;\n\t\tthis.markerReader = adapterProfile;\n\t}\n\tvalidatePlan(plan, contract) {\n\t\tif (plan.meta.target !== contract.target) throw runtimeError(\"PLAN.TARGET_MISMATCH\", \"Plan target does not match runtime target\", {\n\t\t\tplanTarget: plan.meta.target,\n\t\t\truntimeTarget: contract.target\n\t\t});\n\t\tif (plan.meta.storageHash !== contract.storage.storageHash) throw runtimeError(\"PLAN.HASH_MISMATCH\", \"Plan storage hash does not match runtime contract\", {\n\t\t\tplanStorageHash: plan.meta.storageHash,\n\t\t\truntimeStorageHash: contract.storage.storageHash\n\t\t});\n\t}\n};\n//#endregion\n//#region src/sql-runtime.ts\nfunction isExecutionPlan(plan) {\n\treturn \"sql\" in plan;\n}\n// v8 ignore next 2\nconst noopLogSink = () => {};\nconst noopLog = {\n\tinfo: noopLogSink,\n\twarn: noopLogSink,\n\terror: noopLogSink\n};\nconst scheduleTimer = globalThis.setTimeout;\nfunction runtimeClosedError() {\n\treturn structuredError(\"DRIVER.NOT_CONNECTED\", \"Runtime is closed\", {\n\t\twhy: \"close() was called on this runtime, or on the client or connection that owns it. An await using scope calls close() when it ends.\",\n\t\tfix: \"Await every query, transaction and prepared statement before close(). The usual cause is a query returned without await from an await using scope.\"\n\t});\n}\n/**\n* Abstract family-layer base for SQL runtimes. Subclass to build a target runtime\n* (e.g. `PostgresRuntimeImpl`); app code should consume the `Runtime` interface returned\n* by the target factories, never this class directly.\n*/\nvar SqlRuntimeBase = class extends RuntimeCore {\n\tcontract;\n\tadapter;\n\tdriver;\n\tfamilyAdapter;\n\tcontractCodecs;\n\tcodecDescriptors;\n\tsqlCtx;\n\tverifyMarkerOption;\n\tverifyMarkerPromise;\n\tclosePromise;\n\tcloseRefusal;\n\t#inFlight = new InFlightOperations();\n\t#openActivityHandles = 0;\n\t#refusing = false;\n\t#heldQueryables = /* @__PURE__ */ new WeakSet();\n\t#preparedStatementHandles = /* @__PURE__ */ new WeakMap();\n\t#holdFinishedChildren;\n\t#openTransactions = /* @__PURE__ */ new WeakMap();\n\tcodecRegistryValidated;\n\t_telemetry;\n\tconstructor(options) {\n\t\tconst { context, adapter, driver, verifyMarker, middleware, mode, log, closeRefusal } = options;\n\t\tif (middleware) for (const mw of middleware) checkMiddlewareCompatibility(mw, \"sql\", context.contract.target);\n\t\tconst sqlCtx = {\n\t\t\tcontract: context.contract,\n\t\t\tmode: mode ?? \"strict\",\n\t\t\tnow: () => Date.now(),\n\t\t\tlog: log ?? noopLog,\n\t\t\tcontentHash: (exec) => computeSqlContentHash(blindCast(exec)),\n\t\t\tscope: \"runtime\"\n\t\t};\n\t\tsuper({\n\t\t\tmiddleware: middleware ?? [],\n\t\t\tctx: sqlCtx\n\t\t});\n\t\tthis.#holdFinishedChildren = this.middleware.some((mw) => mw.activityFinalized !== void 0);\n\t\tthis.contract = context.contract;\n\t\tthis.adapter = adapter;\n\t\tthis.driver = driver;\n\t\tthis.familyAdapter = new SqlFamilyAdapter(context.contract, adapter.profile);\n\t\tthis.contractCodecs = context.contractCodecs;\n\t\tthis.codecDescriptors = context.codecDescriptors;\n\t\tthis.sqlCtx = sqlCtx;\n\t\tthis.verifyMarkerOption = verifyMarker ?? \"onFirstUse\";\n\t\tthis.closeRefusal = closeRefusal ?? \"when-idle\";\n\t\tthis.codecRegistryValidated = false;\n\t\tthis.verifyMarkerPromise = this.verifyMarkerOption === false ? Promise.resolve() : null;\n\t\tthis.closePromise = null;\n\t\tthis._telemetry = null;\n\t}\n\t/**\n\t* Lower a `SqlQueryPlan` (AST + meta) into a `SqlExecutionPlan`\n\t* with encoded parameters ready for the driver.\n\t*\n\t* Implementation note: SQL splits lower-then-encode across\n\t* {@link lowerToDraft} + {@link encodeDraftParams} so the selected\n\t* operation's middleware chain can run between them:\n\t* {@link prepareOperation} runs the statement's `beforeEncode` chain\n\t* between them (cipherstash bulk-encrypt, for example, mutates pre-encode\n\t* `ParamRef.value` slots). This protected hook composes the two back into\n\t* the cross-family `lower()` shape `RuntimeCore` expects. The production\n\t* operation methods use the matching split form before driver execution.\n\t*\n\t* `ctx: SqlCodecCallContext` is forwarded to `encodeParams` so\n\t* per-query cancellation reaches every codec body during parameter\n\t* encoding. SQL params do not populate `ctx.column` — encode-side\n\t* column metadata is the middleware's domain.\n\t*/\n\tasync lower(plan, ctx) {\n\t\tconst draft = this.lowerToDraft(plan);\n\t\treturn await this.encodeDraftParams(draft, ctx);\n\t}\n\t/**\n\t* AST → pre-encode draft for the selected `query()` or `execute()` operation.\n\t* The returned plan has `sql` rendered and `params` populated with the\n\t* user-domain values the lowering site collected from `ParamRef` nodes. No\n\t* codec encode has happened yet; consumers can mutate `params` via the\n\t* `SqlParamRefMutator` before {@link encodeDraftParams} runs.\n\t*/\n\tlowerToDraft(plan) {\n\t\treturn lowerSqlPlan(this.adapter, this.contract, plan);\n\t}\n\t/**\n\t* Encode a draft plan's params for the selected `query()` or `execute()`\n\t* operation through the per-column codecs and freeze the result into the\n\t* final `SqlExecutionPlan` the driver sees. Errors surface as\n\t* `RUNTIME.ENCODE_FAILED` envelopes from {@link encodeParams}.\n\t*/\n\tasync encodeDraftParams(draft, ctx) {\n\t\treturn Object.freeze({\n\t\t\t...draft,\n\t\t\tparams: await encodeParams(draft, ctx, this.contractCodecs)\n\t\t});\n\t}\n\t/** Default query invocation required by the abstract `RuntimeCore` contract. */\n\t// v8 ignore next 6\n\trunDriver(exec) {\n\t\treturn this.driver.query({\n\t\t\tsql: exec.sql,\n\t\t\tparams: exec.params\n\t\t});\n\t}\n\trunExecute(exec) {\n\t\treturn this.driver.execute({\n\t\t\tsql: exec.sql,\n\t\t\tparams: exec.params\n\t\t});\n\t}\n\t/**\n\t* Runs the registered middleware `beforeCompile` chain over the plan's draft (AST + meta). Returns the original plan unchanged when no middleware rewrote the AST; otherwise returns a new plan carrying the rewritten AST and meta. The lowering adapter and the encoder both walk the rewritten AST directly.\n\t*/\n\tasync compilePlan(plan, middlewareCtx) {\n\t\tconst rewrittenDraft = await runBeforeCompileChain(this.middleware, {\n\t\t\tast: plan.ast,\n\t\t\tmeta: plan.meta\n\t\t}, middlewareCtx);\n\t\treturn rewrittenDraft.ast === plan.ast ? plan : {\n\t\t\t...plan,\n\t\t\tast: rewrittenDraft.ast,\n\t\t\tmeta: rewrittenDraft.meta\n\t\t};\n\t}\n\tquery(plan, options) {\n\t\treturn this.queryAgainstQueryable(plan, this.driver, options);\n\t}\n\texecute(plan, options) {\n\t\treturn this.executeStatisticsAgainstQueryable(plan, this.driver, options);\n\t}\n\t[preparedStatementQuery](ps, params, options) {\n\t\treturn this.runPreparedQueryAgainstQueryable(blindCast(ps), params, this.driver, options);\n\t}\n\t[preparedStatementExecute](ps, params, options) {\n\t\treturn this.runPreparedExecuteAgainstQueryable(blindCast(ps), params, this.driver, options);\n\t}\n\t[activitySource] = {\n\t\tstartActivity: (activity) => this.startActivityOnRoute(this.queryableRoute(this.driver, \"runtime\", () => void 0, {\n\t\t\ttransaction: (parent) => this.beginOwnedTransactionBeneath(parent),\n\t\t\truntimeWork: true\n\t\t}), activity, void 0),\n\t\tplanContentHash: (plan) => this.planContentHashFor(plan, \"runtime\", void 0)\n\t};\n\t/**\n\t* Starts a client activity whose statements and transaction run on `route`, beneath `parent` or, without one, beneath `route.parent()`.\n\t*/\n\tasync startActivityOnRoute(route, activity, parent) {\n\t\tconst endWork = route.runtimeWork ? this.beginActivityWork() : () => void 0;\n\t\tlet run;\n\t\ttry {\n\t\t\trun = await startClientActivity(activity, {\n\t\t\t\tmiddleware: this.middleware,\n\t\t\t\tcontext: {\n\t\t\t\t\t...this.sqlCtx,\n\t\t\t\t\tscope: route.scope\n\t\t\t\t},\n\t\t\t\tparent: parent ?? route.parent(),\n\t\t\t\tholdFinishedChildren: this.#holdFinishedChildren\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tendWork();\n\t\t\tthrow error;\n\t\t}\n\t\treturn this.activityHandle(run, route, endWork);\n\t}\n\t/** The content hash of the statement `plan` would send on a queryable of `scope` beneath `parent`. */\n\tasync planContentHashFor(plan, scope, parent) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tif (isExecutionPlan(plan)) return computeSqlContentHash(Object.freeze({\n\t\t\t...plan,\n\t\t\tparams: await encodeParams(plan, {}, this.contractCodecs)\n\t\t}));\n\t\tconst compiled = await this.compilePlan(plan, createContextBeneath({\n\t\t\t...this.sqlCtx,\n\t\t\tscope\n\t\t}, parent));\n\t\treturn computeSqlContentHash(await this.encodeDraftParams(this.lowerToDraft(compiled), {}));\n\t}\n\t/** An activity route whose statements run on `queryable`. */\n\tqueryableRoute(queryable, scope, parent, options) {\n\t\treturn {\n\t\t\tscope,\n\t\t\tparent,\n\t\t\t...options,\n\t\t\tquery: (plan, executeOptions) => this.queryAgainstQueryable(plan, queryable, {\n\t\t\t\t...executeOptions,\n\t\t\t\tscope\n\t\t\t}),\n\t\t\texecute: (plan, executeOptions) => this.executeStatisticsAgainstQueryable(plan, queryable, {\n\t\t\t\t...executeOptions,\n\t\t\t\tscope\n\t\t\t}),\n\t\t\tpreparedQuery: (statement, params, executeOptions) => this.runPreparedQueryAgainstQueryable(statement, params, queryable, {\n\t\t\t\t...executeOptions,\n\t\t\t\tscope\n\t\t\t}),\n\t\t\tpreparedExecute: (statement, params, executeOptions) => this.runPreparedExecuteAgainstQueryable(statement, params, queryable, {\n\t\t\t\t...executeOptions,\n\t\t\t\tscope\n\t\t\t})\n\t\t};\n\t}\n\t/** The activity route of a held connection that `owner` wraps: its statements run on `connection`, and its transactions begin there. */\n\tconnectionRoute(connection, owner) {\n\t\tconst openTransaction = this.#openTransactions.get(connection);\n\t\treturn this.queryableRoute(connection, \"connection\", () => openTransaction, {\n\t\t\ttransaction: openTransaction === void 0 ? (parent) => this.beginTransactionBeneathOn(connection, owner, parent) : void 0,\n\t\t\truntimeWork: false\n\t\t});\n\t}\n\tbeginTransactionBeneathOn(connection, owner, parent) {\n\t\tconst openTransaction = this.#openTransactions.get(connection);\n\t\tif (openTransaction !== void 0) return Promise.reject(transactionAlreadyOpenError(parent, openTransaction));\n\t\treturn this.beginTransactionOn(connection, owner, parent);\n\t}\n\t/** The `activitySource` member of a held connection that `owner()` wraps. */\n\tconnectionActivitySource(connection, owner) {\n\t\treturn {\n\t\t\tstartActivity: (activity) => this.startActivityOnRoute(this.connectionRoute(connection, owner()), activity, void 0),\n\t\t\tplanContentHash: (plan) => this.planContentHashFor(plan, \"connection\", this.#openTransactions.get(connection))\n\t\t};\n\t}\n\tactivityHandle(run, route, endWork) {\n\t\tconst self = this;\n\t\tconst beneath = (options) => ({\n\t\t\t...options,\n\t\t\tactivityParent: run\n\t\t});\n\t\tconst beginTransaction = route.transaction;\n\t\tconst source = {\n\t\t\tasync startActivity(activity) {\n\t\t\t\trun.assertAcceptsChildren();\n\t\t\t\treturn self.startActivityOnRoute(route, activity, run);\n\t\t\t},\n\t\t\tplanContentHash(plan) {\n\t\t\t\treturn self.planContentHashFor(plan, route.scope, run);\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\t...source,\n\t\t\t[activitySource]: source,\n\t\t\tactivity: run.activity,\n\t\t\tget intercepted() {\n\t\t\t\treturn run.intercepted;\n\t\t\t},\n\t\t\tquery(plan, options) {\n\t\t\t\treturn rowsBeneath(run, () => route.query(plan, beneath(options)));\n\t\t\t},\n\t\t\tasync execute(plan, options) {\n\t\t\t\trun.assertAcceptsChildren();\n\t\t\t\treturn route.execute(plan, beneath(options));\n\t\t\t},\n\t\t\t[preparedStatementQuery](ps, params, options) {\n\t\t\t\treturn rowsBeneath(run, () => route.preparedQuery(blindCast(ps), params, beneath(options)));\n\t\t\t},\n\t\t\tasync [preparedStatementExecute](ps, params, options) {\n\t\t\t\trun.assertAcceptsChildren();\n\t\t\t\treturn route.preparedExecute(blindCast(ps), params, beneath(options));\n\t\t\t},\n\t\t\tasync end(end) {\n\t\t\t\ttry {\n\t\t\t\t\tawait run.end(end);\n\t\t\t\t} finally {\n\t\t\t\t\tendWork();\n\t\t\t\t}\n\t\t\t},\n\t\t\t...ifDefined(\"transaction\", beginTransaction === void 0 ? void 0 : async () => {\n\t\t\t\trun.assertAcceptsChildren();\n\t\t\t\treturn beginTransaction(run);\n\t\t\t})\n\t\t};\n\t}\n\tasync beginOwnedTransactionBeneath(parent) {\n\t\tconst { driverConnection, connection } = await this.openConnection();\n\t\treturn this.ownTransaction(connection, () => this.beginTransactionOn(driverConnection, connection, parent));\n\t}\n\t/** Begins a transaction with `begin` on a connection the transaction owns; see `beginOwnedTransaction`. */\n\townTransaction(connection, begin) {\n\t\treturn beginOwnedTransaction(connection, begin, this.sqlCtx.log);\n\t}\n\t/**\n\t* Returns the raw driver connection. The connection is a `SqlQueryable` — SQL\n\t* issued on it runs below the middleware/codec/telemetry pipeline. It carries\n\t* its own lifecycle (`release`/`destroy`/`beginTransaction`); the caller owns\n\t* disposal.\n\t*/\n\tacquireRawConnection() {\n\t\treturn this.driver.acquireConnection();\n\t}\n\tasync setupDriverExecution(exec, queryable) {\n\t\tthis.familyAdapter.validatePlan(exec, this.contract);\n\t\tthis._telemetry = null;\n\t\tif (this.verifyMarkerPromise === null) {\n\t\t\tconst markerQueryable = this.#heldQueryables.has(queryable) ? queryable : this.driver;\n\t\t\tthis.verifyMarkerPromise = this.verifyMarker(markerQueryable).catch((error) => {\n\t\t\t\tthis.verifyMarkerPromise = null;\n\t\t\t\tthrow error;\n\t\t\t});\n\t\t}\n\t\tawait this.verifyMarkerPromise;\n\t}\n\tbeginActivityWork() {\n\t\tconst endOperation = this.beginOperation(this.driver);\n\t\tthis.#openActivityHandles++;\n\t\tlet ended = false;\n\t\treturn () => {\n\t\t\tif (ended) return;\n\t\t\tended = true;\n\t\t\tthis.#openActivityHandles--;\n\t\t\tendOperation();\n\t\t};\n\t}\n\twarnWhenWaitingOnlyForActivities(warned) {\n\t\tif (warned.done || this.#openActivityHandles === 0) return;\n\t\tif (this.#inFlight.count !== this.#openActivityHandles) return;\n\t\twarned.done = true;\n\t\tthis.sqlCtx.log.warn({\n\t\t\tevent: \"runtime.close.waiting-for-activities\",\n\t\t\topenActivities: this.#openActivityHandles\n\t\t});\n\t}\n\tbeginOperation(queryable) {\n\t\tif (queryable === this.driver && this.#refusing) throw runtimeClosedError();\n\t\treturn this.#inFlight.begin();\n\t}\n\tparentOf(queryable, options) {\n\t\tconst openTransaction = this.#openTransactions.get(queryable);\n\t\tconst activityParent = options?.activityParent;\n\t\tif (activityParent === void 0) return openTransaction;\n\t\tif (openTransaction !== void 0 && !activityParent.ctx.inTransaction()) throw activityOutsideTransactionError(activityParent, openTransaction);\n\t\treturn activityParent;\n\t}\n\tgetListDecoder() {\n\t\treturn sqlNativeArrayListDecoder;\n\t}\n\tasync *streamDecodedRows(run, exec, createDecodeContext, driverCall, codecCtx, queryable, onDriverAnswered) {\n\t\tconst rowDecodeContext = createDecodeContext();\n\t\tawait this.setupDriverExecution(exec, queryable);\n\t\tconst startedAt = Date.now();\n\t\tlet telemetryOutcome = null;\n\t\ttry {\n\t\t\tconst iterator = run.runQuery(exec, driverCall)[Symbol.asyncIterator]();\n\t\t\tlet answered = false;\n\t\t\ttry {\n\t\t\t\twhile (true) {\n\t\t\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\t\t\tconst next = answered ? await iterator.next() : await iterator.next().finally(onDriverAnswered);\n\t\t\t\t\tanswered = true;\n\t\t\t\t\tif (next.done) break;\n\t\t\t\t\tyield blindCast(await decodeRow(next.value, rowDecodeContext, codecCtx, this.getListDecoder()));\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tawait iterator.return?.();\n\t\t\t}\n\t\t\ttelemetryOutcome = \"success\";\n\t\t} catch (error) {\n\t\t\ttelemetryOutcome = \"runtime-error\";\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (telemetryOutcome !== null) this.recordTelemetry(exec, telemetryOutcome, Date.now() - startedAt);\n\t\t}\n\t}\n\tcreateQueryContexts(options) {\n\t\tconst signal = options?.signal;\n\t\tconst scope = options?.scope ?? \"runtime\";\n\t\treturn {\n\t\t\tcodecCtx: signal === void 0 ? {} : { signal },\n\t\t\tcontextFields: {\n\t\t\t\t...this.sqlCtx,\n\t\t\t\t...ifDefined(\"signal\", signal),\n\t\t\t\t...scope !== \"runtime\" ? { scope } : {}\n\t\t\t}\n\t\t};\n\t}\n\tasync prepareOperation(plan, codecCtx, run) {\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\tif (isExecutionPlan(plan)) {\n\t\t\tconst mutator = createSqlParamRefMutator(plan);\n\t\t\tawait run.beforeEncode(plan, mutator);\n\t\t\treturn Object.freeze({\n\t\t\t\t...plan,\n\t\t\t\tparams: await encodeParams({\n\t\t\t\t\t...plan,\n\t\t\t\t\tparams: mutator.currentParams()\n\t\t\t\t}, codecCtx, this.contractCodecs)\n\t\t\t});\n\t\t}\n\t\tconst compiled = await this.compilePlan(plan, run.ctx);\n\t\tconst draft = this.lowerToDraft(compiled);\n\t\tconst mutator = createSqlParamRefMutator(draft);\n\t\tawait run.beforeEncode(draft, mutator);\n\t\tconst draftWithMutations = Object.freeze({\n\t\t\t...draft,\n\t\t\tparams: mutator.currentParams()\n\t\t});\n\t\treturn this.encodeDraftParams(draftWithMutations, codecCtx);\n\t}\n\t/** Query rows against a caller-supplied queryable through the shared preparation pipeline. */\n\tqueryAgainstQueryable(plan, queryable, options) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tconst self = this;\n\t\tconst { codecCtx, contextFields } = this.createQueryContexts(options);\n\t\tconst generator = async function* () {\n\t\t\tconst endOperation = self.beginOperation(queryable);\n\t\t\ttry {\n\t\t\t\tyield* streamStatement({\n\t\t\t\t\tmiddleware: self.middleware,\n\t\t\t\t\tplan,\n\t\t\t\t\tcontext: contextFields,\n\t\t\t\t\tparent: self.parentOf(queryable, options)\n\t\t\t\t}, async function* (run) {\n\t\t\t\t\tconst exec = await self.prepareOperation(plan, codecCtx, run);\n\t\t\t\t\tyield* self.streamDecodedRows(run, exec, () => buildDecodeContext(exec.ast, self.contractCodecs), () => queryable.query({\n\t\t\t\t\t\tsql: exec.sql,\n\t\t\t\t\t\tparams: exec.params\n\t\t\t\t\t}), codecCtx, queryable, endOperation);\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tendOperation();\n\t\t\t}\n\t\t};\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\t/** Execute statistics against a caller-supplied queryable through the shared preparation pipeline. */\n\tasync executeStatisticsAgainstQueryable(plan, queryable, options) {\n\t\tconst endOperation = this.beginOperation(queryable);\n\t\ttry {\n\t\t\treturn await this.executeStatisticsInFlight(plan, queryable, options);\n\t\t} finally {\n\t\t\tendOperation();\n\t\t}\n\t}\n\tasync executeStatisticsInFlight(plan, queryable, options) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tconst { codecCtx, contextFields } = this.createQueryContexts(options);\n\t\treturn this.executeOn(queryable, options, plan, contextFields, async (run) => {\n\t\t\tconst exec = await this.prepareOperation(plan, codecCtx, run);\n\t\t\treturn this.executeEncodedPlan(run, exec, queryable, codecCtx, () => queryable.execute({\n\t\t\t\tsql: exec.sql,\n\t\t\t\tparams: exec.params\n\t\t\t}));\n\t\t});\n\t}\n\texecuteOn(queryable, options, plan, context, body) {\n\t\treturn executeStatement({\n\t\t\tmiddleware: this.middleware,\n\t\t\tplan,\n\t\t\tcontext,\n\t\t\tparent: this.parentOf(queryable, options)\n\t\t}, body);\n\t}\n\tasync executeEncodedPlan(run, exec, queryable, codecCtx, driverCall) {\n\t\tawait this.setupDriverExecution(exec, queryable);\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\tconst startedAt = Date.now();\n\t\tlet telemetryOutcome = \"success\";\n\t\ttry {\n\t\t\treturn await run.runExecute(exec, driverCall);\n\t\t} catch (error) {\n\t\t\ttelemetryOutcome = \"runtime-error\";\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tthis.recordTelemetry(exec, telemetryOutcome, Date.now() - startedAt);\n\t\t}\n\t}\n\tasync prepare(declaration, callback) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tconst userPlan = callback(buildBindSiteParams(declaration));\n\t\tconst finalPlan = await this.compilePlan(userPlan, createContextBeneath(this.sqlCtx, void 0));\n\t\tconst orderedRefs = collectOrderedParamRefs(finalPlan.ast);\n\t\tconst referencedNames = /* @__PURE__ */ new Set();\n\t\tfor (const ref of orderedRefs) if (ref.kind === \"prepared-param-ref\") referencedNames.add(ref.name);\n\t\tconst missing = Object.keys(declaration).filter((name) => !referencedNames.has(name));\n\t\tif (missing.length > 0) throw runtimeError(\"RUNTIME.PREPARE_UNUSED_PARAM\", `Prepared statement declaration includes parameter${missing.length === 1 ? \"\" : \"s\"} not referenced by the callback's plan: ${missing.join(\", \")}`, { unused: missing });\n\t\tconst lowered = this.adapter.lower(finalPlan.ast, {\n\t\t\tcontract: this.contract,\n\t\t\tparams: orderedRefs.map((r) => r.kind === \"param-ref\" ? r.value : void 0)\n\t\t});\n\t\tconst decodeContext = buildDecodeContext(finalPlan.ast, this.contractCodecs);\n\t\tconst paramMetadata = deriveParamMetadata(finalPlan.ast);\n\t\tconst internals = Object.freeze({\n\t\t\tsql: lowered.sql,\n\t\t\tast: finalPlan.ast,\n\t\t\tmeta: finalPlan.meta,\n\t\t\tslots: lowered.params,\n\t\t\tdecodeContext,\n\t\t\tparamMetadata\n\t\t});\n\t\treturn blindCast(finalPlan.ast.kind === \"raw-query\" && finalPlan.ast.result.kind === \"affected-count\" ? new PreparedExecutionImpl(internals) : new PreparedStatementImpl(internals));\n\t}\n\t/** Query prepared rows against a caller-supplied queryable through the full pipeline. */\n\trunPreparedQueryAgainstQueryable(ps, userParams, queryable, options) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tconst self = this;\n\t\tconst { codecCtx, contextFields } = this.createQueryContexts(options);\n\t\tconst generator = async function* () {\n\t\t\tconst endOperation = self.beginOperation(queryable);\n\t\t\ttry {\n\t\t\t\tyield* streamStatement({\n\t\t\t\t\tmiddleware: self.middleware,\n\t\t\t\t\tplan: ps,\n\t\t\t\t\tcontext: contextFields,\n\t\t\t\t\tparent: self.parentOf(queryable, options)\n\t\t\t\t}, (run) => self.streamPreparedRows(run, ps, userParams, queryable, codecCtx, endOperation));\n\t\t\t} finally {\n\t\t\t\tendOperation();\n\t\t\t}\n\t\t};\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\tasync *streamPreparedRows(run, ps, userParams, queryable, codecCtx, onDriverAnswered) {\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\tconst preEncodeValues = resolvePreparedSlotValues(ps, userParams);\n\t\tconst preEncodeExec = {\n\t\t\tsql: ps.sql,\n\t\t\tparams: preEncodeValues,\n\t\t\tast: ps.ast,\n\t\t\tmeta: ps.meta\n\t\t};\n\t\tconst mutator = createSqlParamRefMutator(preEncodeExec);\n\t\tawait run.beforeEncode(preEncodeExec, mutator);\n\t\tconst encodedParams = await encodeParamsWithMetadata(mutator.currentParams(), ps.paramMetadata, codecCtx, this.contractCodecs);\n\t\tconst exec = {\n\t\t\tsql: ps.sql,\n\t\t\tparams: encodedParams,\n\t\t\tast: ps.ast,\n\t\t\tmeta: ps.meta\n\t\t};\n\t\tconst handles = this.#preparedStatementHandles;\n\t\tconst request = {\n\t\t\tsql: exec.sql,\n\t\t\tparams: exec.params,\n\t\t\tpreparedStatementHandle: {\n\t\t\t\tget: () => handles.get(ps),\n\t\t\t\tset: (value) => {\n\t\t\t\t\thandles.set(ps, value);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tyield* this.streamDecodedRows(run, exec, () => ps.decodeContext, () => queryable.query(request), codecCtx, queryable, onDriverAnswered);\n\t}\n\t/** Execute a prepared statement's statistics against a caller-supplied queryable through the full pipeline. */\n\tasync runPreparedExecuteAgainstQueryable(ps, userParams, queryable, options) {\n\t\tconst endOperation = this.beginOperation(queryable);\n\t\ttry {\n\t\t\treturn await this.runPreparedExecuteInFlight(ps, userParams, queryable, options);\n\t\t} finally {\n\t\t\tendOperation();\n\t\t}\n\t}\n\tasync runPreparedExecuteInFlight(ps, userParams, queryable, options) {\n\t\tthis.ensureCodecRegistryValidated();\n\t\tconst { codecCtx, contextFields } = this.createQueryContexts(options);\n\t\treturn this.executeOn(queryable, options, ps, contextFields, (run) => this.executePrepared(run, ps, userParams, queryable, codecCtx));\n\t}\n\tasync executePrepared(run, ps, userParams, queryable, codecCtx) {\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\tconst preEncodeValues = resolvePreparedSlotValues(ps, userParams);\n\t\tconst preEncodeExec = {\n\t\t\tsql: ps.sql,\n\t\t\tparams: preEncodeValues,\n\t\t\tast: ps.ast,\n\t\t\tmeta: ps.meta\n\t\t};\n\t\tconst mutator = createSqlParamRefMutator(preEncodeExec);\n\t\tawait run.beforeEncode(preEncodeExec, mutator);\n\t\tconst exec = {\n\t\t\tsql: ps.sql,\n\t\t\tparams: await encodeParamsWithMetadata(mutator.currentParams(), ps.paramMetadata, codecCtx, this.contractCodecs),\n\t\t\tast: ps.ast,\n\t\t\tmeta: ps.meta\n\t\t};\n\t\tconst handles = this.#preparedStatementHandles;\n\t\tconst request = {\n\t\t\tsql: exec.sql,\n\t\t\tparams: exec.params,\n\t\t\tpreparedStatementHandle: {\n\t\t\t\tget: () => handles.get(ps),\n\t\t\t\tset: (value) => {\n\t\t\t\t\thandles.set(ps, value);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn this.executeEncodedPlan(run, exec, queryable, codecCtx, () => queryable.execute(request));\n\t}\n\tasync connection() {\n\t\treturn (await this.openConnection()).connection;\n\t}\n\tasync openConnection() {\n\t\tconst endOperation = this.beginOperation(this.driver);\n\t\tlet driverConn;\n\t\ttry {\n\t\t\tdriverConn = await this.driver.acquireConnection();\n\t\t} finally {\n\t\t\tendOperation();\n\t\t}\n\t\tthis.#heldQueryables.add(driverConn);\n\t\tconst self = this;\n\t\tconst wrappedConnection = {\n\t\t\t[transactionStart]: createTransactionStart(),\n\t\t\ttransaction() {\n\t\t\t\treturn self.beginTransactionOn(driverConn, wrappedConnection, void 0);\n\t\t\t},\n\t\t\t[activitySource]: self.connectionActivitySource(driverConn, () => wrappedConnection),\n\t\t\tasync release() {\n\t\t\t\tawait self.#inFlight.track(() => driverConn.release());\n\t\t\t},\n\t\t\tasync destroy(reason) {\n\t\t\t\tawait self.#inFlight.track(() => driverConn.destroy(reason));\n\t\t\t},\n\t\t\tquery(plan, options) {\n\t\t\t\treturn self.queryAgainstQueryable(plan, driverConn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t},\n\t\t\texecute(plan, options) {\n\t\t\t\treturn self.executeStatisticsAgainstQueryable(plan, driverConn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t},\n\t\t\t[preparedStatementQuery](ps, params, options) {\n\t\t\t\treturn self.runPreparedQueryAgainstQueryable(blindCast(ps), params, driverConn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t},\n\t\t\t[preparedStatementExecute](ps, params, options) {\n\t\t\t\treturn self.runPreparedExecuteAgainstQueryable(blindCast(ps), params, driverConn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tdriverConnection: driverConn,\n\t\t\tconnection: wrappedConnection\n\t\t};\n\t}\n\t/**\n\t* Begins a transaction on `connection`, which `owner` wraps, as a transaction activity. When the transaction's `activityStarted` hooks refuse the start, no `BEGIN` is sent, `owner` is recorded as clean, and `withTransaction` releases it; after any other start failure it destroys it. The transaction's `activityStarted` hooks run before `BEGIN`. Every statement sent on the transaction, or on `connection`, from the end of `BEGIN` until `commit()` or `rollback()` is called is the transaction's child, and is finalized when the transaction ends, with its outcome. `commit()` and `rollback()` resolve after every finalization hook has run. A subclass that holds its own connection begins its transactions here.\n\t*/\n\tasync beginTransactionOn(connection, owner, parent) {\n\t\towner[transactionStart].refusedBeforeBegin = false;\n\t\tlet activity;\n\t\ttry {\n\t\t\tactivity = await startTransactionActivity({\n\t\t\t\tmiddleware: this.middleware,\n\t\t\t\tcontext: {\n\t\t\t\t\t...this.sqlCtx,\n\t\t\t\t\tscope: \"transaction\"\n\t\t\t\t},\n\t\t\t\tparent,\n\t\t\t\tholdFinishedChildren: this.#holdFinishedChildren\n\t\t\t});\n\t\t} catch (error) {\n\t\t\towner[transactionStart].refusedBeforeBegin = true;\n\t\t\tthrow error;\n\t\t}\n\t\tlet driverTx;\n\t\ttry {\n\t\t\tdriverTx = await this.#inFlight.track(() => connection.beginTransaction());\n\t\t} catch (error) {\n\t\t\tawait activity.end({\n\t\t\t\tby: \"rollback\",\n\t\t\t\toutcome: \"failed\",\n\t\t\t\tcommitAttempted: false\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\tif (this.#heldQueryables.has(connection)) this.#heldQueryables.add(driverTx);\n\t\treturn this.wrapTransaction(driverTx, connection, activity);\n\t}\n\twrapTransaction(driverTx, connection, activity) {\n\t\tthis.#openTransactions.set(driverTx, activity);\n\t\tthis.#openTransactions.set(connection, activity);\n\t\tconst stopAcceptingChildren = () => {\n\t\t\tactivity.stopAcceptingChildren();\n\t\t\tfor (const queryable of [driverTx, connection]) if (this.#openTransactions.get(queryable) === activity) this.#openTransactions.delete(queryable);\n\t\t};\n\t\tlet commitAttempted = false;\n\t\tconst settlement = {\n\t\t\tcommitted: false,\n\t\t\trolledBack: false,\n\t\t\tlogDroppedError(error) {\n\t\t\t\ttry {\n\t\t\t\t\tactivity.ctx.log.error({\n\t\t\t\t\t\tevent: \"middleware.activityEnded.error\",\n\t\t\t\t\t\terror\n\t\t\t\t\t});\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t};\n\t\tlet commitEnding;\n\t\tconst self = this;\n\t\treturn {\n\t\t\t[transactionSettlement]: settlement,\n\t\t\tasync commit() {\n\t\t\t\tcommitAttempted = true;\n\t\t\t\tstopAcceptingChildren();\n\t\t\t\ttry {\n\t\t\t\t\tawait self.#inFlight.track(() => driverTx.commit());\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait activity.end({\n\t\t\t\t\t\tby: \"commit\",\n\t\t\t\t\t\toutcome: \"failed\"\n\t\t\t\t\t});\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tsettlement.committed = true;\n\t\t\t\tcommitEnding = activity.end({\n\t\t\t\t\tby: \"commit\",\n\t\t\t\t\toutcome: \"succeeded\"\n\t\t\t\t});\n\t\t\t\tawait commitEnding;\n\t\t\t},\n\t\t\tasync rollback() {\n\t\t\t\tstopAcceptingChildren();\n\t\t\t\tif (settlement.committed) {\n\t\t\t\t\tawait commitEnding?.catch(() => void 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (settlement.rolledBack) return;\n\t\t\t\ttry {\n\t\t\t\t\tawait self.#inFlight.track(() => driverTx.rollback());\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait activity.end({\n\t\t\t\t\t\tby: \"rollback\",\n\t\t\t\t\t\toutcome: \"failed\",\n\t\t\t\t\t\tcommitAttempted\n\t\t\t\t\t});\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tsettlement.rolledBack = true;\n\t\t\t\tawait activity.end({\n\t\t\t\t\tby: \"rollback\",\n\t\t\t\t\toutcome: \"succeeded\",\n\t\t\t\t\tcommitAttempted\n\t\t\t\t});\n\t\t\t},\n\t\t\t[activitySource]: {\n\t\t\t\tstartActivity: (clientActivity) => self.startActivityOnRoute(self.queryableRoute(driverTx, \"transaction\", () => activity, {\n\t\t\t\t\ttransaction: void 0,\n\t\t\t\t\truntimeWork: false\n\t\t\t\t}), clientActivity, void 0),\n\t\t\t\tplanContentHash: (plan) => self.planContentHashFor(plan, \"transaction\", activity)\n\t\t\t},\n\t\t\tquery(plan, options) {\n\t\t\t\treturn self.queryAgainstQueryable(plan, driverTx, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"transaction\"\n\t\t\t\t});\n\t\t\t},\n\t\t\texecute(plan, options) {\n\t\t\t\treturn self.executeStatisticsAgainstQueryable(plan, driverTx, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"transaction\"\n\t\t\t\t});\n\t\t\t},\n\t\t\t[preparedStatementQuery](ps, params, options) {\n\t\t\t\treturn self.runPreparedQueryAgainstQueryable(blindCast(ps), params, driverTx, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"transaction\"\n\t\t\t\t});\n\t\t\t},\n\t\t\t[preparedStatementExecute](ps, params, options) {\n\t\t\t\treturn self.runPreparedExecuteAgainstQueryable(blindCast(ps), params, driverTx, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"transaction\"\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t}\n\ttelemetry() {\n\t\treturn this._telemetry;\n\t}\n\tclose() {\n\t\tthis.closePromise ??= this.closeDriverAfterWork();\n\t\treturn this.closePromise;\n\t}\n\tasync closeDriverAfterWork() {\n\t\tconst warned = { done: false };\n\t\tif (this.closeRefusal === \"when-idle\") await this.waitForIdleTurn(warned);\n\t\tthis.#refusing = true;\n\t\tthis.warnWhenWaitingOnlyForActivities(warned);\n\t\tawait this.#inFlight.drained();\n\t\tawait this.driver.close();\n\t}\n\tasync waitForIdleTurn(warned) {\n\t\tfor (;;) {\n\t\t\tconst startedBefore = this.#inFlight.started;\n\t\t\tawait new Promise((resolve) => scheduleTimer(resolve, 0));\n\t\t\tif (!this.#inFlight.active && this.#inFlight.started === startedBefore) return;\n\t\t\tthis.warnWhenWaitingOnlyForActivities(warned);\n\t\t\tawait this.#inFlight.drained();\n\t\t}\n\t}\n\tensureCodecRegistryValidated() {\n\t\tif (!this.codecRegistryValidated) {\n\t\t\tvalidateCodecRegistryCompleteness(this.codecDescriptors, this.contract);\n\t\t\tthis.codecRegistryValidated = true;\n\t\t}\n\t}\n\tasync verifyMarker(queryable) {\n\t\tconst readResult = await this.familyAdapter.markerReader.readMarker(queryable);\n\t\tconst expectedStorageHash = this.contract.storage.storageHash;\n\t\tconst expectedProfileHash = this.contract.profileHash ?? null;\n\t\tconst expected = {\n\t\t\tstorageHash: expectedStorageHash,\n\t\t\tprofileHash: expectedProfileHash\n\t\t};\n\t\tif (readResult.kind !== \"present\") {\n\t\t\tthis.sqlCtx.log.warn({\n\t\t\t\tcode: \"CONTRACT.MARKER_MISSING\",\n\t\t\t\tscope: \"marker-verification\",\n\t\t\t\texpected,\n\t\t\t\tactual: null,\n\t\t\t\tmessage: \"Contract marker not found in database\"\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst marker = readResult.record;\n\t\tconst storageHashMatch = marker.storageHash === expectedStorageHash;\n\t\tconst profileHashMatch = expectedProfileHash === null || marker.profileHash === expectedProfileHash;\n\t\tif (!storageHashMatch || !profileHashMatch) this.sqlCtx.log.warn({\n\t\t\tcode: \"CONTRACT.MARKER_MISMATCH\",\n\t\t\tscope: \"marker-verification\",\n\t\t\texpected,\n\t\t\tactual: {\n\t\t\t\tstorageHash: marker.storageHash,\n\t\t\t\tprofileHash: marker.profileHash ?? null\n\t\t\t},\n\t\t\tmessage: \"Contract marker hash does not match runtime contract\"\n\t\t});\n\t}\n\trecordTelemetry(plan, outcome, durationMs) {\n\t\tconst contract = this.contract;\n\t\tthis._telemetry = Object.freeze({\n\t\t\tlane: plan.meta.lane,\n\t\t\ttarget: contract.target,\n\t\t\tfingerprint: computeSqlFingerprint(plan.sql),\n\t\t\toutcome,\n\t\t\t...durationMs !== void 0 ? { durationMs } : {}\n\t\t});\n\t}\n};\nfunction activityOutsideTransactionError(parent, openTransaction) {\n\treturn runtimeError(\"RUNTIME.ACTIVITY_OUTSIDE_TRANSACTION\", `Work was sent through a '${parent.activity.kind}' activity onto a connection whose open transaction the activity is not part of. Start the activity on the transaction instead.`, {\n\t\tkind: parent.activity.kind,\n\t\tid: parent.activity.id,\n\t\ttransactionId: openTransaction.activity.id\n\t});\n}\nfunction transactionAlreadyOpenError(parent, openTransaction) {\n\treturn runtimeError(\"RUNTIME.TRANSACTION_ALREADY_OPEN\", `A transaction is already open on this connection; a '${parent.activity.kind}' activity cannot begin another until it commits or rolls back.`, {\n\t\tkind: parent.activity.kind,\n\t\tid: parent.activity.id,\n\t\ttransactionId: openTransaction.activity.id\n\t});\n}\nfunction rowsBeneath(run, rows) {\n\treturn new AsyncIterableResult((async function* () {\n\t\trun.assertAcceptsChildren();\n\t\tyield* rows();\n\t})());\n}\nfunction transactionClosedError() {\n\treturn runtimeError(\"RUNTIME.TRANSACTION_CLOSED\", \"Cannot use a transaction operation after the transaction has ended. Consume query results and await execute calls inside the transaction callback.\", {});\n}\nasync function withTransaction(runtime, fn) {\n\tconst connection = await runtime.connection();\n\tlet transaction;\n\ttry {\n\t\ttransaction = await connection.transaction();\n\t} catch (error) {\n\t\tif (wasRefusedBeforeBegin(connection)) await connection.release().catch(() => void 0);\n\t\telse await connection.destroy(error).catch(() => void 0);\n\t\tthrow error;\n\t}\n\tlet invalidated = false;\n\tasync function* guardedStream(inner) {\n\t\tif (invalidated) throw transactionClosedError();\n\t\tfor await (const row of inner) {\n\t\t\tyield row;\n\t\t\tif (invalidated) throw transactionClosedError();\n\t\t}\n\t}\n\tfunction guardedQueryable(target) {\n\t\treturn {\n\t\t\tquery(plan, options) {\n\t\t\t\tif (invalidated) throw transactionClosedError();\n\t\t\t\treturn new AsyncIterableResult(guardedStream(target.query(plan, options)));\n\t\t\t},\n\t\t\tasync execute(plan, options) {\n\t\t\t\tif (invalidated) throw transactionClosedError();\n\t\t\t\treturn target.execute(plan, options);\n\t\t\t},\n\t\t\t[preparedStatementQuery](ps, params, options) {\n\t\t\t\tif (invalidated) throw transactionClosedError();\n\t\t\t\treturn new AsyncIterableResult(guardedStream(runPreparedQuery(target, ps, params, options)));\n\t\t\t},\n\t\t\t[preparedStatementExecute](ps, params, options) {\n\t\t\t\tif (invalidated) throw transactionClosedError();\n\t\t\t\treturn runPreparedExecute(target, ps, params, options);\n\t\t\t}\n\t\t};\n\t}\n\tfunction guardedSource(target) {\n\t\treturn {\n\t\t\tasync startActivity(activity) {\n\t\t\t\tif (invalidated) throw transactionClosedError();\n\t\t\t\treturn guardedHandle(await startActivityOn(target, activity));\n\t\t\t},\n\t\t\tplanContentHash(plan) {\n\t\t\t\treturn planContentHashOn(target, plan);\n\t\t\t}\n\t\t};\n\t}\n\tfunction guardedHandle(handle) {\n\t\tconst source = guardedSource(handle);\n\t\treturn {\n\t\t\t...source,\n\t\t\t...guardedQueryable(handle),\n\t\t\t[activitySource]: source,\n\t\t\tactivity: handle.activity,\n\t\t\tget intercepted() {\n\t\t\t\treturn handle.intercepted;\n\t\t\t},\n\t\t\tend: (end) => handle.end(end)\n\t\t};\n\t}\n\tconst txContext = {\n\t\t...guardedQueryable(transaction),\n\t\tget invalidated() {\n\t\t\treturn invalidated;\n\t\t},\n\t\t[activitySource]: guardedSource(transaction)\n\t};\n\tlet connectionDisposed = false;\n\tconst destroyConnection = async (reason) => {\n\t\tif (connectionDisposed) return;\n\t\tconnectionDisposed = true;\n\t\tawait connection.destroy(reason).catch(() => void 0);\n\t};\n\ttry {\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await fn(txContext);\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait transaction.rollback();\n\t\t\t} catch (rollbackError) {\n\t\t\t\tconst settlement = settlementOf(transaction);\n\t\t\t\tif (settlement?.rolledBack === true) {\n\t\t\t\t\tsettlement.logDroppedError(rollbackError);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tawait destroyConnection(rollbackError);\n\t\t\t\tconst wrapped = runtimeError(\"RUNTIME.TRANSACTION_ROLLBACK_FAILED\", \"Transaction rollback failed after callback error\", { rollbackError });\n\t\t\t\twrapped.cause = error;\n\t\t\t\tthrow wrapped;\n\t\t\t}\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tinvalidated = true;\n\t\t}\n\t\ttry {\n\t\t\tawait transaction.commit();\n\t\t} catch (commitError) {\n\t\t\tif (settlementOf(transaction)?.committed === true) throw commitError;\n\t\t\ttry {\n\t\t\t\tawait transaction.rollback();\n\t\t\t} catch (rollbackError) {\n\t\t\t\tconst settlement = settlementOf(transaction);\n\t\t\t\tif (settlement?.rolledBack === true) settlement.logDroppedError(rollbackError);\n\t\t\t\telse await destroyConnection(commitError);\n\t\t\t}\n\t\t\tconst wrapped = runtimeError(\"RUNTIME.TRANSACTION_COMMIT_FAILED\", \"Transaction commit failed\", { commitError });\n\t\t\twrapped.cause = commitError;\n\t\t\tthrow wrapped;\n\t\t}\n\t\treturn result;\n\t} finally {\n\t\tif (!connectionDisposed) await connection.release();\n\t}\n}\n//#endregion\nexport { startActivityOn as C, planContentHashOn as S, encodeParamsWithMetadata as _, sqlNativeArrayListDecoder as a, delegatingActivitySource as b, PreparedExecutionImpl as c, budgets as d, lowerSqlPlan as f, deriveParamMetadata as g, validateContractCodecMappings as h, decodeRow as i, PreparedStatementImpl as l, validateCodecRegistryCompleteness as m, withTransaction as n, createExecutionContext as o, extractCodecIds as p, buildDecodeContext as r, createSqlExecutionStack as s, SqlRuntimeBase as t, lints as u, createAstCodecRegistry as v, findActivitySource as x, activitySource as y };\n\n//# sourceMappingURL=exports-DEoQjOnB.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,iBAAiB,OAAO,gBAAgB;AAC9C,SAAS,wBAAwB,QAAQ;CACxC,OAAO,kBAAkB;AAC1B;;AAEA,SAAS,mBAAmB,QAAQ;CACnC,OAAO,wBAAwB,MAAM,IAAI,OAAO,kBAAkB,KAAK;AACxE;AACA,SAAS,iBAAiB,QAAQ;CACjC,MAAM,SAAS,mBAAmB,MAAM;CACxC,UAAU,WAAW,KAAK,GAAG,uCAAuC;CACpE,OAAO;AACR;;AAEA,SAAS,yBAAyB,QAAQ;CACzC,OAAO;EACN,gBAAgB,aAAa,gBAAgB,OAAO,GAAG,QAAQ;EAC/D,kBAAkB,SAAS,kBAAkB,OAAO,GAAG,IAAI;CAC5D;AACD;;AAEA,SAAS,gBAAgB,QAAQ,UAAU;CAC1C,OAAO,iBAAiB,MAAM,CAAC,CAAC,cAAc,QAAQ;AACvD;AACA,SAAS,kBAAkB,QAAQ,MAAM;CACxC,OAAO,iBAAiB,MAAM,CAAC,CAAC,gBA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/dist/types-CaVn_xxe.mjs"],"sourcesContent":["import { f as normalizeIndexOptionValue, l as nameOf } from \"./naming-bM5qm5PY.mjs\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { dataTypeValuesEqual } from \"@internal/framework-components/codec\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/ir/schema-node-kinds.ts\n/**\n* The `nodeKind` discriminant for each relational schema-diff leaf node.\n* Each node carries a unique value; the differ pairs siblings by `id`, and\n* these kinds distinguish the node types that appear as `PostgresTableSchemaNode`\n* children (columns, primary key, foreign keys, uniques, indexes, checks) from\n* each other and from the RLS policy/role kinds a target defines separately.\n*/\nconst RelationalSchemaNodeKind = {\n\tschema: \"sql-schema\",\n\ttable: \"sql-table\",\n\tcolumn: \"sql-column\",\n\tcolumnDefault: \"sql-column-default\",\n\tprimaryKey: \"sql-primary-key\",\n\tforeignKey: \"sql-foreign-key\",\n\tunique: \"sql-unique\",\n\tindex: \"sql-index\",\n\tcheck: \"sql-check-constraint\"\n};\n/**\n* The one real map from a relational `nodeKind` to the framework-neutral\n* {@link DiffSubjectGranularity} its diff issues carry — the SQL family's\n* post-diff filters (issue category, strict-mode gating) and the framework\n* aggregate's unclaimed-elements sweep key on the granularity, never on the\n* `nodeKind` spelling and never on anything stamped on the node. Resolution\n* is by `nodeKind` equality against this map, not a suffix string match.\n* Target-specific node kinds (Postgres namespace/table/policy/role) are\n* outside this family layer's vocabulary and map their own kinds directly.\n*/\nconst RELATIONAL_NODE_GRANULARITY = {\n\t[RelationalSchemaNodeKind.schema]: \"structural\",\n\t[RelationalSchemaNodeKind.table]: \"entity\",\n\t[RelationalSchemaNodeKind.column]: \"field\",\n\t[RelationalSchemaNodeKind.columnDefault]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.primaryKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.foreignKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.unique]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.index]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.check]: \"auxiliary\"\n};\nfunction isRelationalSchemaNodeKind(nodeKind) {\n\treturn Object.hasOwn(RELATIONAL_NODE_GRANULARITY, nodeKind);\n}\n/**\n* Looks up the subject granularity for a relational `nodeKind`. Throws for a\n* `nodeKind` outside this map (a target-specific kind, e.g. Postgres's\n* namespace/table/policy/role) — those map their own kinds directly rather\n* than through this family-level map.\n*/\nfunction relationalNodeGranularity(nodeKind) {\n\tif (!isRelationalSchemaNodeKind(nodeKind)) throw new InternalError(`relationalNodeGranularity: unrecognized relational node kind \"${nodeKind}\"`);\n\treturn RELATIONAL_NODE_GRANULARITY[nodeKind];\n}\n/**\n* The one real map from a relational `nodeKind` to its storage `entityKind`\n* — the same vocabulary the contract storage's `entries` dictionary keys use\n* (`elementCoordinates` walks it). Only the whole-table kind has an entity of\n* its own; every other relational node (a column, an index, …) is nested\n* under one and maps to nothing here.\n*/\nconst RELATIONAL_NODE_ENTITY_KIND = { [RelationalSchemaNodeKind.table]: \"table\" };\n/**\n* Looks up the storage `entityKind` for a relational `nodeKind` — sibling of\n* {@link relationalNodeGranularity}, resolved by `nodeKind` equality against\n* {@link RELATIONAL_NODE_ENTITY_KIND}. `undefined` for a target-specific kind\n* (targets map their own kinds directly) or a relational kind with no entity\n* of its own.\n*/\nfunction relationalNodeEntityKind(nodeKind) {\n\treturn isRelationalSchemaNodeKind(nodeKind) ? RELATIONAL_NODE_ENTITY_KIND[nodeKind] : void 0;\n}\n//#endregion\n//#region src/ir/sql-schema-ir-node.ts\n/**\n* SQL Schema IR node base. Carries the family-level\n* `kind = 'sql-schema-ir'` discriminator and inherits the framework's\n* `freezeNode` affordance.\n*\n* SQL Schema IR represents the actual database state as discovered by\n* introspection (the parallel to SQL Contract IR, which represents the\n* desired state).\n*\n* The discriminator is installed as a non-enumerable own property,\n* matching the SqlNode pattern. This keeps `JSON.stringify(node)`\n* canonical (no `kind` field), keeps `toEqual({...})` test assertions\n* against pre-lift flat shapes passing, and keeps `node.kind` readable\n* for dispatch.\n*\n* Both `kind` and `nodeKind` are required: every concrete leaf is a node\n* the generic differ can pair and compare, so every leaf must declare which\n* node it is. `nodeKind` has no default here — every direct subclass sets its\n* own literal value (the relational leaves via `RelationalSchemaNodeKind`,\n* target concretions via their own vocabulary, e.g. `PostgresSchemaNodeKind`).\n*/\nvar SqlSchemaIRNode = class extends IRNodeBase {\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql-schema-ir\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n/**\n* Asserts `node` matches `predicate`, narrowing its type to `T`. The one\n* shared implementation every node class's `static assert` and `isEqualTo`\n* reach for, instead of each hand-writing its own throw: the message names\n* the class the caller expected.\n*/\nfunction assertNode(node, className, predicate) {\n\tif (node === void 0 || !predicate(node)) throw new InternalError(`Expected a ${className} but got nodeKind=${node?.nodeKind ?? \"undefined\"}`);\n}\n/**\n* Defines a non-enumerable own property, the same treatment `kind` gets\n* above: a derivation-time render-support field stays out of\n* `JSON.stringify`, `toEqual({...})` structural assertions, and spreads,\n* while remaining directly readable (`node.field`) for the one consumer\n* that resolves it at plan time. A no-op when `value` is `undefined` — the\n* property is simply absent, matching every other optional field on these\n* nodes.\n*/\nfunction defineNonEnumerable(target, key, value) {\n\tif (value === void 0) return;\n\tObject.defineProperty(target, key, {\n\t\tvalue,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n}\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* Primary-key Schema IR node. Mirrors the Contract IR `PrimaryKey`\n* shape (same `columns` + optional `name`) so verification can compare\n* intent and actual structurally. Defined here independently to avoid\n* a sql-schema-ir -> sql-contract dependency.\n*\n* Implements `DiffableNode` so a primary key is directly a table's diff-tree\n* child. `id` is a fixed sentinel — a table has at most one primary key, so\n* there is never a sibling to disambiguate against. `isEqualTo` compares the\n* column tuple; the PK's own `name` is a database-assigned label with no\n* semantic weight, so it is not compared (mirrors the policy node's\n* name-insensitivity to non-identifying detail).\n*/\nvar PrimaryKey = class PrimaryKey extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.primaryKey;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"primary-key\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.primaryKey;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"PrimaryKey\", PrimaryKey.is);\n\t\treturn this.columns.length === node.columns.length && this.columns.every((c, i) => c === node.columns[i]);\n\t}\n};\n//#endregion\n//#region src/ir/sql-check-constraint-ir.ts\n/**\n* Schema IR node for a table-level check constraint, carried as an opaque\n* predicate. The expression is never parsed — a database reprints predicates\n* in its own normalized form, so any structured reading of it would drift.\n*\n* Implements `DiffableNode` so a check is directly a table's diff-tree child;\n* `id` is `check:<name>`. `isEqualTo` is mode-selected by the receiver's\n* `prefix` (the differ always calls `expected.isEqualTo(actual)`): a\n* wire-named receiver compares ids only — the wire name's hash already\n* commits to the predicate — while an exact-named receiver byte-compares the\n* expression, which is reliable precisely when both sides came from the same\n* reprint.\n*/\nvar SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.check;\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `check:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlCheckConstraintIR ? value : new SqlCheckConstraintIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.check;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlCheckConstraintIR\", SqlCheckConstraintIR.is);\n\t\tif (this.prefix !== void 0) return this.id === node.id;\n\t\treturn this.expression === node.expression;\n\t}\n};\n//#endregion\n//#region src/ir/sql-default-value.ts\nfunction isList(value) {\n\treturn Array.isArray(value);\n}\n/** Whether two defaults are one value: the same type, parameters and value, element by element for a list. */\nfunction sqlDefaultValuesEqual(a, b) {\n\tif (!isList(a) || !isList(b)) return !isList(a) && !isList(b) && dataTypeValuesEqual(a, b);\n\treturn a.length === b.length && a.every((element, index) => {\n\t\tconst other = b[index];\n\t\tif (element === null || other === null || other === void 0) return element === other;\n\t\treturn dataTypeValuesEqual(element, other);\n\t});\n}\n//#endregion\n//#region src/ir/sql-column-default-ir.ts\n/**\n* Schema-diff node for a column's default value. The default is the one\n* column attribute with an extra/missing/drift lifecycle of its own, so it\n* is a child node of the column rather than a compared attribute: an\n* undeclared live default surfaces as `not-expected`, a declared default the\n* database lacks as `not-found`, and a divergent value as `not-equal` — the\n* three reasons cover the legacy `extra_default` / `default_missing` /\n* `default_mismatch` vocabulary with no attribute inspection.\n*\n* `id` is a fixed sentinel — a column has at most one default. Built\n* transiently by `SqlColumnIR.children()` from the column's own fields;\n* never constructed by derivation or introspection directly.\n*/\nvar SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.columnDefault;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (input.resolved !== void 0) this.resolved = input.resolved;\n\t\tif (input.raw !== void 0) this.raw = input.raw;\n\t\tdefineNonEnumerable(this, \"authored\", input.authored);\n\t\tdefineNonEnumerable(this, \"value\", input.value);\n\t\tdefineNonEnumerable(this, \"unreadable\", input.unreadable);\n\t\tdefineNonEnumerable(this, \"expressionValue\", input.expressionValue);\n\t\tdefineNonEnumerable(this, \"many\", input.many);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"default\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.columnDefault;\n\t}\n\t/**\n\t* Compares with `this` as the expected side. Two literals compare as values of the column's type\n\t* when both sides hold one, and as canonical JSON otherwise; a `Date` the column's codec could not\n\t* read into a value equals nothing. Two expressions compare as text, with\n\t* case and whitespace ignored outside quotes. An expected expression that writes a literal, read by\n\t* the column's codec during introspection, matches a reported literal when the two values are\n\t* equal; when the codec could not read one of them, it compares with the reported text. A resolved\n\t* side against a raw-only side is a mismatch; two raw-only nodes compare their text.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnDefaultIR\", SqlColumnDefaultIR.is);\n\t\tconst expected = this.resolved;\n\t\tconst actual = node.resolved;\n\t\tif (expected?.kind === \"function\" && actual === void 0) return node.raw !== void 0 && sameExpression(expected.expression, node.raw);\n\t\tif (expected === void 0 || actual === void 0) return expected === actual && this.raw === node.raw;\n\t\tif (expected.kind === \"function\") {\n\t\t\tif (actual.kind === \"function\") return sameExpression(expected.expression, actual.expression);\n\t\t\tif (node.value !== void 0 && node.expressionValue !== void 0) return sqlDefaultValuesEqual(node.expressionValue, node.value);\n\t\t\treturn node.raw !== void 0 && sameExpression(expected.expression, node.raw);\n\t\t}\n\t\tif (actual.kind !== \"literal\") return false;\n\t\tif (this.value !== void 0 && node.value !== void 0) return sqlDefaultValuesEqual(this.value, node.value);\n\t\tif (expected.value instanceof Date || actual.value instanceof Date) return false;\n\t\treturn canonicalStringify(expected.value) === canonicalStringify(actual.value);\n\t}\n\t/** Why the column's codec could not read the default the database reports, when it could not; otherwise the value each side holds. */\n\texplainMismatch(actual) {\n\t\tif (!(actual instanceof SqlColumnDefaultIR)) return void 0;\n\t\tif (actual.unreadable !== void 0) return actual.unreadable;\n\t\treturn `The contract holds ${describeDefault(this)}, and the database holds ${describeDefault(actual)}.`;\n\t}\n};\n/** A default as a person reads it: a literal as JSON, the value its type read when there is one, an expression as its text, and the text the database reports beside a value read from it. */\nfunction describeDefault(node) {\n\tconst resolved = node.resolved;\n\tif (resolved === void 0) return node.raw ?? \"no default\";\n\tif (resolved.kind === \"function\") return resolved.expression;\n\tconst shown = JSON.stringify(node.value === void 0 ? resolved.value : jsonOfDefaultValue(node.value));\n\treturn node.raw === void 0 || node.raw === shown ? shown : `${shown} (${node.raw})`;\n}\nfunction isDefaultList(value) {\n\treturn Array.isArray(value);\n}\nfunction jsonOfDefaultValue(value) {\n\treturn isDefaultList(value) ? value.map((element) => element === null ? null : element.value) : value.value;\n}\nfunction sameExpression(a, b) {\n\treturn comparableExpression(a) === comparableExpression(b);\n}\n/** The expression with case and whitespace dropped outside quotes; a quoted literal or identifier keeps both, since they change what it means. */\nfunction comparableExpression(expression) {\n\tlet result = \"\";\n\tlet quote;\n\tfor (const char of expression) if (quote !== void 0) {\n\t\tresult += char;\n\t\tif (char === quote) quote = void 0;\n\t} else if (char === \"'\" || char === \"\\\"\") {\n\t\tquote = char;\n\t\tresult += char;\n\t} else if (!/\\s/.test(char)) result += char.toLowerCase();\n\treturn result;\n}\n//#endregion\n//#region src/ir/sql-column-ir.ts\n/**\n* Schema IR node for a single column on a table, as observed by\n* introspection. Unlike the Contract IR `StorageColumn`, this carries\n* the column's `name` (Schema IR columns are returned as arrays from\n* introspection queries; the parent table re-keys them into a record\n* for downstream consumers).\n*\n* Implements `DiffableNode` so a column is directly a table's diff-tree\n* child: `id` is the column name (unique among a table's columns); `isEqualTo`\n* compares this column's own attributes only — never children, since a\n* column is a leaf. When both sides carry `resolvedNativeType` (stamped at\n* derivation/introspection), the comparison uses the resolved values —\n* resolved native type, nullability, and structured default equality per\n* the relational walk's `columnDefaultsEqual` semantics, with `this` as the\n* expected side. Otherwise it falls back to comparing raw fields.\n*/\nvar SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.column;\n\tname;\n\tnativeType;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.resolvedNativeType !== void 0) this.resolvedNativeType = input.resolvedNativeType;\n\t\tif (input.resolvedDefault !== void 0) this.resolvedDefault = input.resolvedDefault;\n\t\tdefineNonEnumerable(this, \"authoredDefault\", input.authoredDefault);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tdefineNonEnumerable(this, \"dataType\", input.dataType);\n\t\tdefineNonEnumerable(this, \"defaultValue\", input.defaultValue);\n\t\tdefineNonEnumerable(this, \"defaultUnreadable\", input.defaultUnreadable);\n\t\tdefineNonEnumerable(this, \"defaultExpressionValue\", input.defaultExpressionValue);\n\t\tdefineNonEnumerable(this, \"reportedType\", input.reportedType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `column:${this.name}`;\n\t}\n\t/**\n\t* The column's default, when declared/present, is the column's one child\n\t* node — it has an extra/missing/drift lifecycle of its own, so the differ\n\t* recurses to it rather than `isEqualTo` comparing it. Built transiently\n\t* from this column's own fields.\n\t*/\n\tchildren() {\n\t\tif (this.resolvedDefault === void 0 && this.default === void 0) return [];\n\t\treturn [new SqlColumnDefaultIR({\n\t\t\t...ifDefined(\"resolved\", this.resolvedDefault),\n\t\t\t...ifDefined(\"raw\", this.default),\n\t\t\t...ifDefined(\"authored\", this.authoredDefault),\n\t\t\t...ifDefined(\"value\", this.defaultValue),\n\t\t\t...ifDefined(\"unreadable\", this.defaultUnreadable),\n\t\t\t...ifDefined(\"expressionValue\", this.defaultExpressionValue),\n\t\t\t...ifDefined(\"many\", this.many ?? this.codecRef?.many),\n\t\t\t...ifDefined(\"codecRef\", this.codecRef),\n\t\t\t...ifDefined(\"codecBaseNativeType\", this.codecBaseNativeType)\n\t\t})];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.column;\n\t}\n\t/**\n\t* Compares the column's own attributes only — the default lives on the\n\t* child node. When both sides carry `resolvedNativeType`, the resolved\n\t* value governs (array-ness rides on its `[]` suffix); otherwise raw\n\t* fields compare.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\tif (this.resolvedNativeType !== void 0 && node.resolvedNativeType !== void 0) return this.resolvedNativeType === node.resolvedNativeType && this.nullable === node.nullable;\n\t\treturn this.nativeType === node.nativeType && this.nullable === node.nullable && Boolean(this.many) === Boolean(node.many);\n\t}\n};\n//#endregion\n//#region src/ir/sql-foreign-key-ir.ts\n/**\n* Schema IR node for a foreign-key constraint as observed by\n* introspection. The `referencedTable` / `referencedColumns` field\n* names match the introspection vocabulary (`pg_constraint.confkey`,\n* etc.) and intentionally differ from the Contract IR's nested\n* `references: { table, columns }` shape so that the verifier's\n* structural comparison stays explicit about which side it's reading.\n*\n* Implements `DiffableNode` so a foreign key is directly a table's diff-tree\n* child. Foreign keys are frequently unnamed (introspection may not carry a\n* constraint name, and the contract side never invents one), so `id` is\n* derived from the referencing/referenced coordinates rather than `name` —\n* the same tuple that makes two FK constraints the same constraint. This\n* also serves as the comparison key: two FKs with the same coordinates are\n* paired by the differ, and `isEqualTo` then compares the remaining\n* attribute — the referential actions.\n*/\nvar SqlForeignKeyIR = class SqlForeignKeyIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.foreignKey;\n\tcolumns;\n\treferencedTable;\n\treferencedColumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tthis.referencedTable = input.referencedTable;\n\t\tthis.referencedColumns = input.referencedColumns;\n\t\tif (input.referencedSchema !== void 0) this.referencedSchema = input.referencedSchema;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tconst resolvedReferencedNamespace = input.resolvedReferencedNamespace ?? input.referencedSchema;\n\t\tif (resolvedReferencedNamespace !== void 0) this.resolvedReferencedNamespace = resolvedReferencedNamespace;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\tconst referencedNamespace = this.resolvedReferencedNamespace ?? \"\";\n\t\treturn `foreign-key:${this.columns.join(\",\")}->${referencedNamespace}.${this.referencedTable}(${this.referencedColumns.join(\",\")})`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.foreignKey;\n\t}\n\t/**\n\t* Referential-action comparison with `this` as the expected side, matching\n\t* the relational walk's `getReferentialActionMismatches`: `noAction` is the\n\t* database default and equivalent to an undeclared action, and drift is\n\t* flagged only when the expected side declares a (normalized) action.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlForeignKeyIR\", SqlForeignKeyIR.is);\n\t\treturn referentialActionMatches(this.onDelete, node.onDelete) && referentialActionMatches(this.onUpdate, node.onUpdate);\n\t}\n};\nfunction referentialActionMatches(expected, actual) {\n\tconst normalizedExpected = expected === \"noAction\" ? void 0 : expected;\n\tif (normalizedExpected === void 0) return true;\n\treturn normalizedExpected === (actual === \"noAction\" ? void 0 : actual);\n}\n//#endregion\n//#region src/ir/sql-index-ir.ts\n/**\n* Schema IR node for a secondary index as observed by introspection.\n* Unlike the Contract IR `Index`, the Schema IR carries an explicit\n* `unique` field — introspection sees the underlying index regardless\n* of whether the user expressed it as `@@index` or `@@unique`, and the\n* verifier needs to distinguish them when comparing to the Contract.\n*\n* Implements `DiffableNode` so an index is directly a table's diff-tree\n* child. Indexes are name-identified: every index — contract-derived or\n* introspected — carries its full physical name, and `id` is that name.\n* Names are catalog-unique per schema, so two indexes legitimately sharing\n* one column tuple (a unique index beside a redundant plain index) are two\n* distinct siblings, and expression indexes need no column tuple at all.\n*\n* `isEqualTo` is selected by the receiver (the differ always calls\n* `expected.isEqualTo(actual)`) and delegates to {@link contentEquals} —\n* the single node-owned content relation: both modes compare `unique`\n* strict, `type` and option values through the named normalization seams,\n* and `columns` ordered-strict when both sides carry them; an exact-named\n* receiver (`prefix === undefined`) additionally byte-compares\n* `expression`/`where` (both sides are reprints in the supported flow —\n* normalizing would only mask real drift); a wire-named receiver never\n* compares bodies (the wire-name hash already commits to them).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL that any SQL target may\n* introspect, so the family node must represent them; a target declining\n* to author them is a capability decision, not target-specificity.\n*/\nvar SqlIndexIR = class SqlIndexIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.index;\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new InternalError(`SqlIndexIR \"${name}\": exactly one of columns or expression must be set.`);\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tconst normalizedType = normalizeIndexType(input.type);\n\t\tif (normalizedType !== void 0) this.type = normalizedType;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tdefineNonEnumerable(this, \"partial\", input.partial);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `index:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlIndexIR ? value : new SqlIndexIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.index;\n\t}\n\t/**\n\t* Mode-selected structural equality — see the class doc. Delegates to the\n\t* single node-owned relation: `columns` compare ordered-strict when both\n\t* sides carry them; an exact receiver (`prefix === undefined`)\n\t* byte-compares `expression ?? ''` and `where ?? ''`; a wire-named receiver\n\t* never compares bodies (the wire-name hash already commits to them).\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlIndexIR\", SqlIndexIR.is);\n\t\treturn this.contentEquals(node, {\n\t\t\tcolumnPresence: \"when-both-defined\",\n\t\t\tbodies: this.prefix !== void 0 ? \"ignored\" : \"verbatim\"\n\t\t});\n\t}\n\t/**\n\t* The single index content-equality relation — every comparer (the differ\n\t* via {@link isEqualTo}, the planner's rename content-pairing) calls this\n\t* with its mode-appropriate strictness rather than growing a parallel\n\t* relation:\n\t*\n\t* - `columnPresence: 'when-both-defined'` (the differ's rule) compares\n\t* the tuples ordered-strict only when both sides carry them — a paired\n\t* node's identity already agreed, so a column node meeting an\n\t* expression node skips the tuple.\n\t* - `columnPresence: 'matching'` (the rename-pairing rule) additionally\n\t* requires presence to agree: a column index never pairs an expression\n\t* index.\n\t* - `bodies: 'verbatim'` byte-compares `expression ?? ''` / `where ?? ''`\n\t* (absent ≡ empty, no normalization — both sides are reprints in the\n\t* supported flow); `bodies: 'ignored'` skips them (wire identity —\n\t* the wire-name hash commits to the content).\n\t*\n\t* `unique` compares strictly; `type` and option VALUES compare through\n\t* the named normalization seams below.\n\t*/\n\tcontentEquals(other, strictness) {\n\t\tconst columnsEqual = strictness.columnPresence === \"matching\" ? this.columns === void 0 === (other.columns === void 0) && (this.columns === void 0 || isArrayEqual(this.columns, other.columns ?? [])) : this.columns === void 0 || other.columns === void 0 || isArrayEqual(this.columns, other.columns);\n\t\tif (!(this.unique === other.unique && normalizeIndexType(this.type) === normalizeIndexType(other.type) && indexOptionsEqual(this.options, other.options) && columnsEqual)) return false;\n\t\tif (strictness.bodies === \"ignored\") return true;\n\t\treturn (this.expression ?? \"\") === (other.expression ?? \"\") && (this.where ?? \"\") === (other.where ?? \"\");\n\t}\n};\n/**\n* The btree-default normalization seam: the default access method (`btree`\n* in every supported SQL target) normalizes to absent. Applied at\n* construction — every derivation path (contract tree, introspection, flat\n* family tree) builds through the class, so both compare sides are\n* symmetric by definition — and again inside\n* {@link SqlIndexIR.contentEquals} so the relation holds for any input.\n* The contract JSON and the wire-name content hash keep the authored\n* spelling: `@@index([a], type: \"btree\")` and `@@index([a])` are distinct\n* wire names — but content-equal after normalization, so a spelling change\n* between them converges as a rename via the planner's content\n* pairing (the hashes differ, so hash pairing never pairs them).\n*/\nfunction normalizeIndexType(type) {\n\treturn type === \"btree\" ? void 0 : type;\n}\n/**\n* Option-bag equality: same key set, values compared through\n* {@link normalizeIndexOptionValue} — Postgres introspection returns\n* reloptions values as catalog-reprint strings (`'70'`, `'on'`) while\n* contract option leaves are typed (number, boolean, string).\n*/\nfunction indexOptionsEqual(a, b) {\n\tconst aKeys = a ? Object.keys(a).sort() : [];\n\tconst bKeys = b ? Object.keys(b).sort() : [];\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i += 1) if (aKeys[i] !== bKeys[i]) return false;\n\tif (aKeys.length === 0) return true;\n\tfor (const key of aKeys) if (normalizeIndexOptionValue(a?.[key]) !== normalizeIndexOptionValue(b?.[key])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/ir/sql-unique-ir.ts\n/**\n* Schema IR node for a table-level unique constraint as observed by\n* introspection.\n*\n* Implements `DiffableNode` so a unique constraint is directly a table's\n* diff-tree child. Unique constraints are frequently unnamed, so `id` is\n* derived from the column tuple rather than `name` — the column tuple is\n* also what makes two unique constraints the same constraint, so it doubles\n* as the pairing key. There are no further attributes to compare once\n* columns are equal (the differ pairs on `id`), so `isEqualTo` is identity.\n*/\nvar SqlUniqueIR = class SqlUniqueIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.unique;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = [...input.columns];\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `unique:${this.columns.join(\",\")}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.unique;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlUniqueIR\", SqlUniqueIR.is);\n\t\treturn this.id === node.id;\n\t}\n};\n//#endregion\n//#region src/ir/sql-table-ir.ts\n/**\n* Schema IR node for a single table as observed by introspection.\n*\n* Unlike the Contract IR `StorageTable`, this carries the table's\n* `name` — introspection queries return tables as arrays and the\n* verifier keys them into `SqlSchemaIR.tables` afterwards, so the name\n* stays on the table object for downstream call sites that walk\n* `Object.values(schema.tables)`.\n*\n* The constructor normalises nested IR-class fields so downstream\n* walks see a uniform AST regardless of whether the input was a\n* plain-data literal (from introspection) or already-constructed\n* class instances.\n*\n* Implements `DiffableNode` so a flat (single-schema) tree is directly\n* diffable: `id` is the table name; `isEqualTo` is identity (the table's\n* structural drift is entirely expressed by its children); `children()`\n* yields every column, the primary key (when present), every foreign key,\n* unique, index, and check constraint — the same composition and order as\n* the Postgres table node, minus policies.\n*/\nvar SqlTableIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.table;\n\tname;\n\tcolumns;\n\tforeignKeys;\n\tuniques;\n\tindexes;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([key, col]) => [key, col instanceof SqlColumnIR ? col : new SqlColumnIR(col)])));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof SqlForeignKeyIR ? fk : new SqlForeignKeyIR(fk)));\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof SqlUniqueIR ? u : new SqlUniqueIR(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map(SqlIndexIR.from));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(SqlCheckConstraintIR.from));\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn this.name;\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn [\n\t\t\t...Object.values(this.columns),\n\t\t\t...this.primaryKey ? [this.primaryKey] : [],\n\t\t\t...this.foreignKeys,\n\t\t\t...this.uniques,\n\t\t\t...this.indexes,\n\t\t\t...this.checks ?? []\n\t\t];\n\t}\n};\n//#endregion\n//#region src/ir/sql-schema-ir.ts\n/**\n* Root Schema IR node representing the complete database schema as\n* observed by introspection. Target-agnostic; used by both verifiers\n* (compare against intended Contract storage) and migration planners\n* (derive operations needed to reconcile).\n*\n* The constructor normalises nested `SqlTableIR` instances so\n* downstream walks see a uniform AST regardless of whether the input\n* was a plain-data literal or already-constructed class instances.\n*\n* Implements `DiffableNode` as the root of a flat (single-schema) diff\n* tree: `id` is the fixed sentinel `'database'` (roots have no siblings),\n* `isEqualTo` is identity (a container has no own attributes), and\n* `children()` yields the table nodes.\n*/\nvar SqlSchemaIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.schema;\n\ttables;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables).map(([key, t]) => [key, t instanceof SqlTableIR ? t : new SqlTableIR(t)])));\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"database\";\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn Object.values(this.tables);\n\t}\n};\n//#endregion\nexport { SqlForeignKeyIR as a, sqlDefaultValuesEqual as c, SqlSchemaIRNode as d, assertNode as f, relationalNodeGranularity as g, relationalNodeEntityKind as h, SqlIndexIR as i, SqlCheckConstraintIR as l, RelationalSchemaNodeKind as m, SqlTableIR as n, SqlColumnIR as o, defineNonEnumerable as p, SqlUniqueIR as r, SqlColumnDefaultIR as s, SqlSchemaIR as t, PrimaryKey as u };\n\n//# sourceMappingURL=types-CaVn_xxe.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,2BAA2B;CAChC,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,OAAO;AACR;;;;;;;;;;;AAWA,MAAM,8BAA8B;EAClC,yBAAyB,SAAS;EAClC,yBAA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