@quereus/quereus 4.5.0 → 4.7.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 (818) hide show
  1. package/README.md +5 -4
  2. package/dist/src/common/errors.d.ts +17 -0
  3. package/dist/src/common/errors.d.ts.map +1 -1
  4. package/dist/src/common/errors.js +21 -0
  5. package/dist/src/common/errors.js.map +1 -1
  6. package/dist/src/core/database-assertions.d.ts +4 -3
  7. package/dist/src/core/database-assertions.d.ts.map +1 -1
  8. package/dist/src/core/database-assertions.js +44 -14
  9. package/dist/src/core/database-assertions.js.map +1 -1
  10. package/dist/src/core/database-events.d.ts +161 -1
  11. package/dist/src/core/database-events.d.ts.map +1 -1
  12. package/dist/src/core/database-events.js +307 -5
  13. package/dist/src/core/database-events.js.map +1 -1
  14. package/dist/src/core/database-internal.d.ts +5 -2
  15. package/dist/src/core/database-internal.d.ts.map +1 -1
  16. package/dist/src/core/database-materialized-views-plan-builders.d.ts.map +1 -1
  17. package/dist/src/core/database-materialized-views-plan-builders.js +33 -4
  18. package/dist/src/core/database-materialized-views-plan-builders.js.map +1 -1
  19. package/dist/src/core/database-materialized-views-plans.d.ts +12 -2
  20. package/dist/src/core/database-materialized-views-plans.d.ts.map +1 -1
  21. package/dist/src/core/database-materialized-views.d.ts +46 -0
  22. package/dist/src/core/database-materialized-views.d.ts.map +1 -1
  23. package/dist/src/core/database-materialized-views.js +75 -4
  24. package/dist/src/core/database-materialized-views.js.map +1 -1
  25. package/dist/src/core/database-transaction.d.ts +9 -0
  26. package/dist/src/core/database-transaction.d.ts.map +1 -1
  27. package/dist/src/core/database-transaction.js +9 -0
  28. package/dist/src/core/database-transaction.js.map +1 -1
  29. package/dist/src/core/database.d.ts +16 -2
  30. package/dist/src/core/database.d.ts.map +1 -1
  31. package/dist/src/core/database.js +56 -15
  32. package/dist/src/core/database.js.map +1 -1
  33. package/dist/src/core/derived-row-validator.d.ts.map +1 -1
  34. package/dist/src/core/derived-row-validator.js +7 -1
  35. package/dist/src/core/derived-row-validator.js.map +1 -1
  36. package/dist/src/core/statement.d.ts.map +1 -1
  37. package/dist/src/core/statement.js +15 -5
  38. package/dist/src/core/statement.js.map +1 -1
  39. package/dist/src/emit/ast-stringify.d.ts +18 -2
  40. package/dist/src/emit/ast-stringify.d.ts.map +1 -1
  41. package/dist/src/emit/ast-stringify.js +22 -4
  42. package/dist/src/emit/ast-stringify.js.map +1 -1
  43. package/dist/src/func/builtins/aggregate.js +11 -11
  44. package/dist/src/func/builtins/aggregate.js.map +1 -1
  45. package/dist/src/func/builtins/builtin-window-functions.d.ts.map +1 -1
  46. package/dist/src/func/builtins/builtin-window-functions.js +15 -85
  47. package/dist/src/func/builtins/builtin-window-functions.js.map +1 -1
  48. package/dist/src/func/builtins/conversion.d.ts.map +1 -1
  49. package/dist/src/func/builtins/conversion.js +10 -9
  50. package/dist/src/func/builtins/conversion.js.map +1 -1
  51. package/dist/src/func/builtins/datetime.d.ts.map +1 -1
  52. package/dist/src/func/builtins/datetime.js +28 -10
  53. package/dist/src/func/builtins/datetime.js.map +1 -1
  54. package/dist/src/func/builtins/explain.d.ts.map +1 -1
  55. package/dist/src/func/builtins/explain.js +19 -5
  56. package/dist/src/func/builtins/explain.js.map +1 -1
  57. package/dist/src/func/builtins/json.d.ts.map +1 -1
  58. package/dist/src/func/builtins/json.js +23 -17
  59. package/dist/src/func/builtins/json.js.map +1 -1
  60. package/dist/src/func/builtins/mutation.js +2 -2
  61. package/dist/src/func/builtins/mutation.js.map +1 -1
  62. package/dist/src/func/builtins/return-types.d.ts +327 -0
  63. package/dist/src/func/builtins/return-types.d.ts.map +1 -0
  64. package/dist/src/func/builtins/return-types.js +43 -0
  65. package/dist/src/func/builtins/return-types.js.map +1 -0
  66. package/dist/src/func/builtins/scalar.d.ts.map +1 -1
  67. package/dist/src/func/builtins/scalar.js +150 -79
  68. package/dist/src/func/builtins/scalar.js.map +1 -1
  69. package/dist/src/func/builtins/schema.d.ts.map +1 -1
  70. package/dist/src/func/builtins/schema.js +43 -8
  71. package/dist/src/func/builtins/schema.js.map +1 -1
  72. package/dist/src/func/builtins/string.d.ts.map +1 -1
  73. package/dist/src/func/builtins/string.js +4 -2
  74. package/dist/src/func/builtins/string.js.map +1 -1
  75. package/dist/src/func/builtins/timespan.d.ts +3 -0
  76. package/dist/src/func/builtins/timespan.d.ts.map +1 -1
  77. package/dist/src/func/builtins/timespan.js +15 -11
  78. package/dist/src/func/builtins/timespan.js.map +1 -1
  79. package/dist/src/func/registration.d.ts +35 -1
  80. package/dist/src/func/registration.d.ts.map +1 -1
  81. package/dist/src/func/registration.js +235 -41
  82. package/dist/src/func/registration.js.map +1 -1
  83. package/dist/src/index.d.ts +14 -7
  84. package/dist/src/index.d.ts.map +1 -1
  85. package/dist/src/index.js +15 -6
  86. package/dist/src/index.js.map +1 -1
  87. package/dist/src/parser/ast.d.ts +58 -1
  88. package/dist/src/parser/ast.d.ts.map +1 -1
  89. package/dist/src/parser/parser.d.ts +46 -0
  90. package/dist/src/parser/parser.d.ts.map +1 -1
  91. package/dist/src/parser/parser.js +161 -45
  92. package/dist/src/parser/parser.js.map +1 -1
  93. package/dist/src/parser/utils.d.ts +13 -1
  94. package/dist/src/parser/utils.d.ts.map +1 -1
  95. package/dist/src/parser/utils.js +14 -0
  96. package/dist/src/parser/utils.js.map +1 -1
  97. package/dist/src/planner/analysis/assertion-classifier.d.ts.map +1 -1
  98. package/dist/src/planner/analysis/assertion-classifier.js +7 -2
  99. package/dist/src/planner/analysis/assertion-classifier.js.map +1 -1
  100. package/dist/src/planner/analysis/assertion-hoist-cache.d.ts.map +1 -1
  101. package/dist/src/planner/analysis/assertion-hoist-cache.js +5 -0
  102. package/dist/src/planner/analysis/assertion-hoist-cache.js.map +1 -1
  103. package/dist/src/planner/analysis/change-scope.d.ts +11 -3
  104. package/dist/src/planner/analysis/change-scope.d.ts.map +1 -1
  105. package/dist/src/planner/analysis/change-scope.js +5 -4
  106. package/dist/src/planner/analysis/change-scope.js.map +1 -1
  107. package/dist/src/planner/analysis/check-extraction.d.ts.map +1 -1
  108. package/dist/src/planner/analysis/check-extraction.js +37 -4
  109. package/dist/src/planner/analysis/check-extraction.js.map +1 -1
  110. package/dist/src/planner/analysis/comparison-collation.d.ts +20 -22
  111. package/dist/src/planner/analysis/comparison-collation.d.ts.map +1 -1
  112. package/dist/src/planner/analysis/comparison-collation.js +29 -26
  113. package/dist/src/planner/analysis/comparison-collation.js.map +1 -1
  114. package/dist/src/planner/analysis/constraint-extractor.d.ts +0 -7
  115. package/dist/src/planner/analysis/constraint-extractor.d.ts.map +1 -1
  116. package/dist/src/planner/analysis/constraint-extractor.js +59 -59
  117. package/dist/src/planner/analysis/constraint-extractor.js.map +1 -1
  118. package/dist/src/planner/analysis/coverage-prover.d.ts.map +1 -1
  119. package/dist/src/planner/analysis/coverage-prover.js +13 -5
  120. package/dist/src/planner/analysis/coverage-prover.js.map +1 -1
  121. package/dist/src/planner/analysis/equi-correlation.d.ts +6 -1
  122. package/dist/src/planner/analysis/equi-correlation.d.ts.map +1 -1
  123. package/dist/src/planner/analysis/equi-correlation.js +8 -1
  124. package/dist/src/planner/analysis/equi-correlation.js.map +1 -1
  125. package/dist/src/planner/analysis/predicate-dependencies.d.ts +34 -0
  126. package/dist/src/planner/analysis/predicate-dependencies.d.ts.map +1 -0
  127. package/dist/src/planner/analysis/predicate-dependencies.js +60 -0
  128. package/dist/src/planner/analysis/predicate-dependencies.js.map +1 -0
  129. package/dist/src/planner/analysis/query-rewrite-matcher.d.ts +1 -1
  130. package/dist/src/planner/analysis/query-rewrite-matcher.d.ts.map +1 -1
  131. package/dist/src/planner/analysis/query-rewrite-matcher.js +0 -26
  132. package/dist/src/planner/analysis/query-rewrite-matcher.js.map +1 -1
  133. package/dist/src/planner/building/alter-table.d.ts.map +1 -1
  134. package/dist/src/planner/building/alter-table.js +117 -43
  135. package/dist/src/planner/building/alter-table.js.map +1 -1
  136. package/dist/src/planner/building/coercion.d.ts +21 -45
  137. package/dist/src/planner/building/coercion.d.ts.map +1 -1
  138. package/dist/src/planner/building/coercion.js +42 -91
  139. package/dist/src/planner/building/coercion.js.map +1 -1
  140. package/dist/src/planner/building/constraint-builder.d.ts.map +1 -1
  141. package/dist/src/planner/building/constraint-builder.js +9 -5
  142. package/dist/src/planner/building/constraint-builder.js.map +1 -1
  143. package/dist/src/planner/building/create-assertion.d.ts.map +1 -1
  144. package/dist/src/planner/building/create-assertion.js +72 -1
  145. package/dist/src/planner/building/create-assertion.js.map +1 -1
  146. package/dist/src/planner/building/create-view.d.ts +6 -1
  147. package/dist/src/planner/building/create-view.d.ts.map +1 -1
  148. package/dist/src/planner/building/create-view.js +12 -3
  149. package/dist/src/planner/building/create-view.js.map +1 -1
  150. package/dist/src/planner/building/ddl.d.ts.map +1 -1
  151. package/dist/src/planner/building/ddl.js +6 -2
  152. package/dist/src/planner/building/ddl.js.map +1 -1
  153. package/dist/src/planner/building/delete.d.ts.map +1 -1
  154. package/dist/src/planner/building/delete.js +23 -10
  155. package/dist/src/planner/building/delete.js.map +1 -1
  156. package/dist/src/planner/building/dml-target.d.ts.map +1 -1
  157. package/dist/src/planner/building/dml-target.js +4 -0
  158. package/dist/src/planner/building/dml-target.js.map +1 -1
  159. package/dist/src/planner/building/drop-assertion.d.ts.map +1 -1
  160. package/dist/src/planner/building/drop-assertion.js +3 -1
  161. package/dist/src/planner/building/drop-assertion.js.map +1 -1
  162. package/dist/src/planner/building/expression.d.ts +17 -0
  163. package/dist/src/planner/building/expression.d.ts.map +1 -1
  164. package/dist/src/planner/building/expression.js +28 -17
  165. package/dist/src/planner/building/expression.js.map +1 -1
  166. package/dist/src/planner/building/foreign-key-builder.d.ts.map +1 -1
  167. package/dist/src/planner/building/foreign-key-builder.js +7 -5
  168. package/dist/src/planner/building/foreign-key-builder.js.map +1 -1
  169. package/dist/src/planner/building/function-call.d.ts +35 -0
  170. package/dist/src/planner/building/function-call.d.ts.map +1 -1
  171. package/dist/src/planner/building/function-call.js +60 -42
  172. package/dist/src/planner/building/function-call.js.map +1 -1
  173. package/dist/src/planner/building/insert.d.ts.map +1 -1
  174. package/dist/src/planner/building/insert.js +185 -48
  175. package/dist/src/planner/building/insert.js.map +1 -1
  176. package/dist/src/planner/building/materialized-view.d.ts.map +1 -1
  177. package/dist/src/planner/building/materialized-view.js +3 -1
  178. package/dist/src/planner/building/materialized-view.js.map +1 -1
  179. package/dist/src/planner/building/schema-authored-context.d.ts +69 -0
  180. package/dist/src/planner/building/schema-authored-context.d.ts.map +1 -0
  181. package/dist/src/planner/building/schema-authored-context.js +75 -0
  182. package/dist/src/planner/building/schema-authored-context.js.map +1 -0
  183. package/dist/src/planner/building/schema-resolution.d.ts.map +1 -1
  184. package/dist/src/planner/building/schema-resolution.js +7 -4
  185. package/dist/src/planner/building/schema-resolution.js.map +1 -1
  186. package/dist/src/planner/building/select-aggregates.d.ts +188 -3
  187. package/dist/src/planner/building/select-aggregates.d.ts.map +1 -1
  188. package/dist/src/planner/building/select-aggregates.js +449 -65
  189. package/dist/src/planner/building/select-aggregates.js.map +1 -1
  190. package/dist/src/planner/building/select-compound.js +2 -2
  191. package/dist/src/planner/building/select-compound.js.map +1 -1
  192. package/dist/src/planner/building/select-context.d.ts +98 -0
  193. package/dist/src/planner/building/select-context.d.ts.map +1 -1
  194. package/dist/src/planner/building/select-context.js +120 -37
  195. package/dist/src/planner/building/select-context.js.map +1 -1
  196. package/dist/src/planner/building/select-modifiers.d.ts +10 -3
  197. package/dist/src/planner/building/select-modifiers.d.ts.map +1 -1
  198. package/dist/src/planner/building/select-modifiers.js +29 -8
  199. package/dist/src/planner/building/select-modifiers.js.map +1 -1
  200. package/dist/src/planner/building/select-ordinal.d.ts +64 -19
  201. package/dist/src/planner/building/select-ordinal.d.ts.map +1 -1
  202. package/dist/src/planner/building/select-ordinal.js +79 -30
  203. package/dist/src/planner/building/select-ordinal.js.map +1 -1
  204. package/dist/src/planner/building/select-projections.d.ts +1 -1
  205. package/dist/src/planner/building/select-projections.d.ts.map +1 -1
  206. package/dist/src/planner/building/select-projections.js +18 -11
  207. package/dist/src/planner/building/select-projections.js.map +1 -1
  208. package/dist/src/planner/building/select-window.d.ts +13 -3
  209. package/dist/src/planner/building/select-window.d.ts.map +1 -1
  210. package/dist/src/planner/building/select-window.js +142 -37
  211. package/dist/src/planner/building/select-window.js.map +1 -1
  212. package/dist/src/planner/building/select.d.ts +37 -1
  213. package/dist/src/planner/building/select.d.ts.map +1 -1
  214. package/dist/src/planner/building/select.js +240 -109
  215. package/dist/src/planner/building/select.js.map +1 -1
  216. package/dist/src/planner/building/update.d.ts.map +1 -1
  217. package/dist/src/planner/building/update.js +27 -13
  218. package/dist/src/planner/building/update.js.map +1 -1
  219. package/dist/src/planner/building/view-mutation-builder.d.ts +1 -1
  220. package/dist/src/planner/building/view-mutation-builder.d.ts.map +1 -1
  221. package/dist/src/planner/building/view-mutation-builder.js +102 -8
  222. package/dist/src/planner/building/view-mutation-builder.js.map +1 -1
  223. package/dist/src/planner/building/with.d.ts.map +1 -1
  224. package/dist/src/planner/building/with.js +34 -4
  225. package/dist/src/planner/building/with.js.map +1 -1
  226. package/dist/src/planner/cache/correlation-detector.d.ts +15 -0
  227. package/dist/src/planner/cache/correlation-detector.d.ts.map +1 -1
  228. package/dist/src/planner/cache/correlation-detector.js +26 -0
  229. package/dist/src/planner/cache/correlation-detector.js.map +1 -1
  230. package/dist/src/planner/cache/materialization-advisory.d.ts +7 -0
  231. package/dist/src/planner/cache/materialization-advisory.d.ts.map +1 -1
  232. package/dist/src/planner/cache/materialization-advisory.js +12 -3
  233. package/dist/src/planner/cache/materialization-advisory.js.map +1 -1
  234. package/dist/src/planner/cost/conjunct-cost.d.ts +40 -0
  235. package/dist/src/planner/cost/conjunct-cost.d.ts.map +1 -1
  236. package/dist/src/planner/cost/conjunct-cost.js +45 -0
  237. package/dist/src/planner/cost/conjunct-cost.js.map +1 -1
  238. package/dist/src/planner/cost/index.d.ts +10 -0
  239. package/dist/src/planner/cost/index.d.ts.map +1 -1
  240. package/dist/src/planner/cost/index.js +15 -0
  241. package/dist/src/planner/cost/index.js.map +1 -1
  242. package/dist/src/planner/framework/characteristics.d.ts +9 -0
  243. package/dist/src/planner/framework/characteristics.d.ts.map +1 -1
  244. package/dist/src/planner/framework/characteristics.js.map +1 -1
  245. package/dist/src/planner/framework/pass.d.ts +2 -0
  246. package/dist/src/planner/framework/pass.d.ts.map +1 -1
  247. package/dist/src/planner/framework/pass.js +15 -0
  248. package/dist/src/planner/framework/pass.js.map +1 -1
  249. package/dist/src/planner/mutation/backward-body.d.ts.map +1 -1
  250. package/dist/src/planner/mutation/backward-body.js +4 -1
  251. package/dist/src/planner/mutation/backward-body.js.map +1 -1
  252. package/dist/src/planner/mutation/body-context.d.ts +23 -0
  253. package/dist/src/planner/mutation/body-context.d.ts.map +1 -0
  254. package/dist/src/planner/mutation/body-context.js +26 -0
  255. package/dist/src/planner/mutation/body-context.js.map +1 -0
  256. package/dist/src/planner/mutation/cte-flatten.js +15 -2
  257. package/dist/src/planner/mutation/cte-flatten.js.map +1 -1
  258. package/dist/src/planner/mutation/decomposition.d.ts +8 -0
  259. package/dist/src/planner/mutation/decomposition.d.ts.map +1 -1
  260. package/dist/src/planner/mutation/decomposition.js +8 -3
  261. package/dist/src/planner/mutation/decomposition.js.map +1 -1
  262. package/dist/src/planner/mutation/lens-enforcement.js +1 -1
  263. package/dist/src/planner/mutation/multi-source.d.ts +7 -0
  264. package/dist/src/planner/mutation/multi-source.d.ts.map +1 -1
  265. package/dist/src/planner/mutation/multi-source.js +5 -0
  266. package/dist/src/planner/mutation/multi-source.js.map +1 -1
  267. package/dist/src/planner/mutation/mutation-diagnostic.d.ts +1 -1
  268. package/dist/src/planner/mutation/mutation-diagnostic.d.ts.map +1 -1
  269. package/dist/src/planner/mutation/mutation-diagnostic.js.map +1 -1
  270. package/dist/src/planner/mutation/scope-transform.d.ts +32 -0
  271. package/dist/src/planner/mutation/scope-transform.d.ts.map +1 -1
  272. package/dist/src/planner/mutation/scope-transform.js +181 -33
  273. package/dist/src/planner/mutation/scope-transform.js.map +1 -1
  274. package/dist/src/planner/mutation/set-op.d.ts.map +1 -1
  275. package/dist/src/planner/mutation/set-op.js +66 -16
  276. package/dist/src/planner/mutation/set-op.js.map +1 -1
  277. package/dist/src/planner/mutation/single-source.d.ts.map +1 -1
  278. package/dist/src/planner/mutation/single-source.js +100 -24
  279. package/dist/src/planner/mutation/single-source.js.map +1 -1
  280. package/dist/src/planner/nodes/add-constraint-node.d.ts +15 -1
  281. package/dist/src/planner/nodes/add-constraint-node.d.ts.map +1 -1
  282. package/dist/src/planner/nodes/add-constraint-node.js +10 -1
  283. package/dist/src/planner/nodes/add-constraint-node.js.map +1 -1
  284. package/dist/src/planner/nodes/aggregate-node.d.ts +15 -0
  285. package/dist/src/planner/nodes/aggregate-node.d.ts.map +1 -1
  286. package/dist/src/planner/nodes/aggregate-node.js +32 -17
  287. package/dist/src/planner/nodes/aggregate-node.js.map +1 -1
  288. package/dist/src/planner/nodes/alias-node.d.ts.map +1 -1
  289. package/dist/src/planner/nodes/alias-node.js +2 -1
  290. package/dist/src/planner/nodes/alias-node.js.map +1 -1
  291. package/dist/src/planner/nodes/alter-table-node.d.ts +51 -10
  292. package/dist/src/planner/nodes/alter-table-node.d.ts.map +1 -1
  293. package/dist/src/planner/nodes/alter-table-node.js +49 -2
  294. package/dist/src/planner/nodes/alter-table-node.js.map +1 -1
  295. package/dist/src/planner/nodes/asof-scan-node.d.ts.map +1 -1
  296. package/dist/src/planner/nodes/asof-scan-node.js +4 -1
  297. package/dist/src/planner/nodes/asof-scan-node.js.map +1 -1
  298. package/dist/src/planner/nodes/asserted-keys-node.d.ts.map +1 -1
  299. package/dist/src/planner/nodes/asserted-keys-node.js +2 -1
  300. package/dist/src/planner/nodes/asserted-keys-node.js.map +1 -1
  301. package/dist/src/planner/nodes/bloom-join-node.d.ts.map +1 -1
  302. package/dist/src/planner/nodes/bloom-join-node.js +8 -3
  303. package/dist/src/planner/nodes/bloom-join-node.js.map +1 -1
  304. package/dist/src/planner/nodes/cache-node.d.ts.map +1 -1
  305. package/dist/src/planner/nodes/cache-node.js +2 -1
  306. package/dist/src/planner/nodes/cache-node.js.map +1 -1
  307. package/dist/src/planner/nodes/constraint-check-node.d.ts.map +1 -1
  308. package/dist/src/planner/nodes/constraint-check-node.js +17 -19
  309. package/dist/src/planner/nodes/constraint-check-node.js.map +1 -1
  310. package/dist/src/planner/nodes/create-assertion-node.d.ts +2 -1
  311. package/dist/src/planner/nodes/create-assertion-node.d.ts.map +1 -1
  312. package/dist/src/planner/nodes/create-assertion-node.js +5 -2
  313. package/dist/src/planner/nodes/create-assertion-node.js.map +1 -1
  314. package/dist/src/planner/nodes/cte-node.d.ts +19 -9
  315. package/dist/src/planner/nodes/cte-node.d.ts.map +1 -1
  316. package/dist/src/planner/nodes/cte-node.js +25 -9
  317. package/dist/src/planner/nodes/cte-node.js.map +1 -1
  318. package/dist/src/planner/nodes/delete-node.d.ts +20 -2
  319. package/dist/src/planner/nodes/delete-node.d.ts.map +1 -1
  320. package/dist/src/planner/nodes/delete-node.js +11 -2
  321. package/dist/src/planner/nodes/delete-node.js.map +1 -1
  322. package/dist/src/planner/nodes/distinct-node.d.ts +6 -0
  323. package/dist/src/planner/nodes/distinct-node.d.ts.map +1 -1
  324. package/dist/src/planner/nodes/distinct-node.js +10 -2
  325. package/dist/src/planner/nodes/distinct-node.js.map +1 -1
  326. package/dist/src/planner/nodes/dml-executor-node.d.ts +58 -1
  327. package/dist/src/planner/nodes/dml-executor-node.d.ts.map +1 -1
  328. package/dist/src/planner/nodes/dml-executor-node.js +107 -15
  329. package/dist/src/planner/nodes/dml-executor-node.js.map +1 -1
  330. package/dist/src/planner/nodes/drop-assertion-node.d.ts +2 -1
  331. package/dist/src/planner/nodes/drop-assertion-node.d.ts.map +1 -1
  332. package/dist/src/planner/nodes/drop-assertion-node.js +5 -2
  333. package/dist/src/planner/nodes/drop-assertion-node.js.map +1 -1
  334. package/dist/src/planner/nodes/eager-prefetch-node.d.ts.map +1 -1
  335. package/dist/src/planner/nodes/eager-prefetch-node.js +2 -1
  336. package/dist/src/planner/nodes/eager-prefetch-node.js.map +1 -1
  337. package/dist/src/planner/nodes/fanout-lookup-join-node.d.ts +5 -0
  338. package/dist/src/planner/nodes/fanout-lookup-join-node.d.ts.map +1 -1
  339. package/dist/src/planner/nodes/fanout-lookup-join-node.js +13 -6
  340. package/dist/src/planner/nodes/fanout-lookup-join-node.js.map +1 -1
  341. package/dist/src/planner/nodes/filter.d.ts.map +1 -1
  342. package/dist/src/planner/nodes/filter.js +18 -5
  343. package/dist/src/planner/nodes/filter.js.map +1 -1
  344. package/dist/src/planner/nodes/hash-aggregate.d.ts +1 -0
  345. package/dist/src/planner/nodes/hash-aggregate.d.ts.map +1 -1
  346. package/dist/src/planner/nodes/hash-aggregate.js +21 -16
  347. package/dist/src/planner/nodes/hash-aggregate.js.map +1 -1
  348. package/dist/src/planner/nodes/insert-node.d.ts +19 -2
  349. package/dist/src/planner/nodes/insert-node.d.ts.map +1 -1
  350. package/dist/src/planner/nodes/insert-node.js +10 -2
  351. package/dist/src/planner/nodes/insert-node.js.map +1 -1
  352. package/dist/src/planner/nodes/join-node.d.ts +20 -1
  353. package/dist/src/planner/nodes/join-node.d.ts.map +1 -1
  354. package/dist/src/planner/nodes/join-node.js +30 -9
  355. package/dist/src/planner/nodes/join-node.js.map +1 -1
  356. package/dist/src/planner/nodes/join-utils.d.ts +21 -0
  357. package/dist/src/planner/nodes/join-utils.d.ts.map +1 -1
  358. package/dist/src/planner/nodes/join-utils.js +26 -0
  359. package/dist/src/planner/nodes/join-utils.js.map +1 -1
  360. package/dist/src/planner/nodes/key-set-semi-join-node.d.ts +42 -10
  361. package/dist/src/planner/nodes/key-set-semi-join-node.d.ts.map +1 -1
  362. package/dist/src/planner/nodes/key-set-semi-join-node.js +90 -17
  363. package/dist/src/planner/nodes/key-set-semi-join-node.js.map +1 -1
  364. package/dist/src/planner/nodes/lens-auxiliary-access-node.d.ts +5 -0
  365. package/dist/src/planner/nodes/lens-auxiliary-access-node.d.ts.map +1 -1
  366. package/dist/src/planner/nodes/lens-auxiliary-access-node.js +2 -1
  367. package/dist/src/planner/nodes/lens-auxiliary-access-node.js.map +1 -1
  368. package/dist/src/planner/nodes/limit-offset.d.ts +6 -0
  369. package/dist/src/planner/nodes/limit-offset.d.ts.map +1 -1
  370. package/dist/src/planner/nodes/limit-offset.js +10 -2
  371. package/dist/src/planner/nodes/limit-offset.js.map +1 -1
  372. package/dist/src/planner/nodes/merge-join-node.d.ts.map +1 -1
  373. package/dist/src/planner/nodes/merge-join-node.js +8 -3
  374. package/dist/src/planner/nodes/merge-join-node.js.map +1 -1
  375. package/dist/src/planner/nodes/ordinal-slice-node.d.ts +5 -0
  376. package/dist/src/planner/nodes/ordinal-slice-node.d.ts.map +1 -1
  377. package/dist/src/planner/nodes/ordinal-slice-node.js +9 -2
  378. package/dist/src/planner/nodes/ordinal-slice-node.js.map +1 -1
  379. package/dist/src/planner/nodes/plan-node.d.ts +29 -0
  380. package/dist/src/planner/nodes/plan-node.d.ts.map +1 -1
  381. package/dist/src/planner/nodes/plan-node.js +12 -0
  382. package/dist/src/planner/nodes/plan-node.js.map +1 -1
  383. package/dist/src/planner/nodes/project-node.d.ts.map +1 -1
  384. package/dist/src/planner/nodes/project-node.js +18 -36
  385. package/dist/src/planner/nodes/project-node.js.map +1 -1
  386. package/dist/src/planner/nodes/reference.d.ts.map +1 -1
  387. package/dist/src/planner/nodes/reference.js +3 -2
  388. package/dist/src/planner/nodes/reference.js.map +1 -1
  389. package/dist/src/planner/nodes/retrieve-node.d.ts +16 -2
  390. package/dist/src/planner/nodes/retrieve-node.d.ts.map +1 -1
  391. package/dist/src/planner/nodes/retrieve-node.js +10 -2
  392. package/dist/src/planner/nodes/retrieve-node.js.map +1 -1
  393. package/dist/src/planner/nodes/returning-node.d.ts.map +1 -1
  394. package/dist/src/planner/nodes/returning-node.js +13 -32
  395. package/dist/src/planner/nodes/returning-node.js.map +1 -1
  396. package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
  397. package/dist/src/planner/nodes/scalar.js +5 -18
  398. package/dist/src/planner/nodes/scalar.js.map +1 -1
  399. package/dist/src/planner/nodes/sort.d.ts.map +1 -1
  400. package/dist/src/planner/nodes/sort.js +3 -1
  401. package/dist/src/planner/nodes/sort.js.map +1 -1
  402. package/dist/src/planner/nodes/stream-aggregate.d.ts +1 -0
  403. package/dist/src/planner/nodes/stream-aggregate.d.ts.map +1 -1
  404. package/dist/src/planner/nodes/stream-aggregate.js +22 -20
  405. package/dist/src/planner/nodes/stream-aggregate.js.map +1 -1
  406. package/dist/src/planner/nodes/table-access-nodes.d.ts +89 -1
  407. package/dist/src/planner/nodes/table-access-nodes.d.ts.map +1 -1
  408. package/dist/src/planner/nodes/table-access-nodes.js +69 -2
  409. package/dist/src/planner/nodes/table-access-nodes.js.map +1 -1
  410. package/dist/src/planner/nodes/update-node.d.ts +19 -2
  411. package/dist/src/planner/nodes/update-node.d.ts.map +1 -1
  412. package/dist/src/planner/nodes/update-node.js +10 -2
  413. package/dist/src/planner/nodes/update-node.js.map +1 -1
  414. package/dist/src/planner/nodes/window-function.d.ts.map +1 -1
  415. package/dist/src/planner/nodes/window-function.js +8 -0
  416. package/dist/src/planner/nodes/window-function.js.map +1 -1
  417. package/dist/src/planner/nodes/window-node.d.ts +1 -1
  418. package/dist/src/planner/nodes/window-node.d.ts.map +1 -1
  419. package/dist/src/planner/nodes/window-node.js +3 -1
  420. package/dist/src/planner/nodes/window-node.js.map +1 -1
  421. package/dist/src/planner/optimizer.d.ts +27 -1
  422. package/dist/src/planner/optimizer.d.ts.map +1 -1
  423. package/dist/src/planner/optimizer.js +130 -10
  424. package/dist/src/planner/optimizer.js.map +1 -1
  425. package/dist/src/planner/planning-context.d.ts +24 -0
  426. package/dist/src/planner/planning-context.d.ts.map +1 -1
  427. package/dist/src/planner/planning-context.js.map +1 -1
  428. package/dist/src/planner/rules/access/rule-key-set-seek.d.ts +78 -20
  429. package/dist/src/planner/rules/access/rule-key-set-seek.d.ts.map +1 -1
  430. package/dist/src/planner/rules/access/rule-key-set-seek.js +296 -135
  431. package/dist/src/planner/rules/access/rule-key-set-seek.js.map +1 -1
  432. package/dist/src/planner/rules/access/rule-monotonic-range-access.d.ts.map +1 -1
  433. package/dist/src/planner/rules/access/rule-monotonic-range-access.js +2 -2
  434. package/dist/src/planner/rules/access/rule-monotonic-range-access.js.map +1 -1
  435. package/dist/src/planner/rules/access/rule-select-access-path.d.ts +30 -1
  436. package/dist/src/planner/rules/access/rule-select-access-path.d.ts.map +1 -1
  437. package/dist/src/planner/rules/access/rule-select-access-path.js +70 -5
  438. package/dist/src/planner/rules/access/rule-select-access-path.js.map +1 -1
  439. package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.d.ts +7 -4
  440. package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.d.ts.map +1 -1
  441. package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.js +39 -5
  442. package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.js.map +1 -1
  443. package/dist/src/planner/rules/cache/rule-cte-optimization.d.ts.map +1 -1
  444. package/dist/src/planner/rules/cache/rule-cte-optimization.js +15 -2
  445. package/dist/src/planner/rules/cache/rule-cte-optimization.js.map +1 -1
  446. package/dist/src/planner/rules/cache/rule-materialized-view-rewrite.js +10 -3
  447. package/dist/src/planner/rules/cache/rule-materialized-view-rewrite.js.map +1 -1
  448. package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.d.ts.map +1 -1
  449. package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.js +6 -4
  450. package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.js.map +1 -1
  451. package/dist/src/planner/rules/join/equi-pair-extractor.d.ts +5 -31
  452. package/dist/src/planner/rules/join/equi-pair-extractor.d.ts.map +1 -1
  453. package/dist/src/planner/rules/join/equi-pair-extractor.js +4 -44
  454. package/dist/src/planner/rules/join/equi-pair-extractor.js.map +1 -1
  455. package/dist/src/planner/rules/join/index-nested-loop.d.ts +49 -0
  456. package/dist/src/planner/rules/join/index-nested-loop.d.ts.map +1 -0
  457. package/dist/src/planner/rules/join/index-nested-loop.js +291 -0
  458. package/dist/src/planner/rules/join/index-nested-loop.js.map +1 -0
  459. package/dist/src/planner/rules/join/rule-fanout-batched-outer.js +8 -8
  460. package/dist/src/planner/rules/join/rule-fanout-lookup-join.d.ts +4 -0
  461. package/dist/src/planner/rules/join/rule-fanout-lookup-join.d.ts.map +1 -1
  462. package/dist/src/planner/rules/join/rule-fanout-lookup-join.js +50 -15
  463. package/dist/src/planner/rules/join/rule-fanout-lookup-join.js.map +1 -1
  464. package/dist/src/planner/rules/join/rule-join-elimination.d.ts +6 -0
  465. package/dist/src/planner/rules/join/rule-join-elimination.d.ts.map +1 -1
  466. package/dist/src/planner/rules/join/rule-join-elimination.js +25 -9
  467. package/dist/src/planner/rules/join/rule-join-elimination.js.map +1 -1
  468. package/dist/src/planner/rules/join/rule-join-key-inference.d.ts +7 -0
  469. package/dist/src/planner/rules/join/rule-join-key-inference.d.ts.map +1 -1
  470. package/dist/src/planner/rules/join/rule-join-key-inference.js +23 -11
  471. package/dist/src/planner/rules/join/rule-join-key-inference.js.map +1 -1
  472. package/dist/src/planner/rules/join/rule-join-physical-selection.d.ts +10 -4
  473. package/dist/src/planner/rules/join/rule-join-physical-selection.d.ts.map +1 -1
  474. package/dist/src/planner/rules/join/rule-join-physical-selection.js +115 -29
  475. package/dist/src/planner/rules/join/rule-join-physical-selection.js.map +1 -1
  476. package/dist/src/planner/rules/join/rule-monotonic-merge-join.d.ts +2 -0
  477. package/dist/src/planner/rules/join/rule-monotonic-merge-join.d.ts.map +1 -1
  478. package/dist/src/planner/rules/join/rule-monotonic-merge-join.js +18 -4
  479. package/dist/src/planner/rules/join/rule-monotonic-merge-join.js.map +1 -1
  480. package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.d.ts +2 -2
  481. package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.d.ts.map +1 -1
  482. package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.js +19 -22
  483. package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.js.map +1 -1
  484. package/dist/src/planner/rules/predicate/rule-filter-conjunct-ordering.d.ts +21 -8
  485. package/dist/src/planner/rules/predicate/rule-filter-conjunct-ordering.d.ts.map +1 -1
  486. package/dist/src/planner/rules/predicate/rule-filter-conjunct-ordering.js +70 -14
  487. package/dist/src/planner/rules/predicate/rule-filter-conjunct-ordering.js.map +1 -1
  488. package/dist/src/planner/rules/predicate/rule-filter-selectivity.d.ts +56 -17
  489. package/dist/src/planner/rules/predicate/rule-filter-selectivity.d.ts.map +1 -1
  490. package/dist/src/planner/rules/predicate/rule-filter-selectivity.js +103 -154
  491. package/dist/src/planner/rules/predicate/rule-filter-selectivity.js.map +1 -1
  492. package/dist/src/planner/rules/predicate/rule-join-predicate-pushdown.d.ts +76 -0
  493. package/dist/src/planner/rules/predicate/rule-join-predicate-pushdown.d.ts.map +1 -0
  494. package/dist/src/planner/rules/predicate/rule-join-predicate-pushdown.js +208 -0
  495. package/dist/src/planner/rules/predicate/rule-join-predicate-pushdown.js.map +1 -0
  496. package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.d.ts +14 -11
  497. package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.d.ts.map +1 -1
  498. package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.js +21 -85
  499. package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.js.map +1 -1
  500. package/dist/src/planner/rules/predicate/rule-predicate-pushdown.d.ts +7 -1
  501. package/dist/src/planner/rules/predicate/rule-predicate-pushdown.d.ts.map +1 -1
  502. package/dist/src/planner/rules/predicate/rule-predicate-pushdown.js +18 -22
  503. package/dist/src/planner/rules/predicate/rule-predicate-pushdown.js.map +1 -1
  504. package/dist/src/planner/rules/shared/access-leaf.d.ts +52 -0
  505. package/dist/src/planner/rules/shared/access-leaf.d.ts.map +1 -0
  506. package/dist/src/planner/rules/shared/access-leaf.js +95 -0
  507. package/dist/src/planner/rules/shared/access-leaf.js.map +1 -0
  508. package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.d.ts.map +1 -1
  509. package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.js +17 -7
  510. package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.js.map +1 -1
  511. package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.d.ts +3 -1
  512. package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.d.ts.map +1 -1
  513. package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.js +26 -9
  514. package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.js.map +1 -1
  515. package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.d.ts.map +1 -1
  516. package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.js +69 -11
  517. package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.js.map +1 -1
  518. package/dist/src/planner/rules/window/rule-monotonic-window.d.ts +17 -7
  519. package/dist/src/planner/rules/window/rule-monotonic-window.d.ts.map +1 -1
  520. package/dist/src/planner/rules/window/rule-monotonic-window.js +124 -87
  521. package/dist/src/planner/rules/window/rule-monotonic-window.js.map +1 -1
  522. package/dist/src/planner/scopes/aliased.d.ts.map +1 -1
  523. package/dist/src/planner/scopes/aliased.js +6 -0
  524. package/dist/src/planner/scopes/aliased.js.map +1 -1
  525. package/dist/src/planner/stats/catalog-stats.d.ts +44 -13
  526. package/dist/src/planner/stats/catalog-stats.d.ts.map +1 -1
  527. package/dist/src/planner/stats/catalog-stats.js +137 -61
  528. package/dist/src/planner/stats/catalog-stats.js.map +1 -1
  529. package/dist/src/planner/stats/conjunct-selectivity.d.ts +48 -0
  530. package/dist/src/planner/stats/conjunct-selectivity.d.ts.map +1 -0
  531. package/dist/src/planner/stats/conjunct-selectivity.js +168 -0
  532. package/dist/src/planner/stats/conjunct-selectivity.js.map +1 -0
  533. package/dist/src/planner/stats/index.d.ts +22 -3
  534. package/dist/src/planner/stats/index.d.ts.map +1 -1
  535. package/dist/src/planner/stats/index.js.map +1 -1
  536. package/dist/src/planner/stats/table-cardinality.d.ts +28 -0
  537. package/dist/src/planner/stats/table-cardinality.d.ts.map +1 -0
  538. package/dist/src/planner/stats/table-cardinality.js +29 -0
  539. package/dist/src/planner/stats/table-cardinality.js.map +1 -0
  540. package/dist/src/planner/stored-body-context.d.ts +57 -0
  541. package/dist/src/planner/stored-body-context.d.ts.map +1 -0
  542. package/dist/src/planner/stored-body-context.js +64 -0
  543. package/dist/src/planner/stored-body-context.js.map +1 -0
  544. package/dist/src/planner/util/column-origins.d.ts +29 -8
  545. package/dist/src/planner/util/column-origins.d.ts.map +1 -1
  546. package/dist/src/planner/util/column-origins.js +74 -14
  547. package/dist/src/planner/util/column-origins.js.map +1 -1
  548. package/dist/src/planner/util/fd-utils.d.ts +32 -8
  549. package/dist/src/planner/util/fd-utils.d.ts.map +1 -1
  550. package/dist/src/planner/util/fd-utils.js +46 -9
  551. package/dist/src/planner/util/fd-utils.js.map +1 -1
  552. package/dist/src/planner/util/ind-utils.d.ts +66 -19
  553. package/dist/src/planner/util/ind-utils.d.ts.map +1 -1
  554. package/dist/src/planner/util/ind-utils.js +91 -21
  555. package/dist/src/planner/util/ind-utils.js.map +1 -1
  556. package/dist/src/planner/util/key-utils.d.ts +36 -3
  557. package/dist/src/planner/util/key-utils.d.ts.map +1 -1
  558. package/dist/src/planner/util/key-utils.js +57 -7
  559. package/dist/src/planner/util/key-utils.js.map +1 -1
  560. package/dist/src/planner/util/output-names.d.ts +12 -0
  561. package/dist/src/planner/util/output-names.d.ts.map +1 -0
  562. package/dist/src/planner/util/output-names.js +20 -0
  563. package/dist/src/planner/util/output-names.js.map +1 -0
  564. package/dist/src/planner/util/row-estimates.d.ts +39 -0
  565. package/dist/src/planner/util/row-estimates.d.ts.map +1 -0
  566. package/dist/src/planner/util/row-estimates.js +68 -0
  567. package/dist/src/planner/util/row-estimates.js.map +1 -0
  568. package/dist/src/planner/util/row-population.d.ts +42 -0
  569. package/dist/src/planner/util/row-population.d.ts.map +1 -0
  570. package/dist/src/planner/util/row-population.js +71 -0
  571. package/dist/src/planner/util/row-population.js.map +1 -0
  572. package/dist/src/runtime/deferred-constraint-queue.d.ts.map +1 -1
  573. package/dist/src/runtime/deferred-constraint-queue.js +3 -2
  574. package/dist/src/runtime/deferred-constraint-queue.js.map +1 -1
  575. package/dist/src/runtime/emit/add-constraint.d.ts.map +1 -1
  576. package/dist/src/runtime/emit/add-constraint.js +60 -6
  577. package/dist/src/runtime/emit/add-constraint.js.map +1 -1
  578. package/dist/src/runtime/emit/aggregate.d.ts.map +1 -1
  579. package/dist/src/runtime/emit/aggregate.js +4 -4
  580. package/dist/src/runtime/emit/aggregate.js.map +1 -1
  581. package/dist/src/runtime/emit/alter-schema-event.d.ts +97 -0
  582. package/dist/src/runtime/emit/alter-schema-event.d.ts.map +1 -0
  583. package/dist/src/runtime/emit/alter-schema-event.js +87 -0
  584. package/dist/src/runtime/emit/alter-schema-event.js.map +1 -0
  585. package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
  586. package/dist/src/runtime/emit/alter-table.js +582 -236
  587. package/dist/src/runtime/emit/alter-table.js.map +1 -1
  588. package/dist/src/runtime/emit/analyze.d.ts.map +1 -1
  589. package/dist/src/runtime/emit/analyze.js +50 -7
  590. package/dist/src/runtime/emit/analyze.js.map +1 -1
  591. package/dist/src/runtime/emit/assertion-drop-guard.d.ts +37 -0
  592. package/dist/src/runtime/emit/assertion-drop-guard.d.ts.map +1 -0
  593. package/dist/src/runtime/emit/assertion-drop-guard.js +59 -0
  594. package/dist/src/runtime/emit/assertion-drop-guard.js.map +1 -0
  595. package/dist/src/runtime/emit/assertion-rename-helpers.d.ts +33 -0
  596. package/dist/src/runtime/emit/assertion-rename-helpers.d.ts.map +1 -0
  597. package/dist/src/runtime/emit/assertion-rename-helpers.js +124 -0
  598. package/dist/src/runtime/emit/assertion-rename-helpers.js.map +1 -0
  599. package/dist/src/runtime/emit/cast.d.ts.map +1 -1
  600. package/dist/src/runtime/emit/cast.js +4 -19
  601. package/dist/src/runtime/emit/cast.js.map +1 -1
  602. package/dist/src/runtime/emit/constraint-check.d.ts.map +1 -1
  603. package/dist/src/runtime/emit/constraint-check.js +10 -227
  604. package/dist/src/runtime/emit/constraint-check.js.map +1 -1
  605. package/dist/src/runtime/emit/create-assertion.d.ts.map +1 -1
  606. package/dist/src/runtime/emit/create-assertion.js +31 -14
  607. package/dist/src/runtime/emit/create-assertion.js.map +1 -1
  608. package/dist/src/runtime/emit/cte.d.ts.map +1 -1
  609. package/dist/src/runtime/emit/cte.js +11 -6
  610. package/dist/src/runtime/emit/cte.js.map +1 -1
  611. package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
  612. package/dist/src/runtime/emit/dml-executor.js +233 -28
  613. package/dist/src/runtime/emit/dml-executor.js.map +1 -1
  614. package/dist/src/runtime/emit/drop-assertion.js +8 -8
  615. package/dist/src/runtime/emit/drop-assertion.js.map +1 -1
  616. package/dist/src/runtime/emit/drop-column-guards.d.ts +151 -0
  617. package/dist/src/runtime/emit/drop-column-guards.d.ts.map +1 -0
  618. package/dist/src/runtime/emit/drop-column-guards.js +230 -0
  619. package/dist/src/runtime/emit/drop-column-guards.js.map +1 -0
  620. package/dist/src/runtime/emit/drop-index.d.ts.map +1 -1
  621. package/dist/src/runtime/emit/drop-index.js +4 -3
  622. package/dist/src/runtime/emit/drop-index.js.map +1 -1
  623. package/dist/src/runtime/emit/drop-table.d.ts.map +1 -1
  624. package/dist/src/runtime/emit/drop-table.js +6 -0
  625. package/dist/src/runtime/emit/drop-table.js.map +1 -1
  626. package/dist/src/runtime/emit/drop-view.d.ts.map +1 -1
  627. package/dist/src/runtime/emit/drop-view.js +4 -0
  628. package/dist/src/runtime/emit/drop-view.js.map +1 -1
  629. package/dist/src/runtime/emit/hash-aggregate.d.ts.map +1 -1
  630. package/dist/src/runtime/emit/hash-aggregate.js +2 -2
  631. package/dist/src/runtime/emit/hash-aggregate.js.map +1 -1
  632. package/dist/src/runtime/emit/join.d.ts.map +1 -1
  633. package/dist/src/runtime/emit/join.js +8 -67
  634. package/dist/src/runtime/emit/join.js.map +1 -1
  635. package/dist/src/runtime/emit/key-set-semi-join.d.ts.map +1 -1
  636. package/dist/src/runtime/emit/key-set-semi-join.js +11 -3
  637. package/dist/src/runtime/emit/key-set-semi-join.js.map +1 -1
  638. package/dist/src/runtime/emit/materialized-view-helpers.d.ts +4 -4
  639. package/dist/src/runtime/emit/materialized-view-helpers.d.ts.map +1 -1
  640. package/dist/src/runtime/emit/materialized-view-helpers.js +34 -22
  641. package/dist/src/runtime/emit/materialized-view-helpers.js.map +1 -1
  642. package/dist/src/runtime/emit/materialized-view.d.ts.map +1 -1
  643. package/dist/src/runtime/emit/materialized-view.js +7 -2
  644. package/dist/src/runtime/emit/materialized-view.js.map +1 -1
  645. package/dist/src/runtime/emit/operand-comparator.d.ts +30 -0
  646. package/dist/src/runtime/emit/operand-comparator.d.ts.map +1 -1
  647. package/dist/src/runtime/emit/operand-comparator.js +34 -0
  648. package/dist/src/runtime/emit/operand-comparator.js.map +1 -1
  649. package/dist/src/runtime/emit/recursive-cte.d.ts.map +1 -1
  650. package/dist/src/runtime/emit/recursive-cte.js +4 -5
  651. package/dist/src/runtime/emit/recursive-cte.js.map +1 -1
  652. package/dist/src/runtime/emit/schema-declarative.d.ts.map +1 -1
  653. package/dist/src/runtime/emit/schema-declarative.js +30 -0
  654. package/dist/src/runtime/emit/schema-declarative.js.map +1 -1
  655. package/dist/src/runtime/emit/subquery.d.ts.map +1 -1
  656. package/dist/src/runtime/emit/subquery.js +153 -52
  657. package/dist/src/runtime/emit/subquery.js.map +1 -1
  658. package/dist/src/runtime/emit/update.d.ts.map +1 -1
  659. package/dist/src/runtime/emit/update.js +18 -6
  660. package/dist/src/runtime/emit/update.js.map +1 -1
  661. package/dist/src/runtime/emit/window.js +36 -23
  662. package/dist/src/runtime/emit/window.js.map +1 -1
  663. package/dist/src/runtime/row-constraints.d.ts +85 -0
  664. package/dist/src/runtime/row-constraints.d.ts.map +1 -0
  665. package/dist/src/runtime/row-constraints.js +239 -0
  666. package/dist/src/runtime/row-constraints.js.map +1 -0
  667. package/dist/src/runtime/types.d.ts +8 -11
  668. package/dist/src/runtime/types.d.ts.map +1 -1
  669. package/dist/src/runtime/types.js.map +1 -1
  670. package/dist/src/schema/assertion.d.ts +14 -1
  671. package/dist/src/schema/assertion.d.ts.map +1 -1
  672. package/dist/src/schema/assertion.js +14 -1
  673. package/dist/src/schema/assertion.js.map +1 -1
  674. package/dist/src/schema/catalog-persistability.d.ts +19 -16
  675. package/dist/src/schema/catalog-persistability.d.ts.map +1 -1
  676. package/dist/src/schema/catalog-persistability.js +92 -20
  677. package/dist/src/schema/catalog-persistability.js.map +1 -1
  678. package/dist/src/schema/catalog.d.ts +73 -2
  679. package/dist/src/schema/catalog.d.ts.map +1 -1
  680. package/dist/src/schema/catalog.js +220 -39
  681. package/dist/src/schema/catalog.js.map +1 -1
  682. package/dist/src/schema/column-source-resolver.d.ts +18 -0
  683. package/dist/src/schema/column-source-resolver.d.ts.map +1 -0
  684. package/dist/src/schema/column-source-resolver.js +22 -0
  685. package/dist/src/schema/column-source-resolver.js.map +1 -0
  686. package/dist/src/schema/column.d.ts +26 -3
  687. package/dist/src/schema/column.d.ts.map +1 -1
  688. package/dist/src/schema/column.js.map +1 -1
  689. package/dist/src/schema/constraint-builder.d.ts.map +1 -1
  690. package/dist/src/schema/constraint-builder.js +7 -1
  691. package/dist/src/schema/constraint-builder.js.map +1 -1
  692. package/dist/src/schema/ddl-generator.d.ts.map +1 -1
  693. package/dist/src/schema/ddl-generator.js +27 -6
  694. package/dist/src/schema/ddl-generator.js.map +1 -1
  695. package/dist/src/schema/function.d.ts +32 -1
  696. package/dist/src/schema/function.d.ts.map +1 -1
  697. package/dist/src/schema/function.js +10 -2
  698. package/dist/src/schema/function.js.map +1 -1
  699. package/dist/src/schema/lens-compiler.d.ts.map +1 -1
  700. package/dist/src/schema/lens-compiler.js +203 -51
  701. package/dist/src/schema/lens-compiler.js.map +1 -1
  702. package/dist/src/schema/lens-prover.d.ts +2 -3
  703. package/dist/src/schema/lens-prover.d.ts.map +1 -1
  704. package/dist/src/schema/lens-prover.js +19 -11
  705. package/dist/src/schema/lens-prover.js.map +1 -1
  706. package/dist/src/schema/manager.d.ts +115 -20
  707. package/dist/src/schema/manager.d.ts.map +1 -1
  708. package/dist/src/schema/manager.js +202 -70
  709. package/dist/src/schema/manager.js.map +1 -1
  710. package/dist/src/schema/rename-rewriter.d.ts +142 -0
  711. package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
  712. package/dist/src/schema/rename-rewriter.js +254 -9
  713. package/dist/src/schema/rename-rewriter.js.map +1 -1
  714. package/dist/src/schema/reserved-tags.d.ts +1 -1
  715. package/dist/src/schema/reserved-tags.d.ts.map +1 -1
  716. package/dist/src/schema/reserved-tags.js +4 -3
  717. package/dist/src/schema/reserved-tags.js.map +1 -1
  718. package/dist/src/schema/schema-differ.d.ts +16 -0
  719. package/dist/src/schema/schema-differ.d.ts.map +1 -1
  720. package/dist/src/schema/schema-differ.js +225 -38
  721. package/dist/src/schema/schema-differ.js.map +1 -1
  722. package/dist/src/schema/table.d.ts +149 -1
  723. package/dist/src/schema/table.d.ts.map +1 -1
  724. package/dist/src/schema/table.js +248 -1
  725. package/dist/src/schema/table.js.map +1 -1
  726. package/dist/src/schema/unique-enforcement.d.ts +5 -3
  727. package/dist/src/schema/unique-enforcement.d.ts.map +1 -1
  728. package/dist/src/schema/unique-enforcement.js +5 -3
  729. package/dist/src/schema/unique-enforcement.js.map +1 -1
  730. package/dist/src/schema/view.d.ts +11 -0
  731. package/dist/src/schema/view.d.ts.map +1 -1
  732. package/dist/src/schema/view.js +12 -0
  733. package/dist/src/schema/view.js.map +1 -1
  734. package/dist/src/types/builtin-types.d.ts +54 -0
  735. package/dist/src/types/builtin-types.d.ts.map +1 -1
  736. package/dist/src/types/builtin-types.js +123 -34
  737. package/dist/src/types/builtin-types.js.map +1 -1
  738. package/dist/src/types/cast-semantics.d.ts +42 -0
  739. package/dist/src/types/cast-semantics.d.ts.map +1 -1
  740. package/dist/src/types/cast-semantics.js +64 -0
  741. package/dist/src/types/cast-semantics.js.map +1 -1
  742. package/dist/src/types/comparison-coercion.d.ts +101 -0
  743. package/dist/src/types/comparison-coercion.d.ts.map +1 -0
  744. package/dist/src/types/comparison-coercion.js +162 -0
  745. package/dist/src/types/comparison-coercion.js.map +1 -0
  746. package/dist/src/types/index.d.ts +2 -2
  747. package/dist/src/types/index.d.ts.map +1 -1
  748. package/dist/src/types/index.js +2 -2
  749. package/dist/src/types/index.js.map +1 -1
  750. package/dist/src/types/logical-type.d.ts +7 -0
  751. package/dist/src/types/logical-type.d.ts.map +1 -1
  752. package/dist/src/types/logical-type.js.map +1 -1
  753. package/dist/src/types/validation.d.ts +56 -0
  754. package/dist/src/types/validation.d.ts.map +1 -1
  755. package/dist/src/types/validation.js +68 -0
  756. package/dist/src/types/validation.js.map +1 -1
  757. package/dist/src/util/{working-table-iterable.d.ts → array-row-iterable.d.ts} +6 -6
  758. package/dist/src/util/array-row-iterable.d.ts.map +1 -0
  759. package/dist/src/util/{working-table-iterable.js → array-row-iterable.js} +6 -6
  760. package/dist/src/util/array-row-iterable.js.map +1 -0
  761. package/dist/src/util/coercion.d.ts +8 -0
  762. package/dist/src/util/coercion.d.ts.map +1 -1
  763. package/dist/src/util/coercion.js +8 -0
  764. package/dist/src/util/coercion.js.map +1 -1
  765. package/dist/src/util/comparison.d.ts +16 -3
  766. package/dist/src/util/comparison.d.ts.map +1 -1
  767. package/dist/src/util/comparison.js +21 -5
  768. package/dist/src/util/comparison.js.map +1 -1
  769. package/dist/src/util/key-serializer.d.ts +46 -0
  770. package/dist/src/util/key-serializer.d.ts.map +1 -1
  771. package/dist/src/util/key-serializer.js +47 -0
  772. package/dist/src/util/key-serializer.js.map +1 -1
  773. package/dist/src/util/value-set.d.ts +21 -0
  774. package/dist/src/util/value-set.d.ts.map +1 -0
  775. package/dist/src/util/value-set.js +22 -0
  776. package/dist/src/util/value-set.js.map +1 -0
  777. package/dist/src/vtab/capabilities.d.ts +1 -1
  778. package/dist/src/vtab/events.d.ts +8 -1
  779. package/dist/src/vtab/events.d.ts.map +1 -1
  780. package/dist/src/vtab/events.js.map +1 -1
  781. package/dist/src/vtab/manifest.d.ts +15 -0
  782. package/dist/src/vtab/manifest.d.ts.map +1 -1
  783. package/dist/src/vtab/memory/layer/alter-column.d.ts +147 -0
  784. package/dist/src/vtab/memory/layer/alter-column.d.ts.map +1 -0
  785. package/dist/src/vtab/memory/layer/alter-column.js +214 -0
  786. package/dist/src/vtab/memory/layer/alter-column.js.map +1 -0
  787. package/dist/src/vtab/memory/layer/base.d.ts.map +1 -1
  788. package/dist/src/vtab/memory/layer/base.js +4 -3
  789. package/dist/src/vtab/memory/layer/base.js.map +1 -1
  790. package/dist/src/vtab/memory/layer/interface.d.ts +2 -2
  791. package/dist/src/vtab/memory/layer/interface.d.ts.map +1 -1
  792. package/dist/src/vtab/memory/layer/manager.d.ts +176 -25
  793. package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
  794. package/dist/src/vtab/memory/layer/manager.js +569 -558
  795. package/dist/src/vtab/memory/layer/manager.js.map +1 -1
  796. package/dist/src/vtab/memory/layer/scan-layer.d.ts.map +1 -1
  797. package/dist/src/vtab/memory/layer/scan-layer.js +32 -5
  798. package/dist/src/vtab/memory/layer/scan-layer.js.map +1 -1
  799. package/dist/src/vtab/memory/layer/transaction.d.ts +101 -15
  800. package/dist/src/vtab/memory/layer/transaction.d.ts.map +1 -1
  801. package/dist/src/vtab/memory/layer/transaction.js +133 -45
  802. package/dist/src/vtab/memory/layer/transaction.js.map +1 -1
  803. package/dist/src/vtab/memory/module.d.ts +16 -1
  804. package/dist/src/vtab/memory/module.d.ts.map +1 -1
  805. package/dist/src/vtab/memory/module.js +64 -3
  806. package/dist/src/vtab/memory/module.js.map +1 -1
  807. package/dist/src/vtab/memory/table.d.ts.map +1 -1
  808. package/dist/src/vtab/memory/table.js +11 -6
  809. package/dist/src/vtab/memory/table.js.map +1 -1
  810. package/dist/src/vtab/module.d.ts +77 -23
  811. package/dist/src/vtab/module.d.ts.map +1 -1
  812. package/dist/src/vtab/table.d.ts +9 -2
  813. package/dist/src/vtab/table.d.ts.map +1 -1
  814. package/dist/src/vtab/table.js +1 -1
  815. package/dist/src/vtab/table.js.map +1 -1
  816. package/package.json +3 -3
  817. package/dist/src/util/working-table-iterable.d.ts.map +0 -1
  818. package/dist/src/util/working-table-iterable.js.map +0 -1
