@quereus/quereus 4.8.0 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/src/core/database.d.ts +6 -0
  2. package/dist/src/core/database.d.ts.map +1 -1
  3. package/dist/src/core/database.js +26 -1
  4. package/dist/src/core/database.js.map +1 -1
  5. package/dist/src/func/builtins/aggregate.d.ts.map +1 -1
  6. package/dist/src/func/builtins/aggregate.js +3 -2
  7. package/dist/src/func/builtins/aggregate.js.map +1 -1
  8. package/dist/src/func/builtins/conversion.d.ts +5 -0
  9. package/dist/src/func/builtins/conversion.d.ts.map +1 -1
  10. package/dist/src/func/builtins/conversion.js +16 -2
  11. package/dist/src/func/builtins/conversion.js.map +1 -1
  12. package/dist/src/func/builtins/index.d.ts.map +1 -1
  13. package/dist/src/func/builtins/index.js +5 -2
  14. package/dist/src/func/builtins/index.js.map +1 -1
  15. package/dist/src/func/builtins/string.d.ts +2 -0
  16. package/dist/src/func/builtins/string.d.ts.map +1 -1
  17. package/dist/src/func/builtins/string.js +60 -4
  18. package/dist/src/func/builtins/string.js.map +1 -1
  19. package/dist/src/index.d.ts +6 -3
  20. package/dist/src/index.d.ts.map +1 -1
  21. package/dist/src/index.js +15 -2
  22. package/dist/src/index.js.map +1 -1
  23. package/dist/src/planner/building/constraint-builder.js +1 -1
  24. package/dist/src/planner/building/constraint-builder.js.map +1 -1
  25. package/dist/src/planner/rules/retrieve/rule-grow-retrieve.d.ts.map +1 -1
  26. package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js +121 -51
  27. package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js.map +1 -1
  28. package/dist/src/planner/rules/shared/index-style-context.d.ts +14 -4
  29. package/dist/src/planner/rules/shared/index-style-context.d.ts.map +1 -1
  30. package/dist/src/planner/rules/shared/index-style-context.js +14 -4
  31. package/dist/src/planner/rules/shared/index-style-context.js.map +1 -1
  32. package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
  33. package/dist/src/runtime/emit/alter-table.js +212 -155
  34. package/dist/src/runtime/emit/alter-table.js.map +1 -1
  35. package/dist/src/runtime/emit/assertion-drop-guard.d.ts +26 -12
  36. package/dist/src/runtime/emit/assertion-drop-guard.d.ts.map +1 -1
  37. package/dist/src/runtime/emit/assertion-drop-guard.js +45 -26
  38. package/dist/src/runtime/emit/assertion-drop-guard.js.map +1 -1
  39. package/dist/src/runtime/emit/assertion-rename-helpers.d.ts +6 -6
  40. package/dist/src/runtime/emit/assertion-rename-helpers.d.ts.map +1 -1
  41. package/dist/src/runtime/emit/assertion-rename-helpers.js +18 -20
  42. package/dist/src/runtime/emit/assertion-rename-helpers.js.map +1 -1
  43. package/dist/src/runtime/emit/binary.d.ts.map +1 -1
  44. package/dist/src/runtime/emit/binary.js +12 -10
  45. package/dist/src/runtime/emit/binary.js.map +1 -1
  46. package/dist/src/runtime/emit/column-rename-cascade.d.ts +84 -0
  47. package/dist/src/runtime/emit/column-rename-cascade.d.ts.map +1 -0
  48. package/dist/src/runtime/emit/column-rename-cascade.js +134 -0
  49. package/dist/src/runtime/emit/column-rename-cascade.js.map +1 -0
  50. package/dist/src/runtime/emit/drop-column-guards.d.ts +82 -53
  51. package/dist/src/runtime/emit/drop-column-guards.d.ts.map +1 -1
  52. package/dist/src/runtime/emit/drop-column-guards.js +155 -90
  53. package/dist/src/runtime/emit/drop-column-guards.js.map +1 -1
  54. package/dist/src/runtime/emit/drop-table.d.ts.map +1 -1
  55. package/dist/src/runtime/emit/drop-table.js +5 -0
  56. package/dist/src/runtime/emit/drop-table.js.map +1 -1
  57. package/dist/src/runtime/emit/drop-view.d.ts.map +1 -1
  58. package/dist/src/runtime/emit/drop-view.js +5 -0
  59. package/dist/src/runtime/emit/drop-view.js.map +1 -1
  60. package/dist/src/runtime/emit/expression-drop-guard.d.ts +57 -0
  61. package/dist/src/runtime/emit/expression-drop-guard.d.ts.map +1 -0
  62. package/dist/src/runtime/emit/expression-drop-guard.js +82 -0
  63. package/dist/src/runtime/emit/expression-drop-guard.js.map +1 -0
  64. package/dist/src/runtime/emit/materialized-view-helpers.d.ts +26 -9
  65. package/dist/src/runtime/emit/materialized-view-helpers.d.ts.map +1 -1
  66. package/dist/src/runtime/emit/materialized-view-helpers.js +37 -17
  67. package/dist/src/runtime/emit/materialized-view-helpers.js.map +1 -1
  68. package/dist/src/runtime/emit/materialized-view.d.ts.map +1 -1
  69. package/dist/src/runtime/emit/materialized-view.js +3 -0
  70. package/dist/src/runtime/emit/materialized-view.js.map +1 -1
  71. package/dist/src/schema/assertion.d.ts +58 -0
  72. package/dist/src/schema/assertion.d.ts.map +1 -1
  73. package/dist/src/schema/assertion.js +78 -0
  74. package/dist/src/schema/assertion.js.map +1 -1
  75. package/dist/src/schema/catalog-persistability.d.ts +11 -3
  76. package/dist/src/schema/catalog-persistability.d.ts.map +1 -1
  77. package/dist/src/schema/catalog-persistability.js +48 -29
  78. package/dist/src/schema/catalog-persistability.js.map +1 -1
  79. package/dist/src/schema/catalog.d.ts +22 -0
  80. package/dist/src/schema/catalog.d.ts.map +1 -1
  81. package/dist/src/schema/catalog.js +4 -1
  82. package/dist/src/schema/catalog.js.map +1 -1
  83. package/dist/src/schema/column-republication.d.ts +126 -0
  84. package/dist/src/schema/column-republication.d.ts.map +1 -0
  85. package/dist/src/schema/column-republication.js +121 -0
  86. package/dist/src/schema/column-republication.js.map +1 -0
  87. package/dist/src/schema/column-source-resolver.d.ts +29 -6
  88. package/dist/src/schema/column-source-resolver.d.ts.map +1 -1
  89. package/dist/src/schema/column-source-resolver.js +78 -9
  90. package/dist/src/schema/column-source-resolver.js.map +1 -1
  91. package/dist/src/schema/expression-dependents.d.ts +160 -0
  92. package/dist/src/schema/expression-dependents.d.ts.map +1 -0
  93. package/dist/src/schema/expression-dependents.js +228 -0
  94. package/dist/src/schema/expression-dependents.js.map +1 -0
  95. package/dist/src/schema/object-dependency-closure.d.ts +127 -0
  96. package/dist/src/schema/object-dependency-closure.d.ts.map +1 -0
  97. package/dist/src/schema/object-dependency-closure.js +117 -0
  98. package/dist/src/schema/object-dependency-closure.js.map +1 -0
  99. package/dist/src/schema/object-ref-resolver.d.ts +83 -0
  100. package/dist/src/schema/object-ref-resolver.d.ts.map +1 -0
  101. package/dist/src/schema/object-ref-resolver.js +135 -0
  102. package/dist/src/schema/object-ref-resolver.js.map +1 -0
  103. package/dist/src/schema/rename/column-rename.d.ts +228 -0
  104. package/dist/src/schema/rename/column-rename.d.ts.map +1 -0
  105. package/dist/src/schema/rename/column-rename.js +1225 -0
  106. package/dist/src/schema/rename/column-rename.js.map +1 -0
  107. package/dist/src/schema/rename/self-qualifier-strip.d.ts +29 -0
  108. package/dist/src/schema/rename/self-qualifier-strip.d.ts.map +1 -0
  109. package/dist/src/schema/rename/self-qualifier-strip.js +267 -0
  110. package/dist/src/schema/rename/self-qualifier-strip.js.map +1 -0
  111. package/dist/src/schema/rename/shared.d.ts +108 -0
  112. package/dist/src/schema/rename/shared.d.ts.map +1 -0
  113. package/dist/src/schema/rename/shared.js +49 -0
  114. package/dist/src/schema/rename/shared.js.map +1 -0
  115. package/dist/src/schema/rename/table-rename.d.ts +263 -0
  116. package/dist/src/schema/rename/table-rename.d.ts.map +1 -0
  117. package/dist/src/schema/rename/table-rename.js +860 -0
  118. package/dist/src/schema/rename/table-rename.js.map +1 -0
  119. package/dist/src/schema/rename-rewriter.d.ts +18 -278
  120. package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
  121. package/dist/src/schema/rename-rewriter.js +17 -1506
  122. package/dist/src/schema/rename-rewriter.js.map +1 -1
  123. package/dist/src/schema/schema-differ.d.ts.map +1 -1
  124. package/dist/src/schema/schema-differ.js +228 -21
  125. package/dist/src/schema/schema-differ.js.map +1 -1
  126. package/dist/src/types/builtin-types.d.ts.map +1 -1
  127. package/dist/src/types/builtin-types.js +12 -28
  128. package/dist/src/types/builtin-types.js.map +1 -1
  129. package/dist/src/types/cast-semantics.d.ts +7 -5
  130. package/dist/src/types/cast-semantics.d.ts.map +1 -1
  131. package/dist/src/types/cast-semantics.js +20 -9
  132. package/dist/src/types/cast-semantics.js.map +1 -1
  133. package/dist/src/types/index.d.ts +1 -1
  134. package/dist/src/types/index.d.ts.map +1 -1
  135. package/dist/src/types/index.js +1 -1
  136. package/dist/src/types/index.js.map +1 -1
  137. package/dist/src/types/registry.d.ts.map +1 -1
  138. package/dist/src/types/registry.js +2 -1
  139. package/dist/src/types/registry.js.map +1 -1
  140. package/dist/src/types/temporal-types.d.ts +11 -0
  141. package/dist/src/types/temporal-types.d.ts.map +1 -1
  142. package/dist/src/types/temporal-types.js +82 -0
  143. package/dist/src/types/temporal-types.js.map +1 -1
  144. package/dist/src/util/affinity.d.ts +2 -1
  145. package/dist/src/util/affinity.d.ts.map +1 -1
  146. package/dist/src/util/affinity.js +16 -5
  147. package/dist/src/util/affinity.js.map +1 -1
  148. package/dist/src/util/ast-spine-clone.d.ts +2 -2
  149. package/dist/src/util/ast-spine-clone.js +2 -2
  150. package/dist/src/util/value-text.d.ts +48 -0
  151. package/dist/src/util/value-text.d.ts.map +1 -0
  152. package/dist/src/util/value-text.js +35 -0
  153. package/dist/src/util/value-text.js.map +1 -0
  154. package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
  155. package/dist/src/vtab/memory/layer/manager.js +14 -5
  156. package/dist/src/vtab/memory/layer/manager.js.map +1 -1
  157. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"assertion-rename-helpers.js","sourceRoot":"","sources":["../../../../src/runtime/emit/assertion-rename-helpers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,GAAG,GAAG,YAAY,CAAC,+BAA+B,CAAC,CAAC;AAE1D,mFAA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AAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAmBlF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAsGnF;AAiBD,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CA2ChF"}