@@ -0,0 +1,151 @@
1
+ import type { Database } from '../../core/database.js';
2
+ import type { TableSchema } from '../../schema/table.js';
3
+ /**
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.
8
+ *
9
+ * Whether a dependent is removed with the column or blocks the drop turns on two
10
+ * questions: is it defined by a *column set* or by an *expression*, and does it live on
11
+ * the altered table or somewhere else?
12
+ *
13
+ * - **Structural** dependents **of the altered table** (a UNIQUE over the dropped column,
14
+ * the table's own FK using it as a child column) are defined by a *column set*. Losing
15
+ * a column makes them a different constraint, not a narrower one, so both vtab modules
16
+ * **remove them with the column**.
17
+ * - **Expression** dependents (a generated column's expression, a partial index's
18
+ * `WHERE`, and — here — a column DEFAULT, a CHECK expression and an assertion body) are
19
+ * arbitrary user-authored logic with no narrowed form at all. The only choices are
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.
24
+ *
25
+ * Refuse is right for all four guards here because it is what the two expression guards
26
+ * already inside `runDropColumn` do (so the function gains no second policy), it is
27
+ * SQLite's position for the whole family, and — for the assertion arm —
28
+ * `assertNoAssertionDependsOn` already chose refuse for the *table* verb over the same
29
+ * assertion. Cascading here would make `drop table f` and `alter table f drop column x`
30
+ * disagree about the same object.
31
+ *
32
+ * Known cost, accepted: an **unnamed** table-level CHECK cannot be dropped
33
+ * (`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.
37
+ *
38
+ * All four guards must run **before** `requireVtabModule` / `module.alterTable`, so a
39
+ * refused statement never reaches a persisting module and the table is left untouched
40
+ * rather than reverted.
41
+ */
42
+ /**
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.
67
+ */
68
+ export declare function assertNoColumnDefaultNamesColumn(db: Database, tableSchema: TableSchema, columnName: string): void;
69
+ /**
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 —
82
+ * 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.
84
+ *
85
+ * A CHECK naming the column through the row-image qualifiers — `check (new.a > 0)`,
86
+ * `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
88
+ * reads a real table named `"new"` still does not block dropping this table's own
89
+ * like-named column.
90
+ */
91
+ export declare function assertNoCheckConstraintNamesColumn(db: Database, tableSchema: TableSchema, columnName: string): void;
92
+ /**
93
+ * Refuses the drop when a live assertion's CHECK body names the column.
94
+ *
95
+ * Blast radius is why this one is worth a guard at all: `AssertionEvaluator`
96
+ * recompiles **every** live assertion on any commit that touched any table, so a
97
+ * single body left naming a dropped column makes every write to the whole database
98
+ * fail — including writes to tables that have nothing to do with the altered one.
99
+ *
100
+ * The walk is the unseeded {@link columnReferencedInAst}: an assertion body names its
101
+ * tables explicitly in its own FROM clauses, so there is no implicit binding to seed
102
+ * (unlike a CHECK). A body that names the table but not the column — `select *`
103
+ * included — is not a reference and does not block the drop.
104
+ *
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`.
109
+ */
110
+ export declare function assertNoAssertionNamesColumn(db: Database, tableSchema: TableSchema, columnName: string): void;
111
+ /**
112
+ * Refuses the drop when some foreign key — in any schema, this table's own included —
113
+ * names the column among its **parent** columns.
114
+ *
115
+ * A foreign key stores its parent columns as *names* (`referencedColumnNames`) and
116
+ * re-resolves them against the parent's current shape on every write
117
+ * (`resolveReferencedColumns`, `schema/table.ts`). Dropping a named parent column therefore does not
118
+ * break the altered table at all — it makes the *referencing* table unwritable, with an
119
+ * error naming a column the user deliberately removed somewhere else. Refusing is the
120
+ * only way that failure stays attached to the statement that caused it.
121
+ *
122
+ * The refusal is **not** gated on `pragma foreign_keys`. The pragma decides whether the
123
+ * DML builders emit FK checks, so with it off the breakage is merely latent: the schema
124
+ * is still wrong and turning the pragma on later bricks the child table. The guards
125
+ * already in `runDropColumn` are likewise unconditional.
126
+ *
127
+ * Discovery goes through {@link SchemaManager.getReferencingForeignKeys} — the cached
128
+ * reverse index keyed by referenced `schema.table` that `DROP TABLE`'s parent-side guard
129
+ * already uses — rather than a fresh walk of every foreign key in every schema. Its key
130
+ * is `fk.referencedSchema ?? childTable.schemaName`, and `referencedSchema` is populated
131
+ * at build time from the declaration (`constraint-builder.ts`: `fk.schema ?? childSchemaName`),
132
+ * so the bucket a key lands in is the same parent
133
+ * `planner/building/foreign-key-builder.ts` resolves at enforcement time. That identity is
134
+ * what makes "the guard refuses exactly the drops enforcement would have choked on" true.
135
+ * An unqualified reference binds to the **child's own schema**, not through the session
136
+ * search path — a cross-schema key must qualify its parent (`references main.p(c)`) or it
137
+ * resolves to no parent at all.
138
+ *
139
+ * Two keys are skipped, both deliberately:
140
+ *
141
+ * - One with **no `referencedColumnNames`** (`references Parent` with no column list)
142
+ * falls back to the parent's primary key, which no name resolution can miss and which
143
+ * `runDropColumn` already refuses to drop. Not an oversight — there is no name here for
144
+ * this drop to invalidate.
145
+ * - A **self-referencing key that this same drop removes** — one on the altered table whose
146
+ * *child* columns include the dropped column (`x integer references t(x)`). The module
147
+ * removes the whole key as part of the drop, so nothing is left pointing at the missing
148
+ * name. Refusing there would turn away a legal drop.
149
+ */
150
+ export declare function assertNoForeignKeyReferencesColumn(db: Database, tableSchema: TableSchema, columnName: string): void;
151
+ //# sourceMappingURL=drop-column-guards.d.ts.map
@@ -0,0 +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,WAAW,EACxB,UAAU,EAAE,MAAM,GAChB,IAAI,CAgBN;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAC3C,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,GAChB,IAAI,CAgBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,kCAAkC,CACjD,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,GAChB,IAAI,CAcN"}
@@ -0,0 +1,230 @@
1
+ import { QuereusError } from '../../common/errors.js';
2
+ import { StatusCode } from '../../common/types.js';
3
+ import { expressionToString } from '../../emit/ast-stringify.js';
4
+ import { columnReferencedInAst, columnReferencedInCheckExpression } from '../../schema/rename-rewriter.js';
5
+ import { buildColumnSourceResolver } from '../../schema/column-source-resolver.js';
6
+ /**
7
+ * The `ALTER TABLE … DROP COLUMN` guards over dependents that `runDropColumn` does not
8
+ * otherwise see: the DEFAULT of another column on the table itself, a CHECK constraint on
9
+ * the table itself, an assertion whose CHECK body names the column, and a foreign key in
10
+ * *another* table pointing **at** the column.
11
+ *
12
+ * Whether a dependent is removed with the column or blocks the drop turns on two
13
+ * questions: is it defined by a *column set* or by an *expression*, and does it live on
14
+ * the altered table or somewhere else?
15
+ *
16
+ * - **Structural** dependents **of the altered table** (a UNIQUE over the dropped column,
17
+ * the table's own FK using it as a child column) are defined by a *column set*. Losing
18
+ * a column makes them a different constraint, not a narrower one, so both vtab modules
19
+ * **remove them with the column**.
20
+ * - **Expression** dependents (a generated column's expression, a partial index's
21
+ * `WHERE`, and — here — a column DEFAULT, a CHECK expression and an assertion body) are
22
+ * arbitrary user-authored logic with no narrowed form at all. The only choices are
23
+ * delete-it-silently and refuse, and the engine **refuses**, `StatusCode.CONSTRAINT`.
24
+ * - **Dependents living in another table** — here, a foreign key whose *parent* column is
25
+ * the one being dropped — refuse regardless of shape. Removing one would silently
26
+ * weaken a constraint on a table the user did not name in the statement.
27
+ *
28
+ * Refuse is right for all four guards here because it is what the two expression guards
29
+ * already inside `runDropColumn` do (so the function gains no second policy), it is
30
+ * SQLite's position for the whole family, and — for the assertion arm —
31
+ * `assertNoAssertionDependsOn` already chose refuse for the *table* verb over the same
32
+ * assertion. Cascading here would make `drop table f` and `alter table f drop column x`
33
+ * disagree about the same object.
34
+ *
35
+ * Known cost, accepted: an **unnamed** table-level CHECK cannot be dropped
36
+ * (`DROP CONSTRAINT` resolves by name only), so refusing leaves such a column
37
+ * undroppable short of rebuilding the table — again SQLite's position. The refusal
38
+ * message quotes the constraint's expression so the user can at least see what is in
39
+ * the way.
40
+ *
41
+ * All four guards must run **before** `requireVtabModule` / `module.alterTable`, so a
42
+ * refused statement never reaches a persisting module and the table is left untouched
43
+ * rather than reverted.
44
+ */
45
+ /**
46
+ * Refuses the drop when the DEFAULT of some OTHER column on `tableSchema` names the column.
47
+ *
48
+ * A default is evaluated against the row being written, so it names its siblings through
49
+ * the row-image qualifier — `b integer default (new.a + 1)`. Dropping `a` leaves that
50
+ * default uncompilable and the table unable to accept any new row at all, with an error
51
+ * naming a column the user deliberately removed. Refusing keeps the failure attached to
52
+ * the statement that caused it.
53
+ *
54
+ * Decided by {@link columnReferencedInCheckExpression}, the same seeded probe the CHECK
55
+ * guard below uses, and for the same two reasons: the seed owns the `new.` / `old.`
56
+ * row-image namespace a default is written in, and it is scope-**aware**, so a default
57
+ * whose subquery reads a like-named column on another table
58
+ * (`default ((select min(v) from u))`) does not false-refuse dropping this table's own `v`.
59
+ * Sharing the probe with the rename walk is what makes "the drop refuses exactly the
60
+ * references a rename would have rewritten" true — the same equivalence the CHECK guard
61
+ * rests on, case folding (`NEW.A`) and the `"new"`-named-table shadowing edge included.
62
+ *
63
+ * The dropped column's **own** default is skipped: it goes away with the column, so a
64
+ * self-naming default (`a integer default (new.a)`) is not something the drop orphans.
65
+ *
66
+ * The generated-column half of this pair is NOT here — `runDropColumn` already refuses off
67
+ * `generatedColumnDependencies`, the resolved column-index map `extractGeneratedColumnDependencies`
68
+ * builds. Two mechanisms for one policy, but the existing one predates this guard and its map
69
+ * is load-bearing elsewhere (evaluation order), so it stays where it is.
70
+ */
71
+ export function assertNoColumnDefaultNamesColumn(db, tableSchema, columnName) {
72
+ const lowerColumn = columnName.toLowerCase();
73
+ const resolveColumnInSource = buildColumnSourceResolver(db.schemaManager);
74
+ for (const col of tableSchema.columns) {
75
+ if (col.name.toLowerCase() === lowerColumn)
76
+ continue;
77
+ if (!col.defaultValue)
78
+ continue;
79
+ if (!columnReferencedInCheckExpression(col.defaultValue, tableSchema.name, columnName, tableSchema.schemaName, resolveColumnInSource))
80
+ continue;
81
+ throw new QuereusError(`Cannot drop column '${columnName}' from '${tableSchema.name}': it is referenced by the DEFAULT of column '${col.name}'`, StatusCode.CONSTRAINT);
82
+ }
83
+ }
84
+ /**
85
+ * Refuses the drop when one of `tableSchema`'s own CHECK constraints names the column.
86
+ *
87
+ * "Names" is decided by {@link columnReferencedInCheckExpression} — a real rename to a
88
+ * sentinel over a throwaway clone of the body — so the guard refuses exactly the
89
+ * references `ALTER TABLE … RENAME COLUMN` would have rewritten, and the two
90
+ * definitions cannot drift. That scope-awareness is load-bearing rather than
91
+ * decorative: a CHECK may contain a subquery, so a depth-blind name match (what the
92
+ * partial-index guard next door can afford, its predicates admitting no subqueries)
93
+ * would false-refuse `check ((select min(v) from u) >= 0)` when dropping this table's
94
+ * own `v`.
95
+ *
96
+ * Only the constraints on `tableSchema.checkConstraints` at drop time are probed —
97
+ * the user's declared set. Lens- and FK-synthesized entries are attached to a write
98
+ * plan's constraint list, not to the catalog entry this reads.
99
+ *
100
+ * A CHECK naming the column through the row-image qualifiers — `check (new.a > 0)`,
101
+ * `check on delete (old.a > 0)` — refuses the drop just like the unqualified spelling:
102
+ * the same walk owns that namespace, shadowing edge included, so a CHECK whose subquery
103
+ * reads a real table named `"new"` still does not block dropping this table's own
104
+ * like-named column.
105
+ */
106
+ export function assertNoCheckConstraintNamesColumn(db, tableSchema, columnName) {
107
+ const resolveColumnInSource = buildColumnSourceResolver(db.schemaManager);
108
+ for (const check of tableSchema.checkConstraints ?? []) {
109
+ if (!columnReferencedInCheckExpression(check.expr, tableSchema.name, columnName, tableSchema.schemaName, resolveColumnInSource))
110
+ continue;
111
+ // A table-level unnamed CHECK genuinely carries `name: undefined` — the
112
+ // `_check_<table>` spelling `manager.ts` produces is error text, not stored
113
+ // identity — so there is no name to quote and the expression stands in for one.
114
+ const referencedBy = check.name
115
+ ? `CHECK constraint '${check.name}'`
116
+ : `the CHECK constraint (${expressionToString(check.expr)})`;
117
+ throw new QuereusError(`Cannot drop column '${columnName}' from '${tableSchema.name}': it is referenced by ${referencedBy}`, StatusCode.CONSTRAINT);
118
+ }
119
+ }
120
+ /**
121
+ * Refuses the drop when a live assertion's CHECK body names the column.
122
+ *
123
+ * Blast radius is why this one is worth a guard at all: `AssertionEvaluator`
124
+ * recompiles **every** live assertion on any commit that touched any table, so a
125
+ * single body left naming a dropped column makes every write to the whole database
126
+ * fail — including writes to tables that have nothing to do with the altered one.
127
+ *
128
+ * The walk is the unseeded {@link columnReferencedInAst}: an assertion body names its
129
+ * tables explicitly in its own FROM clauses, so there is no implicit binding to seed
130
+ * (unlike a CHECK). A body that names the table but not the column — `select *`
131
+ * included — is not a reference and does not block the drop.
132
+ *
133
+ * Scope is the altered table's OWN schema, matching `assertNoAssertionDependsOn` and
134
+ * `propagateColumnRenameToAssertions`, and carrying the same documented gap: an
135
+ * assertion living in schema A that names `B.t` explicitly is not caught. Tracked by
136
+ * `bug-rename-not-propagated-across-schemas`.
137
+ */
138
+ export function assertNoAssertionNamesColumn(db, tableSchema, columnName) {
139
+ const schema = db.schemaManager.getSchema(tableSchema.schemaName);
140
+ if (!schema)
141
+ return;
142
+ const resolveColumnInSource = buildColumnSourceResolver(db.schemaManager);
143
+ for (const assertion of schema.getAllAssertions()) {
144
+ // An assertion with no `checkExpression` has no AST to scan and is skipped,
145
+ // exactly as the rename propagation and `assertNoAssertionDependsOn` skip it.
146
+ const check = assertion.checkExpression;
147
+ if (!check)
148
+ continue;
149
+ if (!columnReferencedInAst(check, tableSchema.name, columnName, tableSchema.schemaName, resolveColumnInSource))
150
+ continue;
151
+ throw new QuereusError(`Cannot drop column '${columnName}' from '${tableSchema.name}': it is referenced by assertion '${assertion.name}' — drop or redefine the assertion first`, StatusCode.CONSTRAINT);
152
+ }
153
+ }
154
+ /**
155
+ * Refuses the drop when some foreign key — in any schema, this table's own included —
156
+ * names the column among its **parent** columns.
157
+ *
158
+ * A foreign key stores its parent columns as *names* (`referencedColumnNames`) and
159
+ * re-resolves them against the parent's current shape on every write
160
+ * (`resolveReferencedColumns`, `schema/table.ts`). Dropping a named parent column therefore does not
161
+ * break the altered table at all — it makes the *referencing* table unwritable, with an
162
+ * error naming a column the user deliberately removed somewhere else. Refusing is the
163
+ * only way that failure stays attached to the statement that caused it.
164
+ *
165
+ * The refusal is **not** gated on `pragma foreign_keys`. The pragma decides whether the
166
+ * DML builders emit FK checks, so with it off the breakage is merely latent: the schema
167
+ * is still wrong and turning the pragma on later bricks the child table. The guards
168
+ * already in `runDropColumn` are likewise unconditional.
169
+ *
170
+ * Discovery goes through {@link SchemaManager.getReferencingForeignKeys} — the cached
171
+ * reverse index keyed by referenced `schema.table` that `DROP TABLE`'s parent-side guard
172
+ * already uses — rather than a fresh walk of every foreign key in every schema. Its key
173
+ * is `fk.referencedSchema ?? childTable.schemaName`, and `referencedSchema` is populated
174
+ * at build time from the declaration (`constraint-builder.ts`: `fk.schema ?? childSchemaName`),
175
+ * so the bucket a key lands in is the same parent
176
+ * `planner/building/foreign-key-builder.ts` resolves at enforcement time. That identity is
177
+ * what makes "the guard refuses exactly the drops enforcement would have choked on" true.
178
+ * An unqualified reference binds to the **child's own schema**, not through the session
179
+ * search path — a cross-schema key must qualify its parent (`references main.p(c)`) or it
180
+ * resolves to no parent at all.
181
+ *
182
+ * Two keys are skipped, both deliberately:
183
+ *
184
+ * - One with **no `referencedColumnNames`** (`references Parent` with no column list)
185
+ * falls back to the parent's primary key, which no name resolution can miss and which
186
+ * `runDropColumn` already refuses to drop. Not an oversight — there is no name here for
187
+ * this drop to invalidate.
188
+ * - A **self-referencing key that this same drop removes** — one on the altered table whose
189
+ * *child* columns include the dropped column (`x integer references t(x)`). The module
190
+ * removes the whole key as part of the drop, so nothing is left pointing at the missing
191
+ * name. Refusing there would turn away a legal drop.
192
+ */
193
+ export function assertNoForeignKeyReferencesColumn(db, tableSchema, columnName) {
194
+ const lowerColumn = columnName.toLowerCase();
195
+ const droppedIndex = tableSchema.columnIndexMap.get(lowerColumn);
196
+ for (const { childTable, fk } of db.schemaManager.getReferencingForeignKeys(tableSchema.schemaName, tableSchema.name)) {
197
+ if (!namesParentColumn(fk, lowerColumn))
198
+ continue;
199
+ if (dropRemovesKeyOutright(tableSchema, childTable, fk, droppedIndex))
200
+ continue;
201
+ const fkName = fk.name ?? `_fk_${childTable.name}`;
202
+ throw new QuereusError(`Cannot drop column '${columnName}' from '${tableSchema.name}': it is referenced by foreign key '${fkName}' on table '${childTable.name}'`, StatusCode.CONSTRAINT);
203
+ }
204
+ }
205
+ /**
206
+ * Whether `fk` lists `lowerColumn` (already lowercased) among its declared parent columns.
207
+ * A key with no declared list targets the parent's primary key and matches nothing here —
208
+ * see the second skip in {@link assertNoForeignKeyReferencesColumn}'s doc comment.
209
+ */
210
+ function namesParentColumn(fk, lowerColumn) {
211
+ const refNames = fk.referencedColumnNames;
212
+ if (!refNames || refNames.length === 0)
213
+ return false;
214
+ return refNames.some(name => name.toLowerCase() === lowerColumn);
215
+ }
216
+ /**
217
+ * Whether this drop takes the whole key with it: a **self**-referencing key, on the table
218
+ * being altered, holding the dropped column among its *child* columns. The module removes
219
+ * such a key as part of the drop, so no reference to the missing name survives it.
220
+ */
221
+ function dropRemovesKeyOutright(tableSchema, childTable, fk, droppedIndex) {
222
+ if (droppedIndex === undefined)
223
+ return false;
224
+ if (childTable.name.toLowerCase() !== tableSchema.name.toLowerCase())
225
+ return false;
226
+ if (childTable.schemaName.toLowerCase() !== tableSchema.schemaName.toLowerCase())
227
+ return false;
228
+ return fk.columns.includes(droppedIndex);
229
+ }
230
+ //# sourceMappingURL=drop-column-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-column-guards.js","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-column-gu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AAW,EAAE,KAAK,WAAW,CAAC,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,SAAS,sBAAsB,CAC9B,WAAwB,EACxB,UAAuB,EACvB,EAA8B,EAC9B,YAAgC;IAEhC,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE;QAAE,OAAO,KAAK,CAAC;IACnF,IAAI,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,WAAW,CAAC,UAAU,CAAC,WAAW,EAAE;QAAE,OAAO,KAAK,CAAC;IAC/F,OAAO,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"drop-index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,GAAG,WAAW,CAkCrF"}
1
+ {"version":3,"file":"drop-index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,GAAG,WAAW,CAiCrF"}
@@ -9,9 +9,10 @@ export function emitDropIndex(plan, _ctx) {
9
9
  // If nothing owns the index, skip the gate and let dropIndex handle IF EXISTS /
10
10
  // not-found.
11
11
  if (isDdlPolicyStrict(rctx.db)) {
12
- const schema = rctx.db.schemaManager.getSchema(plan.schemaName);
13
- const lowerIndexName = plan.indexName.toLowerCase();
14
- const owner = schema && Array.from(schema.getAllTables()).find(t => t.indexes?.some(idx => idx.name.toLowerCase() === lowerIndexName));
12
+ // Same resolver, same default scope, as the drop itself — so the policy gate
13
+ // can never fire against a table whose index is not the one dropIndex will
14
+ // resolve (or against no droppable index at all).
15
+ const owner = rctx.db.schemaManager.findIndexOwner(plan.schemaName, plan.indexName)?.table;
15
16
  if (owner) {
16
17
  assertDdlTransactionPolicy(rctx.db, requireVtabModule(owner), owner.vtabModuleName, `DROP INDEX ${plan.indexName}`);
17
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"drop-index.js","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE5F,MAAM,UAAU,aAAa,CAAC,IAAmB,EAAE,IAAqB;IACvE,KAAK,UAAU,GAAG,CAAC,IAAoB;QACtC,gFAAgF;QAChF,+EAA+E;QAC/E,+EAA+E;QAC/E,gFAAgF;QAChF,aAAa;QACb,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAChE,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;YACpD,MAAM,KAAK,GAAG,MAAM,IAAI,KAAK,CAAC,IAAI,CAA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"drop-table.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAM9D,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAiDpF"}
@@ -4,6 +4,7 @@ import { StatusCode } from '../../common/types.js';
4
4
  import { dropMaintainedTable } from './materialized-view.js';
5
5
  import { requireVtabModule } from '../../schema/table.js';
6
6
  import { assertDdlTransactionPolicy } from './ddl-transaction-policy.js';
7
+ import { assertNoAssertionDependsOn } from './assertion-drop-guard.js';
7
8
  export function emitDropTable(plan, ctx) {
8
9
  const schemaManager = ctx.db.schemaManager;
9
10
  const stmt = plan.statementAst; // AST.DropStmt
@@ -21,6 +22,11 @@ export function emitDropTable(plan, ctx) {
21
22
  const target = rctx.db.schemaManager.getTable(targetSchemaName, objectName);
22
23
  if (target) {
23
24
  assertDdlTransactionPolicy(rctx.db, requireVtabModule(target), target.vtabModuleName, `DROP TABLE ${objectName}`);
25
+ // Before the maintained-table branch below, so DROP TABLE on a
26
+ // materialized view is guarded too. Gated on the table existing: an
27
+ // `IF EXISTS` drop of an absent name is a no-op with nothing to protect
28
+ // (and any assertion naming that name is already broken).
29
+ assertNoAssertionDependsOn(rctx.db, targetSchemaName, objectName, 'table');
24
30
  }
25
31
  // Ensure we're in a transaction before DDL (lazy/JIT transaction start)
26
32
  await rctx.db._ensureTransaction();
@@ -1 +1 @@
1
- {"version":3,"file":"drop-table.js","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-table.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAw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AAC,gBAAgB,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEnF,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,gBAAgB,IAAI,UAAU,GAAG,EAAE,CAAC;AAC9F,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"drop-view.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,GAAG,WAAW,CAmEnF"}
1
+ {"version":3,"file":"drop-view.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,GAAG,WAAW,CAuEnF"}
@@ -1,5 +1,6 @@
1
1
  import { QuereusError } from '../../common/errors.js';
2
2
  import { StatusCode } from '../../common/types.js';
3
+ import { assertNoAssertionDependsOn } from './assertion-drop-guard.js';
3
4
  export function emitDropView(plan, _ctx) {
4
5
  async function run(rctx) {
5
6
  // Ensure we're in a transaction before DDL (lazy/JIT transaction start)
@@ -17,6 +18,9 @@ export function emitDropView(plan, _ctx) {
17
18
  // View doesn't exist but IF EXISTS was specified, so this is a no-op
18
19
  return null;
19
20
  }
21
+ // An assertion body may name a view exactly as it names a base table, and
22
+ // dropping it out from under one breaks every write to the database.
23
+ assertNoAssertionDependsOn(rctx.db, plan.schemaName, plan.viewName, 'view');
20
24
  // Remove the view from the schema manager
21
25
  const schema = rctx.db.schemaManager.getSchema(plan.schemaName);
22
26
  if (!schema) {
@@ -1 +1 @@
1
- {"version":3,"file":"drop-view.js","sourceRoot":"","sources":["../../../../src/runtime/emit/drop-view.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAiB,MAAM,uBAAuB,CAAC;AAElE,MAAM,UAAU,YAAY,CAAC,IAAkB,EAAE,IAAqB;IACrE,KAAK,UAAU,GAAG,CAAC,IAAoB;QACtC,wEAAwE;QACxE,MAAM,IAAI,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC;QAEnC,mEAAmE;QACnE,IAAI,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9E,MAAM,IAAI,YAAY,CACrB,IAAI,IAAI,CAAC,QAAQ,uDAAuD,EACxE,UAAU,CAAC,KAAK,CAChB,CAAC;QACH,CAAC;QAED,uBAAuB;QACvB,MAAM,YAAY,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEnF,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,IAAI,YAAY,CACrB,SAAS,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,kBAAkB,EAC3D,UAAU,CAAC,KAAK,CAChB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,EA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;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA0B9D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAqT5F"}
1
+ {"version":3,"file":"hash-aggregate.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/hash-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA2B9D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAkT5F"}
@@ -3,7 +3,7 @@ import { emitPlanNode, emitCallFromPlan } from '../emitters.js';
3
3
  import { isAggregateFunctionSchema } from '../../schema/function.js';
4
4
  import { AggregateFunctionCallNode } from '../../planner/nodes/aggregate-function.js';
5
5
  import { isRelationalNode } from '../../planner/nodes/plan-node.js';
6
- import { BTree } from 'inheritree';
6
+ import { createValueSet } from '../../util/value-set.js';
7
7
  import { logContextPush, logContextPop } from '../utils.js';
8
8
  import { coerceForAggregate } from '../../util/coercion.js';
9
9
  import { quereusError } from '../../common/errors.js';
@@ -67,7 +67,7 @@ export function emitHashAggregate(plan, ctx) {
67
67
  return aggregateSchemas.map(schema => cloneInitialValue(isAggregateFunctionSchema(schema) ? schema.initialValue : undefined));
68
68
  }
69
69
  function createDistinctTrees() {
70
- return aggregateDistinctFlags.map((isDistinct, i) => isDistinct ? new BTree((val) => val, distinctComparators[i]) : null);
70
+ return aggregateDistinctFlags.map((isDistinct, i) => isDistinct ? createValueSet(distinctComparators[i]) : null);
71
71
  }
72
72
  // No GROUP BY case — identical to stream aggregate (single accumulator, no hash map)
73
73
  if (plan.groupBy.length === 0) {
@@ -1 +1 @@
1
-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AAG,EAAE,eAAe,GAAG,WAAW,CAiN9E"}
1
+ {"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/join.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAa9D;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CA2L9E"}