1
+ {"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/binary.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAWlE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAgClF;AA4CD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAqHnF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAmEtF;AA2CD,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAkBlF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAsGnF;AAiBD,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CA6ChF"}
@@ -6,6 +6,7 @@ import { hasRelationalDescendant } from "../../planner/analysis/scalar-subquerie
6
6
  import { emitPlanNode, emitCallFromPlan } from "../emitters.js";
7
7
  import { compareSqlValuesFast, createTypedComparator, hasSemanticOrdering, isTruthy } from "../../util/comparison.js";
8
8
  import { coerceToNumberForArithmetic } from "../../util/coercion.js";
9
+ import { valueToText } from "../../util/value-text.js";
9
10
  import { simpleLike, compileLikeMatcher } from "../../util/patterns.js";
10
11
  import { tryTemporalArithmetic, tryTemporalComparison } from "./temporal-arithmetic.js";
11
12
  import { effectiveComparisonCollation } from "../../planner/analysis/comparison-collation.js";
@@ -302,10 +303,9 @@ export function emitConcatOp(plan, ctx) {
302
303
  // SQL concatenation: NULL || anything -> NULL
303
304
  if (v1 === null || v2 === null)
304
305
  return null;
305
- // Convert both operands to strings
306
- const s1 = String(v1);
307
- const s2 = String(v2);
308
- return s1 + s2;
306
+ // Convert both operands through the shared value-to-text rule, so `b || ''`
307
+ // spells a blob or a JSON document exactly as `cast(b as text)` does.
308
+ return valueToText(v1) + valueToText(v2);
309
309
  }
310
310
  const leftExpr = emitPlanNode(plan.left, ctx);
311
311
  const rightExpr = emitPlanNode(plan.right, ctx);
@@ -411,7 +411,7 @@ export function emitLogicalOp(plan, ctx) {
411
411
  }
412
412
  /**
413
413
  * If `node` is a literal-constant, non-NULL pattern, return the exact string the
414
- * per-row path would derive from it (`String(value)`), otherwise undefined.
414
+ * per-row path would derive from it ({@link valueToText}), otherwise undefined.
415
415
  * A NULL literal, a not-yet-resolved Promise value, or any non-literal node
416
416
  * falls through to the dynamic (memoized) per-row path so semantics are
417
417
  * unchanged. Cast/collate-wrapped literals are intentionally NOT unwrapped —
@@ -423,7 +423,7 @@ function constLikePattern(node) {
423
423
  const value = node.expression.value;
424
424
  if (value === null || value === undefined || value instanceof Promise)
425
425
  return undefined;
426
- return String(value);
426
+ return valueToText(value);
427
427
  }
428
428
  export function emitLikeOp(plan, ctx) {
429
429
  const leftExpr = emitPlanNode(plan.left, ctx);
@@ -438,7 +438,7 @@ export function emitLikeOp(plan, ctx) {
438
438
  // text LIKE <const>: NULL text → NULL, else run the pre-compiled matcher.
439
439
  if (text === null)
440
440
  return null;
441
- return matcher(String(text));
441
+ return matcher(valueToText(text));
442
442
  }
443
443
  return {
444
444
  params: [leftExpr],
@@ -452,9 +452,11 @@ export function emitLikeOp(plan, ctx) {
452
452
  if (text === null || pattern === null) {
453
453
  return null;
454
454
  }
455
- // Convert both operands to strings and perform LIKE matching (memoized compile).
456
- const textStr = String(text);
457
- const patternStr = String(pattern);
455
+ // Convert both operands through the shared value-to-text rule and perform LIKE
456
+ // matching (memoized compile). Must agree with `constLikePattern` above, or the
457
+ // constant-pattern fast path starts answering differently from this one.
458
+ const textStr = valueToText(text);
459
+ const patternStr = valueToText(pattern);
458
460
  return simpleLike(patternStr, textStr);
459
461
  }
460
462
  const rightExpr = emitPlanNode(plan.right, ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"binary.js","sourceRoot":"","sources":["../../../../src/runtime/emit/binary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGtH,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAE9F,MAAM,UAAU,YAAY,CAAC,IAAkB,EAAE,GAAoB;IACpE,4EAA4E;IAC5E,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU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,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACjD,SAAS,eAAe,CAAC,IAAoB,EAAE,IAAc;YAC5D,0EAA0E;YAC1E,IAAI,IAAI,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC;YAC/B,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QACnC,CAAC;QACD,OAAO;YACN,MAAM,EAAE,CAAC,QAAQ,CAAC;YAClB,GAAG,EAAE,KAAK,CAAC,eAAe,CAAC;YAC3B,IAAI,EAAE,kBAAkB;SACxB,CAAC;IACH,CAAC;IAED,SAAS,GAAG,CAAC,GAAmB,EAAE,IAAc,EAAE,OAAiB;QAClE,oCAAoC;QACpC,2DAA2D;QAC3D,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC;QACb,CAAC;QAED,+EAA+E;QAC/E,gFAAgF;QAChF,yEAAyE;QACzE,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QAExC,OAAO,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEhD,OAAO;QACN,MAAM,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;QAC7B,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;QACf,IAAI,EAAE,YAAY;KAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { Database } from '../../core/database.js';
2
+ import { type ColumnRenameCascadeTarget } from '../../schema/column-republication.js';
3
+ import type { ObjectRefResolvers } from '../../schema/object-ref-resolver.js';
4
+ import type { ResolveColumnInSource } from '../../schema/rename-rewriter.js';
5
+ export type { ColumnRenameCascadeTarget };
6
+ /**
7
+ * Worklist driver for `ALTER TABLE … RENAME COLUMN` propagation. Rewriting a
8
+ * dependent view / materialized-view body can SHIFT THE NAME the object
9
+ * publishes (a bare passthrough projection of the renamed column — or a `*`
10
+ * covering the target — starts publishing the new name), and the objects
11
+ * reading IT then need the same column rename applied with the view as the
12
+ * target. This module owns that fixpoint:
13
+ *
14
+ * queue ← [ renamed table ]
15
+ * while queue: run the ordinary all-schema propagation for the head,
16
+ * then enqueue every view / MV whose published names that round shifted.
17
+ *
18
+ * Each round re-enters the SAME per-schema propagation
19
+ * (`propagateColumnRenameInSchema` / `propagateColumnRenameToMaterializedViews`
20
+ * — threaded in by `propagateColumnRename` in alter-table.ts as the `runRound`
21
+ * callback, to avoid an import cycle), so every dependent kind the first round
22
+ * covers — dependent tables' CHECK / DEFAULT / GENERATED expressions, views,
23
+ * materialized views, assertions — is covered at every depth.
24
+ *
25
+ * The per-round dependent scan ({@link scanShiftedPublishers}) lives in
26
+ * `schema/column-republication.ts`, shared with the DROP COLUMN guards'
27
+ * read-only fixpoint over the same lineage.
28
+ *
29
+ * Views cannot be recursive and a maintained table cannot derive from itself,
30
+ * so the visited set is insurance against a malformed catalog rather than an
31
+ * expected cycle — but without it the loop would be unbounded.
32
+ *
33
+ * NOTE: each round costs a full all-schema propagation plus a full scan of every
34
+ * schema's views and maintained tables, and the pre-flight additionally spine-clones
35
+ * every scanned body per round — so one `RENAME COLUMN` is O(chain depth × catalog
36
+ * size) AST walks. Depth is 1–3 for realistic catalogs and DDL is rare, so this is
37
+ * not worth optimizing now; if a deep republishing chain over a large catalog ever
38
+ * makes RENAME COLUMN slow, narrow each round to the objects that actually name the
39
+ * round's target (an object-dependency index) instead of re-sweeping the catalog.
40
+ */
41
+ /**
42
+ * The live cascade. Breadth-first from the renamed table: run `runRound` (the
43
+ * ordinary all-schema column-rename propagation) for the head, then scan for
44
+ * views / MVs whose published names that round shifted and enqueue them as the
45
+ * next targets. Each round's rewrites land in place before the scan runs, so
46
+ * the scan reads post-rewrite bodies — {@link import('../../schema/rename/column-rename.js').bodyExposesRenamedColumn}'s
47
+ * documented contract.
48
+ *
49
+ * `preStaleMvs` is the statement's pre-notify staleness snapshot: a pre-stale
50
+ * MV's backing columns are NOT renamed (its body may be rewritten, but only
51
+ * REFRESH may reshape the backing — see `applyMaterializedViewRewrite`), so
52
+ * its published names do not shift and its readers must NOT be rewritten.
53
+ *
54
+ * The caller runs `restoreUnaffectedMaterializedViews` once, AFTER the whole
55
+ * cascade — not per round.
56
+ */
57
+ export declare function runColumnRenameCascade(db: Database, seed: ColumnRenameCascadeTarget, oldCol: string, newCol: string, preStaleMvs: ReadonlySet<string>, resolvers: ObjectRefResolvers, resolveColumnInSource: ResolveColumnInSource, runRound: (target: ColumnRenameCascadeTarget) => Promise<void>): Promise<void>;
58
+ /**
59
+ * Read-only pre-flight for the cascade, run BEFORE the statement's first side
60
+ * effect: walks the same fixpoint the live cascade will walk — probing spine
61
+ * clones, mutating nothing — and refuses the statement when any round would
62
+ * leave a view / materialized view publishing TWO columns of the new name
63
+ * (it already publishes `newCol`, and the shifted passthrough would add a
64
+ * second). This mirrors how the base-table verb refuses a rename that
65
+ * collides with an existing column, and it must run pre-mutation: the live
66
+ * cascade rewrites bodies in place with no rollback, so a mid-cascade throw
67
+ * would strand a partial rename (the same reasoning the no-catch NOTE on
68
+ * `reregisterRewrittenAssertion` records).
69
+ *
70
+ * The collision test runs against the PRISTINE body: before the rename the
71
+ * target cannot publish `newCol`, so any `newCol` already published is
72
+ * necessarily a different column (a case-only respelling is the one rename for
73
+ * which that premise fails, and returns below before any scan). A `newCol`
74
+ * publication some EARLIER round created is likewise never a distinct column —
75
+ * it can only have come from an `oldCol` publication — which is why measuring
76
+ * the collision on the pristine body is right rather than merely convenient.
77
+ * The exposure test runs against a throwaway
78
+ * clone with the round's rewrite applied, matching the live driver's
79
+ * post-rewrite contract; the pre-mutation catalog gives the same answers the
80
+ * live rounds see because a round only rewrites references binding ITS OWN
81
+ * target, which no other round's exposure question consults.
82
+ */
83
+ export declare function assertColumnRenameCascadePublishable(db: Database, seed: ColumnRenameCascadeTarget, oldCol: string, newCol: string, resolvers: ObjectRefResolvers, resolveColumnInSource: ResolveColumnInSource): void;
84
+ //# sourceMappingURL=column-rename-cascade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-rename-cascade.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/column-rename-cascade.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAGN,KAAK,yBAAyB,EAC9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,YAAY,EAAE,yBAAyB,EAAE,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,sBAAsB,CAC3C,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,yBAAyB,EAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,SAAS,EAAE,kBAAkB,EAC7B,qBAAqB,EAAE,qBAAqB,EAC5C,QAAQ,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,GAC5D,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oCAAoC,CACnD,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,yBAAyB,EAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,kBAAkB,EAC7B,qBAAqB,EAAE,qBAAqB,GAC1C,IAAI,CAmCN"}
@@ -0,0 +1,134 @@
1
+ import { QuereusError } from '../../common/errors.js';
2
+ import { StatusCode } from '../../common/types.js';
3
+ import { scanShiftedPublishers, visitKeyOf, } from '../../schema/column-republication.js';
4
+ import { objectRefKey } from '../../schema/rename-rewriter.js';
5
+ /**
6
+ * Worklist driver for `ALTER TABLE … RENAME COLUMN` propagation. Rewriting a
7
+ * dependent view / materialized-view body can SHIFT THE NAME the object
8
+ * publishes (a bare passthrough projection of the renamed column — or a `*`
9
+ * covering the target — starts publishing the new name), and the objects
10
+ * reading IT then need the same column rename applied with the view as the
11
+ * target. This module owns that fixpoint:
12
+ *
13
+ * queue ← [ renamed table ]
14
+ * while queue: run the ordinary all-schema propagation for the head,
15
+ * then enqueue every view / MV whose published names that round shifted.
16
+ *
17
+ * Each round re-enters the SAME per-schema propagation
18
+ * (`propagateColumnRenameInSchema` / `propagateColumnRenameToMaterializedViews`
19
+ * — threaded in by `propagateColumnRename` in alter-table.ts as the `runRound`
20
+ * callback, to avoid an import cycle), so every dependent kind the first round
21
+ * covers — dependent tables' CHECK / DEFAULT / GENERATED expressions, views,
22
+ * materialized views, assertions — is covered at every depth.
23
+ *
24
+ * The per-round dependent scan ({@link scanShiftedPublishers}) lives in
25
+ * `schema/column-republication.ts`, shared with the DROP COLUMN guards'
26
+ * read-only fixpoint over the same lineage.
27
+ *
28
+ * Views cannot be recursive and a maintained table cannot derive from itself,
29
+ * so the visited set is insurance against a malformed catalog rather than an
30
+ * expected cycle — but without it the loop would be unbounded.
31
+ *
32
+ * NOTE: each round costs a full all-schema propagation plus a full scan of every
33
+ * schema's views and maintained tables, and the pre-flight additionally spine-clones
34
+ * every scanned body per round — so one `RENAME COLUMN` is O(chain depth × catalog
35
+ * size) AST walks. Depth is 1–3 for realistic catalogs and DDL is rare, so this is
36
+ * not worth optimizing now; if a deep republishing chain over a large catalog ever
37
+ * makes RENAME COLUMN slow, narrow each round to the objects that actually name the
38
+ * round's target (an object-dependency index) instead of re-sweeping the catalog.
39
+ */
40
+ /**
41
+ * The live cascade. Breadth-first from the renamed table: run `runRound` (the
42
+ * ordinary all-schema column-rename propagation) for the head, then scan for
43
+ * views / MVs whose published names that round shifted and enqueue them as the
44
+ * next targets. Each round's rewrites land in place before the scan runs, so
45
+ * the scan reads post-rewrite bodies — {@link import('../../schema/rename/column-rename.js').bodyExposesRenamedColumn}'s
46
+ * documented contract.
47
+ *
48
+ * `preStaleMvs` is the statement's pre-notify staleness snapshot: a pre-stale
49
+ * MV's backing columns are NOT renamed (its body may be rewritten, but only
50
+ * REFRESH may reshape the backing — see `applyMaterializedViewRewrite`), so
51
+ * its published names do not shift and its readers must NOT be rewritten.
52
+ *
53
+ * The caller runs `restoreUnaffectedMaterializedViews` once, AFTER the whole
54
+ * cascade — not per round.
55
+ */
56
+ export async function runColumnRenameCascade(db, seed, oldCol, newCol, preStaleMvs, resolvers, resolveColumnInSource, runRound) {
57
+ const oldColLower = oldCol.toLowerCase();
58
+ const visited = new Set();
59
+ const queue = [seed];
60
+ while (queue.length > 0) {
61
+ const target = queue.shift();
62
+ const key = visitKeyOf(target, oldColLower);
63
+ if (visited.has(key))
64
+ continue;
65
+ visited.add(key);
66
+ await runRound(target);
67
+ scanShiftedPublishers(db, target, oldCol, newCol, resolvers, resolveColumnInSource, {
68
+ probeOnClone: false,
69
+ isMvExcluded: mv => preStaleMvs.has(objectRefKey(mv.schemaName, mv.name)),
70
+ onShifted: dependent => queue.push(dependent),
71
+ });
72
+ }
73
+ }
74
+ /**
75
+ * Read-only pre-flight for the cascade, run BEFORE the statement's first side
76
+ * effect: walks the same fixpoint the live cascade will walk — probing spine
77
+ * clones, mutating nothing — and refuses the statement when any round would
78
+ * leave a view / materialized view publishing TWO columns of the new name
79
+ * (it already publishes `newCol`, and the shifted passthrough would add a
80
+ * second). This mirrors how the base-table verb refuses a rename that
81
+ * collides with an existing column, and it must run pre-mutation: the live
82
+ * cascade rewrites bodies in place with no rollback, so a mid-cascade throw
83
+ * would strand a partial rename (the same reasoning the no-catch NOTE on
84
+ * `reregisterRewrittenAssertion` records).
85
+ *
86
+ * The collision test runs against the PRISTINE body: before the rename the
87
+ * target cannot publish `newCol`, so any `newCol` already published is
88
+ * necessarily a different column (a case-only respelling is the one rename for
89
+ * which that premise fails, and returns below before any scan). A `newCol`
90
+ * publication some EARLIER round created is likewise never a distinct column —
91
+ * it can only have come from an `oldCol` publication — which is why measuring
92
+ * the collision on the pristine body is right rather than merely convenient.
93
+ * The exposure test runs against a throwaway
94
+ * clone with the round's rewrite applied, matching the live driver's
95
+ * post-rewrite contract; the pre-mutation catalog gives the same answers the
96
+ * live rounds see because a round only rewrites references binding ITS OWN
97
+ * target, which no other round's exposure question consults.
98
+ */
99
+ export function assertColumnRenameCascadePublishable(db, seed, oldCol, newCol, resolvers, resolveColumnInSource) {
100
+ const oldColLower = oldCol.toLowerCase();
101
+ // A case-only respelling ('x' → 'X') merges no two name classes: the `newCol` a
102
+ // dependent "already publishes" IS the renamed column itself, not a second one.
103
+ // Skipping keeps the pristine-body collision test's premise — that the target
104
+ // cannot publish `newCol` before the rename — true on every case it runs on.
105
+ if (oldColLower === newCol.toLowerCase())
106
+ return;
107
+ const visited = new Set([visitKeyOf(seed, oldColLower)]);
108
+ const queue = [seed];
109
+ while (queue.length > 0) {
110
+ const target = queue.shift();
111
+ scanShiftedPublishers(db, target, oldCol, newCol, resolvers, resolveColumnInSource, {
112
+ probeOnClone: true,
113
+ // Runs before the statement's first notify, so live staleness equals the
114
+ // snapshot the driver will take.
115
+ isMvExcluded: mv => mv.derivation.stale === true,
116
+ onCollision: (kind, schemaName, name) => {
117
+ const via = target.targetKey === seed.targetKey ? '' : ` (through '${target.tableName}')`;
118
+ throw new QuereusError(`cannot rename column '${seed.tableName}.${oldCol}' to '${newCol}': `
119
+ + `${kind} '${schemaName}.${name}' already publishes a column named '${newCol}' and `
120
+ + `also republishes the renamed column${via}, so following the rename would make it `
121
+ + `publish two '${newCol}' columns. Alias one of the two in the ${kind}'s body, `
122
+ + `or choose a different name.`, StatusCode.ERROR);
123
+ },
124
+ onShifted: dependent => {
125
+ const key = visitKeyOf(dependent, oldColLower);
126
+ if (visited.has(key))
127
+ return;
128
+ visited.add(key);
129
+ queue.push(dependent);
130
+ },
131
+ });
132
+ }
133
+ }
134
+ //# sourceMappingURL=column-rename-cascade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-rename-cascade.js","sourceRoot":"","sources":["../../../../src/runtime/emit/column-rename-cascade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACN,qBAAqB,EACrB,UAAU,GAEV,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAK/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,EAAY,EACZ,IAA+B,EAC/B,MAAc,EACd,MAAc,EACd,WAAgC,EAChC,SAA6B,EAC7B,qBAA4C,EAC5C,QAA8D;IAE9D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,MAAM,KAAK,GAAgC,CAAC,IAAI,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,EAAG,CAAC;QAC9B,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC5C,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAC/B,OAAO,CAAC,G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AAC,KAAK,KAAK,IAAI;YAChD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE;gBACvC,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,MAAM,CAAC,SAAS,IAAI,CAAC;gBAC1F,MAAM,IAAI,YAAY,CACrB,yBAAyB,IAAI,CAAC,SAAS,IAAI,MAAM,SAAS,MAAM,KAAK;sBAClE,GAAG,IAAI,KAAK,UAAU,IAAI,IAAI,uCAAuC,MAAM,QAAQ;sBACnF,sCAAsC,GAAG,0CAA0C;sBACnF,gBAAgB,MAAM,0CAA0C,IAAI,WAAW;sBAC/E,6BAA6B,EAChC,UAAU,CAAC,KAAK,CAChB,CAAC;YACH,CAAC;YACD,SAAS,EAAE,SAAS,CAAC,EAAE;gBACtB,MAAM,GAAG,GAAG,UAAU,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;gBAC/C,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;oBAAE,OAAO;gBAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACjB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACvB,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;AACF,CAAC"}
@@ -2,9 +2,9 @@ import type { Database } from '../../core/database.js';
2
2
  import type { TableSchema } from '../../schema/table.js';
3
3
  /**
4
4
  * The `ALTER TABLE … DROP COLUMN` guards over dependents that `runDropColumn` does not
5
- * otherwise see: the DEFAULT of another column on the table itself, a CHECK constraint on
6
- * the table itself, an assertion whose CHECK body names the column, and a foreign key in
7
- * *another* table pointing **at** the column.
5
+ * otherwise see: a column DEFAULT or `GENERATED ALWAYS AS` body that names the column, a
6
+ * CHECK constraint that names it, an assertion whose CHECK body names it, and a foreign
7
+ * key in *another* table pointing **at** the column.
8
8
  *
9
9
  * Whether a dependent is removed with the column or blocks the drop turns on two
10
10
  * questions: is it defined by a *column set* or by an *expression*, and does it live on
@@ -18,9 +18,10 @@ import type { TableSchema } from '../../schema/table.js';
18
18
  * `WHERE`, and — here — a column DEFAULT, a CHECK expression and an assertion body) are
19
19
  * arbitrary user-authored logic with no narrowed form at all. The only choices are
20
20
  * delete-it-silently and refuse, and the engine **refuses**, `StatusCode.CONSTRAINT`.
21
- * - **Dependents living in another table** — here, a foreign key whose *parent* column is
22
- * the one being dropped — refuse regardless of shape. Removing one would silently
23
- * weaken a constraint on a table the user did not name in the statement.
21
+ * - **Dependents living in another table** — a foreign key whose *parent* column is the
22
+ * one being dropped, and (through a subquery) another table's CHECK / DEFAULT /
23
+ * generated body — refuse regardless of shape. Removing one would silently weaken, or
24
+ * outright break, a constraint on a table the user did not name in the statement.
24
25
  *
25
26
  * Refuse is right for all four guards here because it is what the two expression guards
26
27
  * already inside `runDropColumn` do (so the function gains no second policy), it is
@@ -29,68 +30,76 @@ import type { TableSchema } from '../../schema/table.js';
29
30
  * assertion. Cascading here would make `drop table f` and `alter table f drop column x`
30
31
  * disagree about the same object.
31
32
  *
33
+ * The two expression guards below scan **every table in every schema**, not just the
34
+ * altered one, via `schema/expression-dependents.ts` — a CHECK or DEFAULT may contain a
35
+ * subquery, so another table's expression can legitimately name this column, and
36
+ * `ALTER TABLE … RENAME COLUMN` has always rewritten exactly those. See that module for
37
+ * the shared walk and the seeded/unseeded probe split it turns on. All three guards follow
38
+ * view / materialized-view bodies through the same closure
39
+ * (`schema/object-dependency-closure.ts`), so a CHECK reaching the column only through a
40
+ * view refuses the drop and the refusal names the chain.
41
+ *
32
42
  * Known cost, accepted: an **unnamed** table-level CHECK cannot be dropped
33
43
  * (`DROP CONSTRAINT` resolves by name only), so refusing leaves such a column
34
- * undroppable short of rebuilding the table — again SQLite's position. The refusal
35
- * message quotes the constraint's expression so the user can at least see what is in
36
- * the way.
44
+ * undroppable short of rebuilding the referencing table — again SQLite's position. The
45
+ * refusal message quotes the constraint's expression so the user can at least see what is
46
+ * in the way.
37
47
  *
38
48
  * All four guards must run **before** `requireVtabModule` / `module.alterTable`, so a
39
49
  * refused statement never reaches a persisting module and the table is left untouched
40
50
  * rather than reverted.
41
51
  */
42
52
  /**
43
- * Refuses the drop when the DEFAULT of some OTHER column on `tableSchema` names the column.
44
- *
45
- * A default is evaluated against the row being written, so it names its siblings through
46
- * the row-image qualifier — `b integer default (new.a + 1)`. Dropping `a` leaves that
47
- * default uncompilable and the table unable to accept any new row at all, with an error
48
- * naming a column the user deliberately removed. Refusing keeps the failure attached to
49
- * the statement that caused it.
50
- *
51
- * Decided by {@link columnReferencedInCheckExpression}, the same seeded probe the CHECK
52
- * guard below uses, and for the same two reasons: the seed owns the `new.` / `old.`
53
- * row-image namespace a default is written in, and it is scope-**aware**, so a default
54
- * whose subquery reads a like-named column on another table
55
- * (`default ((select min(v) from u))`) does not false-refuse dropping this table's own `v`.
56
- * Sharing the probe with the rename walk is what makes "the drop refuses exactly the
57
- * references a rename would have rewritten" true — the same equivalence the CHECK guard
58
- * rests on, case folding (`NEW.A`) and the `"new"`-named-table shadowing edge included.
59
- *
60
- * The dropped column's **own** default is skipped: it goes away with the column, so a
61
- * self-naming default (`a integer default (new.a)`) is not something the drop orphans.
62
- *
63
- * The generated-column half of this pair is NOT here — `runDropColumn` already refuses off
64
- * `generatedColumnDependencies`, the resolved column-index map `extractGeneratedColumnDependencies`
65
- * builds. Two mechanisms for one policy, but the existing one predates this guard and its map
66
- * is load-bearing elsewhere (evaluation order), so it stays where it is.
53
+ * Refuses the drop when a column DEFAULT or `GENERATED ALWAYS AS` body — on the altered
54
+ * table or on any other table in any schema — names the column.
55
+ *
56
+ * A default is evaluated against the row being written, so on the altered table it names
57
+ * its siblings through the row-image qualifier — `b integer default (new.a + 1)`.
58
+ * Dropping `a` leaves that default uncompilable and the table unable to accept any new
59
+ * row at all, with an error naming a column the user deliberately removed. On ANOTHER
60
+ * table the same expression reaches this column only through a subquery
61
+ * (`w integer default ((select min(v) from t))`), and the damage is worse: that table
62
+ * becomes unwritable and the error names neither `t`, nor the dropped column, nor the
63
+ * default that broke.
64
+ *
65
+ * "Names" is decided by {@link findColumnExpressionDependent}, which shares its walk with
66
+ * the rename propagation — so the drop refuses exactly the references a rename would have
67
+ * rewritten, case folding (`NEW.A`) and the `"new"`-named-table shadowing edge included,
68
+ * and the two definitions cannot drift. That scope-awareness is load-bearing rather than
69
+ * decorative: a default whose subquery reads a like-named column on another table
70
+ * (`default ((select min(v) from u))`) must NOT false-refuse dropping this table's own `v`.
71
+ *
72
+ * Two expressions on the altered table are deliberately skipped — the dropped column's
73
+ * own default (it goes away with the column) and every own-table generated body
74
+ * (`runDropColumn` already refuses off `generatedColumnDependencies`). See
75
+ * {@link findColumnExpressionDependent} for both.
67
76
  */
68
- export declare function assertNoColumnDefaultNamesColumn(db: Database, tableSchema: TableSchema, columnName: string): void;
77
+ export declare function assertNoColumnExpressionNamesColumn(db: Database, tableSchema: TableSchema, columnName: string): void;
69
78
  /**
70
- * Refuses the drop when one of `tableSchema`'s own CHECK constraints names the column.
71
- *
72
- * "Names" is decided by {@link columnReferencedInCheckExpression} — a real rename to a
73
- * sentinel over a throwaway clone of the body — so the guard refuses exactly the
74
- * references `ALTER TABLE … RENAME COLUMN` would have rewritten, and the two
75
- * definitions cannot drift. That scope-awareness is load-bearing rather than
76
- * decorative: a CHECK may contain a subquery, so a depth-blind name match (what the
77
- * partial-index guard next door can afford, its predicates admitting no subqueries)
78
- * would false-refuse `check ((select min(v) from u) >= 0)` when dropping this table's
79
- * own `v`.
80
- *
81
- * Only the constraints on `tableSchema.checkConstraints` at drop time are probed —
79
+ * Refuses the drop when a CHECK constraint — on the altered table or on any other table
80
+ * in any schema — names the column.
81
+ *
82
+ * Same walk, same equivalence with the rename, as
83
+ * {@link assertNoColumnExpressionNamesColumn}. A CHECK may contain a subquery, so a
84
+ * depth-blind name match (what the partial-index guard next door can afford, its
85
+ * predicates admitting no subqueries) would both false-refuse
86
+ * `check ((select min(v) from u) >= 0)` when dropping this table's own `v` AND miss
87
+ * another table's `check (n < (select max(v) from t))` entirely.
88
+ *
89
+ * Only the constraints on each table's `checkConstraints` at drop time are probed —
82
90
  * the user's declared set. Lens- and FK-synthesized entries are attached to a write
83
- * plan's constraint list, not to the catalog entry this reads.
91
+ * plan's constraint list, not to the catalog entries this reads.
84
92
  *
85
93
  * A CHECK naming the column through the row-image qualifiers — `check (new.a > 0)`,
86
94
  * `check on delete (old.a > 0)` — refuses the drop just like the unqualified spelling:
87
- * the same walk owns that namespace, shadowing edge included, so a CHECK whose subquery
95
+ * the seeded walk owns that namespace, shadowing edge included, so a CHECK whose subquery
88
96
  * reads a real table named `"new"` still does not block dropping this table's own
89
97
  * like-named column.
90
98
  */
91
99
  export declare function assertNoCheckConstraintNamesColumn(db: Database, tableSchema: TableSchema, columnName: string): void;
92
100
  /**
93
- * Refuses the drop when a live assertion's CHECK body names the column.
101
+ * Refuses the drop when a live assertion's CHECK body, or any stored view /
102
+ * materialized-view body that assertion can reach, names the column.
94
103
  *
95
104
  * Blast radius is why this one is worth a guard at all: `AssertionEvaluator`
96
105
  * recompiles **every** live assertion on any commit that touched any table, so a
@@ -102,10 +111,30 @@ export declare function assertNoCheckConstraintNamesColumn(db: Database, tableSc
102
111
  * (unlike a CHECK). A body that names the table but not the column — `select *`
103
112
  * included — is not a reference and does not block the drop.
104
113
  *
105
- * Scope is the altered table's OWN schema, matching `assertNoAssertionDependsOn` and
106
- * `propagateColumnRenameToAssertions`, and carrying the same documented gap: an
107
- * assertion living in schema A that names `B.t` explicitly is not caught. Tracked by
108
- * `bug-rename-not-propagated-across-schemas`.
114
+ * The same probe runs over EVERY body in the assertion's reach, its own included, so
115
+ * `create view v as select id, x from t` plus `create assertion a check (… from v
116
+ * where x < 0)` refuses `alter table t drop column x` — the match is on `v`'s body,
117
+ * not the assertion's.
118
+ *
119
+ * Each body is probed against every COLUMN REPUBLICATION target
120
+ * (`schema/column-republication.ts`), not the base table alone: a view that
121
+ * re-exposes the column by a star (`create view v as select * from t`, `select t.*`,
122
+ * or a materialized view of either) spells the name nowhere, and a reader's
123
+ * `where x < 0` references the column against `v`. Targets are swept OUTER — base
124
+ * table first, bodies inner — so every match the base sweep finds is found at the
125
+ * body it always was and the existing message spellings do not move. The
126
+ * broken-listed arm follows the sweep: an explicit column list over a covering `*`
127
+ * (`create view v(a, b) as select * from t`) breaks the whole view on the drop
128
+ * (the star's arity changes), so an assertion whose reach names such a view at all
129
+ * refuses, with a message saying the view breaks outright. The fixpoint's second
130
+ * catalog snapshot is taken at the same pre-mutation point as
131
+ * `assertionReachesHomeSchemaFirst`'s, so the two answer identically.
132
+ *
133
+ * Scope is EVERY schema, matching `assertNoAssertionDependsOn`: an assertion in
134
+ * `temp` naming `main.t`'s column blocks the drop, while one whose bare `t` resolves
135
+ * to `temp.t` does not. Each body resolves its unqualified names under its own home
136
+ * schema path. The scan itself is {@link assertionReachesHomeSchemaFirst}, shared
137
+ * with the table verb.
109
138
  */
110
139
  export declare function assertNoAssertionNamesColumn(db: Database, tableSchema: TableSchema, columnName: string): void;
111
140
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"drop-column-guards.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-column-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,KAAK,EAAE,WAAW,EAA8B,MAAM,uBAAuB,CAAC;AAKrF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gCAAgC,CAC/C,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,GAChB,IAAI,CAaN;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kCAAkC,CACjD,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,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