@quereus/quereus 4.11.0 → 4.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. package/dist/src/common/type-inference.d.ts +12 -6
  2. package/dist/src/common/type-inference.d.ts.map +1 -1
  3. package/dist/src/common/type-inference.js +12 -24
  4. package/dist/src/common/type-inference.js.map +1 -1
  5. package/dist/src/core/database-assertions.d.ts.map +1 -1
  6. package/dist/src/core/database-assertions.js +7 -5
  7. package/dist/src/core/database-assertions.js.map +1 -1
  8. package/dist/src/core/database-events.d.ts +4 -3
  9. package/dist/src/core/database-events.d.ts.map +1 -1
  10. package/dist/src/core/database-events.js +4 -3
  11. package/dist/src/core/database-events.js.map +1 -1
  12. package/dist/src/core/database-materialized-views-analysis.d.ts +1 -3
  13. package/dist/src/core/database-materialized-views-analysis.d.ts.map +1 -1
  14. package/dist/src/core/database-materialized-views-analysis.js +1 -11
  15. package/dist/src/core/database-materialized-views-analysis.js.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 +12 -10
  18. package/dist/src/core/database-materialized-views-plan-builders.js.map +1 -1
  19. package/dist/src/core/database.d.ts.map +1 -1
  20. package/dist/src/core/database.js +13 -2
  21. package/dist/src/core/database.js.map +1 -1
  22. package/dist/src/core/derived-row-validator.d.ts.map +1 -1
  23. package/dist/src/core/derived-row-validator.js +14 -2
  24. package/dist/src/core/derived-row-validator.js.map +1 -1
  25. package/dist/src/core/param.d.ts +9 -0
  26. package/dist/src/core/param.d.ts.map +1 -1
  27. package/dist/src/core/param.js +21 -1
  28. package/dist/src/core/param.js.map +1 -1
  29. package/dist/src/core/statement.d.ts.map +1 -1
  30. package/dist/src/core/statement.js +38 -15
  31. package/dist/src/core/statement.js.map +1 -1
  32. package/dist/src/func/builtins/aggregate.d.ts.map +1 -1
  33. package/dist/src/func/builtins/aggregate.js +7 -2
  34. package/dist/src/func/builtins/aggregate.js.map +1 -1
  35. package/dist/src/func/builtins/builtin-window-functions.d.ts.map +1 -1
  36. package/dist/src/func/builtins/builtin-window-functions.js +27 -11
  37. package/dist/src/func/builtins/builtin-window-functions.js.map +1 -1
  38. package/dist/src/func/builtins/datetime.d.ts.map +1 -1
  39. package/dist/src/func/builtins/datetime.js +8 -3
  40. package/dist/src/func/builtins/datetime.js.map +1 -1
  41. package/dist/src/func/builtins/explain.d.ts.map +1 -1
  42. package/dist/src/func/builtins/explain.js +9 -29
  43. package/dist/src/func/builtins/explain.js.map +1 -1
  44. package/dist/src/func/builtins/json-tvf.d.ts.map +1 -1
  45. package/dist/src/func/builtins/json-tvf.js +14 -7
  46. package/dist/src/func/builtins/json-tvf.js.map +1 -1
  47. package/dist/src/func/builtins/return-types.d.ts +29 -0
  48. package/dist/src/func/builtins/return-types.d.ts.map +1 -1
  49. package/dist/src/func/builtins/return-types.js +4 -1
  50. package/dist/src/func/builtins/return-types.js.map +1 -1
  51. package/dist/src/func/builtins/scalar.d.ts.map +1 -1
  52. package/dist/src/func/builtins/scalar.js +22 -67
  53. package/dist/src/func/builtins/scalar.js.map +1 -1
  54. package/dist/src/func/builtins/schema.d.ts.map +1 -1
  55. package/dist/src/func/builtins/schema.js +26 -16
  56. package/dist/src/func/builtins/schema.js.map +1 -1
  57. package/dist/src/index.d.ts +1 -1
  58. package/dist/src/index.d.ts.map +1 -1
  59. package/dist/src/index.js +6 -1
  60. package/dist/src/index.js.map +1 -1
  61. package/dist/src/parser/parser.d.ts.map +1 -1
  62. package/dist/src/parser/parser.js +8 -5
  63. package/dist/src/parser/parser.js.map +1 -1
  64. package/dist/src/parser/visitor.d.ts +16 -0
  65. package/dist/src/parser/visitor.d.ts.map +1 -1
  66. package/dist/src/parser/visitor.js +16 -0
  67. package/dist/src/parser/visitor.js.map +1 -1
  68. package/dist/src/planner/analysis/assertion-plan.d.ts +33 -0
  69. package/dist/src/planner/analysis/assertion-plan.d.ts.map +1 -0
  70. package/dist/src/planner/analysis/assertion-plan.js +39 -0
  71. package/dist/src/planner/analysis/assertion-plan.js.map +1 -0
  72. package/dist/src/planner/analysis/binary-operator-class.d.ts +55 -0
  73. package/dist/src/planner/analysis/binary-operator-class.d.ts.map +1 -0
  74. package/dist/src/planner/analysis/binary-operator-class.js +57 -0
  75. package/dist/src/planner/analysis/binary-operator-class.js.map +1 -0
  76. package/dist/src/planner/analysis/binding-extractor.d.ts +9 -3
  77. package/dist/src/planner/analysis/binding-extractor.d.ts.map +1 -1
  78. package/dist/src/planner/analysis/binding-extractor.js +11 -16
  79. package/dist/src/planner/analysis/binding-extractor.js.map +1 -1
  80. package/dist/src/planner/analysis/change-scope.d.ts.map +1 -1
  81. package/dist/src/planner/analysis/change-scope.js +19 -6
  82. package/dist/src/planner/analysis/change-scope.js.map +1 -1
  83. package/dist/src/planner/analysis/check-extraction.d.ts +1 -7
  84. package/dist/src/planner/analysis/check-extraction.d.ts.map +1 -1
  85. package/dist/src/planner/analysis/check-extraction.js.map +1 -1
  86. package/dist/src/planner/analysis/comparison-collation.d.ts +17 -0
  87. package/dist/src/planner/analysis/comparison-collation.d.ts.map +1 -1
  88. package/dist/src/planner/analysis/comparison-collation.js +17 -5
  89. package/dist/src/planner/analysis/comparison-collation.js.map +1 -1
  90. package/dist/src/planner/analysis/constraint-extractor.d.ts.map +1 -1
  91. package/dist/src/planner/analysis/constraint-extractor.js +18 -18
  92. package/dist/src/planner/analysis/constraint-extractor.js.map +1 -1
  93. package/dist/src/planner/analysis/coverage-prover.d.ts +11 -7
  94. package/dist/src/planner/analysis/coverage-prover.d.ts.map +1 -1
  95. package/dist/src/planner/analysis/coverage-prover.js +11 -7
  96. package/dist/src/planner/analysis/coverage-prover.js.map +1 -1
  97. package/dist/src/planner/analysis/equi-correlation.d.ts +1 -1
  98. package/dist/src/planner/analysis/equi-correlation.js +1 -1
  99. package/dist/src/planner/analysis/expression-fingerprint.d.ts.map +1 -1
  100. package/dist/src/planner/analysis/expression-fingerprint.js +0 -2
  101. package/dist/src/planner/analysis/expression-fingerprint.js.map +1 -1
  102. package/dist/src/planner/analysis/key-filter.d.ts.map +1 -1
  103. package/dist/src/planner/analysis/key-filter.js +2 -3
  104. package/dist/src/planner/analysis/key-filter.js.map +1 -1
  105. package/dist/src/planner/analysis/relation-key.d.ts +104 -0
  106. package/dist/src/planner/analysis/relation-key.d.ts.map +1 -0
  107. package/dist/src/planner/analysis/relation-key.js +121 -0
  108. package/dist/src/planner/analysis/relation-key.js.map +1 -0
  109. package/dist/src/planner/analysis/scalar-param-usage.d.ts.map +1 -1
  110. package/dist/src/planner/analysis/scalar-param-usage.js +12 -4
  111. package/dist/src/planner/analysis/scalar-param-usage.js.map +1 -1
  112. package/dist/src/planner/analysis/set-op-type-merge.d.ts +9 -3
  113. package/dist/src/planner/analysis/set-op-type-merge.d.ts.map +1 -1
  114. package/dist/src/planner/analysis/set-op-type-merge.js +22 -8
  115. package/dist/src/planner/analysis/set-op-type-merge.js.map +1 -1
  116. package/dist/src/planner/building/alter-table.d.ts.map +1 -1
  117. package/dist/src/planner/building/alter-table.js +31 -23
  118. package/dist/src/planner/building/alter-table.js.map +1 -1
  119. package/dist/src/planner/building/analyze.d.ts.map +1 -1
  120. package/dist/src/planner/building/analyze.js +21 -0
  121. package/dist/src/planner/building/analyze.js.map +1 -1
  122. package/dist/src/planner/building/block.d.ts.map +1 -1
  123. package/dist/src/planner/building/block.js +222 -82
  124. package/dist/src/planner/building/block.js.map +1 -1
  125. package/dist/src/planner/building/constraint-builder.d.ts.map +1 -1
  126. package/dist/src/planner/building/constraint-builder.js +5 -3
  127. package/dist/src/planner/building/constraint-builder.js.map +1 -1
  128. package/dist/src/planner/building/delete.js +1 -1
  129. package/dist/src/planner/building/delete.js.map +1 -1
  130. package/dist/src/planner/building/expression.d.ts.map +1 -1
  131. package/dist/src/planner/building/expression.js +11 -3
  132. package/dist/src/planner/building/expression.js.map +1 -1
  133. package/dist/src/planner/building/foreign-key-builder.d.ts +16 -6
  134. package/dist/src/planner/building/foreign-key-builder.d.ts.map +1 -1
  135. package/dist/src/planner/building/foreign-key-builder.js +43 -20
  136. package/dist/src/planner/building/foreign-key-builder.js.map +1 -1
  137. package/dist/src/planner/building/generated-column-scope.d.ts +58 -0
  138. package/dist/src/planner/building/generated-column-scope.d.ts.map +1 -0
  139. package/dist/src/planner/building/generated-column-scope.js +117 -0
  140. package/dist/src/planner/building/generated-column-scope.js.map +1 -0
  141. package/dist/src/planner/building/insert.d.ts.map +1 -1
  142. package/dist/src/planner/building/insert.js +20 -28
  143. package/dist/src/planner/building/insert.js.map +1 -1
  144. package/dist/src/planner/building/select-aggregates.d.ts +73 -132
  145. package/dist/src/planner/building/select-aggregates.d.ts.map +1 -1
  146. package/dist/src/planner/building/select-aggregates.js +405 -81
  147. package/dist/src/planner/building/select-aggregates.js.map +1 -1
  148. package/dist/src/planner/building/select-modifiers.d.ts +37 -8
  149. package/dist/src/planner/building/select-modifiers.d.ts.map +1 -1
  150. package/dist/src/planner/building/select-modifiers.js +8 -9
  151. package/dist/src/planner/building/select-modifiers.js.map +1 -1
  152. package/dist/src/planner/building/select-ordinal.d.ts +6 -0
  153. package/dist/src/planner/building/select-ordinal.d.ts.map +1 -1
  154. package/dist/src/planner/building/select-ordinal.js +1 -1
  155. package/dist/src/planner/building/select-ordinal.js.map +1 -1
  156. package/dist/src/planner/building/select-window.d.ts +2 -2
  157. package/dist/src/planner/building/select-window.d.ts.map +1 -1
  158. package/dist/src/planner/building/select-window.js +82 -101
  159. package/dist/src/planner/building/select-window.js.map +1 -1
  160. package/dist/src/planner/building/select.d.ts.map +1 -1
  161. package/dist/src/planner/building/select.js +78 -33
  162. package/dist/src/planner/building/select.js.map +1 -1
  163. package/dist/src/planner/building/update.d.ts.map +1 -1
  164. package/dist/src/planner/building/update.js +14 -8
  165. package/dist/src/planner/building/update.js.map +1 -1
  166. package/dist/src/planner/building/view-mutation-builder.d.ts.map +1 -1
  167. package/dist/src/planner/building/view-mutation-builder.js +329 -14
  168. package/dist/src/planner/building/view-mutation-builder.js.map +1 -1
  169. package/dist/src/planner/building/with.d.ts +6 -0
  170. package/dist/src/planner/building/with.d.ts.map +1 -1
  171. package/dist/src/planner/building/with.js +52 -3
  172. package/dist/src/planner/building/with.js.map +1 -1
  173. package/dist/src/planner/cache/correlation-detector.d.ts.map +1 -1
  174. package/dist/src/planner/cache/correlation-detector.js +44 -17
  175. package/dist/src/planner/cache/correlation-detector.js.map +1 -1
  176. package/dist/src/planner/framework/physical-utils.d.ts +6 -0
  177. package/dist/src/planner/framework/physical-utils.d.ts.map +1 -1
  178. package/dist/src/planner/framework/physical-utils.js +6 -0
  179. package/dist/src/planner/framework/physical-utils.js.map +1 -1
  180. package/dist/src/planner/mutation/lens-enforcement.d.ts +123 -0
  181. package/dist/src/planner/mutation/lens-enforcement.d.ts.map +1 -1
  182. package/dist/src/planner/mutation/lens-enforcement.js +362 -5
  183. package/dist/src/planner/mutation/lens-enforcement.js.map +1 -1
  184. package/dist/src/planner/mutation/mutation-diagnostic.d.ts +1 -1
  185. package/dist/src/planner/mutation/mutation-diagnostic.d.ts.map +1 -1
  186. package/dist/src/planner/mutation/mutation-diagnostic.js.map +1 -1
  187. package/dist/src/planner/nodes/alter-table-node.d.ts +15 -11
  188. package/dist/src/planner/nodes/alter-table-node.d.ts.map +1 -1
  189. package/dist/src/planner/nodes/alter-table-node.js +5 -0
  190. package/dist/src/planner/nodes/alter-table-node.js.map +1 -1
  191. package/dist/src/planner/nodes/bloom-join-node.d.ts.map +1 -1
  192. package/dist/src/planner/nodes/bloom-join-node.js +7 -0
  193. package/dist/src/planner/nodes/bloom-join-node.js.map +1 -1
  194. package/dist/src/planner/nodes/constraint-check-node.d.ts +16 -0
  195. package/dist/src/planner/nodes/constraint-check-node.d.ts.map +1 -1
  196. package/dist/src/planner/nodes/constraint-check-node.js.map +1 -1
  197. package/dist/src/planner/nodes/plan-node-type.d.ts +1 -1
  198. package/dist/src/planner/nodes/plan-node-type.d.ts.map +1 -1
  199. package/dist/src/planner/nodes/plan-node-type.js +1 -1
  200. package/dist/src/planner/nodes/plan-node-type.js.map +1 -1
  201. package/dist/src/planner/nodes/pragma.d.ts.map +1 -1
  202. package/dist/src/planner/nodes/pragma.js +5 -2
  203. package/dist/src/planner/nodes/pragma.js.map +1 -1
  204. package/dist/src/planner/nodes/reference.d.ts.map +1 -1
  205. package/dist/src/planner/nodes/reference.js +9 -1
  206. package/dist/src/planner/nodes/reference.js.map +1 -1
  207. package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
  208. package/dist/src/planner/nodes/scalar.js +117 -91
  209. package/dist/src/planner/nodes/scalar.js.map +1 -1
  210. package/dist/src/planner/nodes/sequence-node.d.ts +50 -0
  211. package/dist/src/planner/nodes/sequence-node.d.ts.map +1 -0
  212. package/dist/src/planner/nodes/sequence-node.js +96 -0
  213. package/dist/src/planner/nodes/sequence-node.js.map +1 -0
  214. package/dist/src/planner/nodes/values-node.d.ts +8 -0
  215. package/dist/src/planner/nodes/values-node.d.ts.map +1 -1
  216. package/dist/src/planner/nodes/values-node.js +29 -6
  217. package/dist/src/planner/nodes/values-node.js.map +1 -1
  218. package/dist/src/planner/nodes/view-mutation-node.d.ts +43 -1
  219. package/dist/src/planner/nodes/view-mutation-node.d.ts.map +1 -1
  220. package/dist/src/planner/nodes/view-mutation-node.js +27 -6
  221. package/dist/src/planner/nodes/view-mutation-node.js.map +1 -1
  222. package/dist/src/planner/nodes/window-node.d.ts +33 -4
  223. package/dist/src/planner/nodes/window-node.d.ts.map +1 -1
  224. package/dist/src/planner/nodes/window-node.js +80 -36
  225. package/dist/src/planner/nodes/window-node.js.map +1 -1
  226. package/dist/src/planner/planning-context.d.ts +38 -1
  227. package/dist/src/planner/planning-context.d.ts.map +1 -1
  228. package/dist/src/planner/rules/access/rule-key-set-seek.d.ts.map +1 -1
  229. package/dist/src/planner/rules/access/rule-key-set-seek.js +8 -3
  230. package/dist/src/planner/rules/access/rule-key-set-seek.js.map +1 -1
  231. package/dist/src/planner/rules/join/rule-fanout-lookup-join.js +18 -12
  232. package/dist/src/planner/rules/join/rule-fanout-lookup-join.js.map +1 -1
  233. package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js +4 -3
  234. package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js.map +1 -1
  235. package/dist/src/planner/rules/window/rule-monotonic-window.d.ts.map +1 -1
  236. package/dist/src/planner/rules/window/rule-monotonic-window.js +6 -0
  237. package/dist/src/planner/rules/window/rule-monotonic-window.js.map +1 -1
  238. package/dist/src/planner/scopes/param.d.ts.map +1 -1
  239. package/dist/src/planner/scopes/param.js +10 -5
  240. package/dist/src/planner/scopes/param.js.map +1 -1
  241. package/dist/src/planner/util/ind-utils.d.ts +25 -8
  242. package/dist/src/planner/util/ind-utils.d.ts.map +1 -1
  243. package/dist/src/planner/util/ind-utils.js +53 -10
  244. package/dist/src/planner/util/ind-utils.js.map +1 -1
  245. package/dist/src/planner/util/key-utils.d.ts +7 -7
  246. package/dist/src/planner/util/key-utils.js +9 -9
  247. package/dist/src/planner/util/key-utils.js.map +1 -1
  248. package/dist/src/runtime/delta-executor.d.ts.map +1 -1
  249. package/dist/src/runtime/delta-executor.js +7 -2
  250. package/dist/src/runtime/delta-executor.js.map +1 -1
  251. package/dist/src/runtime/emit/add-constraint.d.ts.map +1 -1
  252. package/dist/src/runtime/emit/add-constraint.js +50 -15
  253. package/dist/src/runtime/emit/add-constraint.js.map +1 -1
  254. package/dist/src/runtime/emit/alter-schema-event.d.ts +2 -43
  255. package/dist/src/runtime/emit/alter-schema-event.d.ts.map +1 -1
  256. package/dist/src/runtime/emit/alter-schema-event.js +2 -53
  257. package/dist/src/runtime/emit/alter-schema-event.js.map +1 -1
  258. package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
  259. package/dist/src/runtime/emit/alter-table.js +59 -24
  260. package/dist/src/runtime/emit/alter-table.js.map +1 -1
  261. package/dist/src/runtime/emit/analyze.d.ts.map +1 -1
  262. package/dist/src/runtime/emit/analyze.js +7 -0
  263. package/dist/src/runtime/emit/analyze.js.map +1 -1
  264. package/dist/src/runtime/emit/assertion-rename-helpers.d.ts.map +1 -1
  265. package/dist/src/runtime/emit/assertion-rename-helpers.js +2 -3
  266. package/dist/src/runtime/emit/assertion-rename-helpers.js.map +1 -1
  267. package/dist/src/runtime/emit/binary.d.ts +5 -0
  268. package/dist/src/runtime/emit/binary.d.ts.map +1 -1
  269. package/dist/src/runtime/emit/binary.js +22 -22
  270. package/dist/src/runtime/emit/binary.js.map +1 -1
  271. package/dist/src/runtime/emit/block.d.ts.map +1 -1
  272. package/dist/src/runtime/emit/block.js +9 -3
  273. package/dist/src/runtime/emit/block.js.map +1 -1
  274. package/dist/src/runtime/emit/constraint-check.d.ts.map +1 -1
  275. package/dist/src/runtime/emit/constraint-check.js +5 -6
  276. package/dist/src/runtime/emit/constraint-check.js.map +1 -1
  277. package/dist/src/runtime/emit/create-assertion.d.ts.map +1 -1
  278. package/dist/src/runtime/emit/create-assertion.js +71 -70
  279. package/dist/src/runtime/emit/create-assertion.js.map +1 -1
  280. package/dist/src/runtime/emit/create-index.d.ts.map +1 -1
  281. package/dist/src/runtime/emit/create-index.js +8 -3
  282. package/dist/src/runtime/emit/create-index.js.map +1 -1
  283. package/dist/src/runtime/emit/create-table.d.ts.map +1 -1
  284. package/dist/src/runtime/emit/create-table.js +20 -10
  285. package/dist/src/runtime/emit/create-table.js.map +1 -1
  286. package/dist/src/runtime/emit/create-view.d.ts.map +1 -1
  287. package/dist/src/runtime/emit/create-view.js +51 -44
  288. package/dist/src/runtime/emit/create-view.js.map +1 -1
  289. package/dist/src/runtime/emit/ddl-event-scope.d.ts +71 -0
  290. package/dist/src/runtime/emit/ddl-event-scope.d.ts.map +1 -0
  291. package/dist/src/runtime/emit/ddl-event-scope.js +80 -0
  292. package/dist/src/runtime/emit/ddl-event-scope.js.map +1 -0
  293. package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
  294. package/dist/src/runtime/emit/dml-executor.js +23 -23
  295. package/dist/src/runtime/emit/dml-executor.js.map +1 -1
  296. package/dist/src/runtime/emit/drop-assertion.d.ts.map +1 -1
  297. package/dist/src/runtime/emit/drop-assertion.js +23 -17
  298. package/dist/src/runtime/emit/drop-assertion.js.map +1 -1
  299. package/dist/src/runtime/emit/drop-index.d.ts.map +1 -1
  300. package/dist/src/runtime/emit/drop-index.js +7 -2
  301. package/dist/src/runtime/emit/drop-index.js.map +1 -1
  302. package/dist/src/runtime/emit/drop-table.d.ts.map +1 -1
  303. package/dist/src/runtime/emit/drop-table.js +16 -10
  304. package/dist/src/runtime/emit/drop-table.js.map +1 -1
  305. package/dist/src/runtime/emit/drop-view.d.ts.map +1 -1
  306. package/dist/src/runtime/emit/drop-view.js +50 -43
  307. package/dist/src/runtime/emit/drop-view.js.map +1 -1
  308. package/dist/src/runtime/emit/insert.d.ts.map +1 -1
  309. package/dist/src/runtime/emit/insert.js +2 -1
  310. package/dist/src/runtime/emit/insert.js.map +1 -1
  311. package/dist/src/runtime/emit/materialized-view.d.ts.map +1 -1
  312. package/dist/src/runtime/emit/materialized-view.js +87 -67
  313. package/dist/src/runtime/emit/materialized-view.js.map +1 -1
  314. package/dist/src/runtime/emit/schema-declarative.d.ts +8 -0
  315. package/dist/src/runtime/emit/schema-declarative.d.ts.map +1 -1
  316. package/dist/src/runtime/emit/schema-declarative.js +128 -25
  317. package/dist/src/runtime/emit/schema-declarative.js.map +1 -1
  318. package/dist/src/runtime/emit/sequence.d.ts +17 -0
  319. package/dist/src/runtime/emit/sequence.d.ts.map +1 -0
  320. package/dist/src/runtime/emit/sequence.js +40 -0
  321. package/dist/src/runtime/emit/sequence.js.map +1 -0
  322. package/dist/src/runtime/emit/set-object-tags.d.ts.map +1 -1
  323. package/dist/src/runtime/emit/set-object-tags.js +40 -32
  324. package/dist/src/runtime/emit/set-object-tags.js.map +1 -1
  325. package/dist/src/runtime/emit/table-valued-function.d.ts.map +1 -1
  326. package/dist/src/runtime/emit/table-valued-function.js +3 -2
  327. package/dist/src/runtime/emit/table-valued-function.js.map +1 -1
  328. package/dist/src/runtime/emit/update.js +3 -3
  329. package/dist/src/runtime/emit/update.js.map +1 -1
  330. package/dist/src/runtime/emit/view-mutation.d.ts.map +1 -1
  331. package/dist/src/runtime/emit/view-mutation.js +45 -3
  332. package/dist/src/runtime/emit/view-mutation.js.map +1 -1
  333. package/dist/src/runtime/foreign-key-actions.d.ts.map +1 -1
  334. package/dist/src/runtime/foreign-key-actions.js +9 -10
  335. package/dist/src/runtime/foreign-key-actions.js.map +1 -1
  336. package/dist/src/runtime/register.d.ts.map +1 -1
  337. package/dist/src/runtime/register.js +3 -2
  338. package/dist/src/runtime/register.js.map +1 -1
  339. package/dist/src/runtime/row-constraints.d.ts +14 -8
  340. package/dist/src/runtime/row-constraints.d.ts.map +1 -1
  341. package/dist/src/runtime/row-constraints.js +41 -15
  342. package/dist/src/runtime/row-constraints.js.map +1 -1
  343. package/dist/src/runtime/strict-representation.d.ts +11 -6
  344. package/dist/src/runtime/strict-representation.d.ts.map +1 -1
  345. package/dist/src/runtime/strict-representation.js +1 -44
  346. package/dist/src/runtime/strict-representation.js.map +1 -1
  347. package/dist/src/schema/assertion.d.ts +25 -2
  348. package/dist/src/schema/assertion.d.ts.map +1 -1
  349. package/dist/src/schema/assertion.js.map +1 -1
  350. package/dist/src/schema/catalog-rendering.d.ts +38 -0
  351. package/dist/src/schema/catalog-rendering.d.ts.map +1 -0
  352. package/dist/src/schema/catalog-rendering.js +171 -0
  353. package/dist/src/schema/catalog-rendering.js.map +1 -0
  354. package/dist/src/schema/catalog.d.ts +69 -3
  355. package/dist/src/schema/catalog.d.ts.map +1 -1
  356. package/dist/src/schema/catalog.js +124 -19
  357. package/dist/src/schema/catalog.js.map +1 -1
  358. package/dist/src/schema/column-source-resolver.d.ts +9 -5
  359. package/dist/src/schema/column-source-resolver.d.ts.map +1 -1
  360. package/dist/src/schema/column-source-resolver.js +9 -5
  361. package/dist/src/schema/column-source-resolver.js.map +1 -1
  362. package/dist/src/schema/constraint-builder.d.ts +13 -10
  363. package/dist/src/schema/constraint-builder.d.ts.map +1 -1
  364. package/dist/src/schema/constraint-builder.js +45 -17
  365. package/dist/src/schema/constraint-builder.js.map +1 -1
  366. package/dist/src/schema/declared-schema-manager.d.ts +50 -0
  367. package/dist/src/schema/declared-schema-manager.d.ts.map +1 -1
  368. package/dist/src/schema/declared-schema-manager.js +52 -0
  369. package/dist/src/schema/declared-schema-manager.js.map +1 -1
  370. package/dist/src/schema/expr-scope/frame.d.ts +65 -0
  371. package/dist/src/schema/expr-scope/frame.d.ts.map +1 -0
  372. package/dist/src/schema/expr-scope/frame.js +104 -0
  373. package/dist/src/schema/expr-scope/frame.js.map +1 -0
  374. package/dist/src/schema/expr-scope/walk.d.ts +40 -0
  375. package/dist/src/schema/expr-scope/walk.d.ts.map +1 -0
  376. package/dist/src/schema/expr-scope/walk.js +260 -0
  377. package/dist/src/schema/expr-scope/walk.js.map +1 -0
  378. package/dist/src/schema/generated-column-refs.d.ts +41 -0
  379. package/dist/src/schema/generated-column-refs.d.ts.map +1 -0
  380. package/dist/src/schema/generated-column-refs.js +124 -0
  381. package/dist/src/schema/generated-column-refs.js.map +1 -0
  382. package/dist/src/schema/lens-ack.d.ts.map +1 -1
  383. package/dist/src/schema/lens-ack.js +5 -2
  384. package/dist/src/schema/lens-ack.js.map +1 -1
  385. package/dist/src/schema/lens-compiler.d.ts.map +1 -1
  386. package/dist/src/schema/lens-compiler.js +9 -1
  387. package/dist/src/schema/lens-compiler.js.map +1 -1
  388. package/dist/src/schema/lens-prover.d.ts +7 -2
  389. package/dist/src/schema/lens-prover.d.ts.map +1 -1
  390. package/dist/src/schema/lens-prover.js +105 -11
  391. package/dist/src/schema/lens-prover.js.map +1 -1
  392. package/dist/src/schema/lens.d.ts +12 -0
  393. package/dist/src/schema/lens.d.ts.map +1 -1
  394. package/dist/src/schema/lens.js +10 -0
  395. package/dist/src/schema/lens.js.map +1 -1
  396. package/dist/src/schema/manager.d.ts +35 -1
  397. package/dist/src/schema/manager.d.ts.map +1 -1
  398. package/dist/src/schema/manager.js +125 -26
  399. package/dist/src/schema/manager.js.map +1 -1
  400. package/dist/src/schema/rename/self-qualifier-strip.d.ts +16 -10
  401. package/dist/src/schema/rename/self-qualifier-strip.d.ts.map +1 -1
  402. package/dist/src/schema/rename/self-qualifier-strip.js +30 -213
  403. package/dist/src/schema/rename/self-qualifier-strip.js.map +1 -1
  404. package/dist/src/schema/rename-rewriter.d.ts +4 -3
  405. package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
  406. package/dist/src/schema/rename-rewriter.js +4 -3
  407. package/dist/src/schema/rename-rewriter.js.map +1 -1
  408. package/dist/src/schema/schema-differ.d.ts +54 -6
  409. package/dist/src/schema/schema-differ.d.ts.map +1 -1
  410. package/dist/src/schema/schema-differ.js +108 -42
  411. package/dist/src/schema/schema-differ.js.map +1 -1
  412. package/dist/src/schema/schema-hasher.d.ts +12 -0
  413. package/dist/src/schema/schema-hasher.d.ts.map +1 -1
  414. package/dist/src/schema/schema-hasher.js +28 -10
  415. package/dist/src/schema/schema-hasher.js.map +1 -1
  416. package/dist/src/schema/table.d.ts +74 -19
  417. package/dist/src/schema/table.d.ts.map +1 -1
  418. package/dist/src/schema/table.js +133 -71
  419. package/dist/src/schema/table.js.map +1 -1
  420. package/dist/src/types/comparison-coercion.d.ts +5 -1
  421. package/dist/src/types/comparison-coercion.d.ts.map +1 -1
  422. package/dist/src/types/comparison-coercion.js +21 -5
  423. package/dist/src/types/comparison-coercion.js.map +1 -1
  424. package/dist/src/types/representation.d.ts +65 -0
  425. package/dist/src/types/representation.d.ts.map +1 -0
  426. package/dist/src/types/representation.js +63 -0
  427. package/dist/src/types/representation.js.map +1 -0
  428. package/dist/src/types/validation.d.ts +76 -22
  429. package/dist/src/types/validation.d.ts.map +1 -1
  430. package/dist/src/types/validation.js +110 -31
  431. package/dist/src/types/validation.js.map +1 -1
  432. package/dist/src/vtab/best-access-plan.d.ts +10 -0
  433. package/dist/src/vtab/best-access-plan.d.ts.map +1 -1
  434. package/dist/src/vtab/best-access-plan.js +16 -0
  435. package/dist/src/vtab/best-access-plan.js.map +1 -1
  436. package/dist/src/vtab/capabilities.d.ts +72 -4
  437. package/dist/src/vtab/capabilities.d.ts.map +1 -1
  438. package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
  439. package/dist/src/vtab/memory/layer/manager.js +17 -13
  440. package/dist/src/vtab/memory/layer/manager.js.map +1 -1
  441. package/dist/src/vtab/module.d.ts +13 -7
  442. package/dist/src/vtab/module.d.ts.map +1 -1
  443. package/package.json +3 -3
  444. package/dist/src/planner/nodes/array-index-node.d.ts +0 -22
  445. package/dist/src/planner/nodes/array-index-node.d.ts.map +0 -1
  446. package/dist/src/planner/nodes/array-index-node.js +0 -41
  447. package/dist/src/planner/nodes/array-index-node.js.map +0 -1
  448. package/dist/src/runtime/emit/array-index.d.ts +0 -5
  449. package/dist/src/runtime/emit/array-index.d.ts.map +0 -1
  450. package/dist/src/runtime/emit/array-index.js +0 -22
  451. package/dist/src/runtime/emit/array-index.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { QuereusError } from '../common/errors.js';
2
- import { type DeepReadonly, type Row, type SqlValue } from '../common/types.js';
3
- import { type LogicalType } from '../types/logical-type.js';
2
+ import { type Row, type SqlValue } from '../common/types.js';
3
+ import { type DeclaredType } from '../types/representation.js';
4
4
  /**
5
5
  * Off-by-default physical-representation assertions (`QUEREUS_REPR_STRICT`).
6
6
  *
@@ -30,6 +30,12 @@ import { type LogicalType } from '../types/logical-type.js';
30
30
  * `null` is always admissible: nullability is `not null` constraint enforcement's
31
31
  * job and lives elsewhere.
32
32
  *
33
+ * R2's predicate itself lives one layer down, in `types/representation.ts`
34
+ * ({@link conformsToType}), because the DML write path needs the same answer: its
35
+ * static-type skip is guarded by "does the value actually inhabit the column's type"
36
+ * (see `buildCellCoercion` in `types/validation.ts`). This checker and that guard must
37
+ * never come to disagree about what conforms, so there is one definition.
38
+ *
33
39
  * **No capability flag.** A `representationFidelity` declaration on
34
40
  * `VirtualTableModule` was considered and rejected — nothing would BEHAVE differently
35
41
  * based on it, since the engine tolerates both numeric forms everywhere and will
@@ -41,11 +47,10 @@ import { type LogicalType } from '../types/logical-type.js';
41
47
  * nothing is built at emit time on this module's behalf.
42
48
  */
43
49
  /**
44
- * A declared type as this checker reads it. Only `name` and `physicalType` are
45
- * consulted, and the parameter is `DeepReadonly` so both a raw `LogicalType` (column
46
- * schema) and the frozen one a `ScalarType` carries are accepted without a cast.
50
+ * A declared type as this checker reads it. Defined alongside the R2 predicate in
51
+ * `types/representation.ts` and re-exported here for the checker's existing importers.
47
52
  */
48
- export type DeclaredType = DeepReadonly<LogicalType>;
53
+ export type { DeclaredType };
49
54
  /** A violation of R1/R2. Distinct class so a seam inside a re-wrapping `catch`
50
55
  * (the vtab scan) can rethrow it unchanged instead of burying it in a generic
51
56
  * "error during query" message. */
@@ -1 +1 @@
1
- {"version":3,"file":"strict-representation.d.ts","sourceRoot":"","sources":["../../../src/runtime/strict-representation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAc,KAAK,YAAY,EAAE,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;AAErD;;oCAEoC;AACpC,qBAAa,mBAAoB,SAAQ,YAAY;gBACxC,OAAO,EAAE,MAAM;CAK3B;AAiGD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOzE;AAED;;;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AAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAC3C,IAAI,CAWN"}
@@ -1,6 +1,7 @@
1
1
  import { QuereusError } from '../common/errors.js';
2
2
  import { StatusCode } from '../common/types.js';
3
3
  import { PhysicalType } from '../types/logical-type.js';
4
+ import { conformsToType } from '../types/representation.js';
4
5
  import { isCanonicalNumeric } from '../util/numeric-canonical.js';
5
6
  import { valueToText } from '../util/value-text.js';
6
7
  /** A violation of R1/R2. Distinct class so a seam inside a re-wrapping `catch`
@@ -61,50 +62,6 @@ function admissibleForms(type) {
61
62
  default: return 'any value in canonical form';
62
63
  }
63
64
  }
64
- /**
65
- * R2 for one non-null value that has already passed R1.
66
- *
67
- * Keyed on `physicalType` rather than the type's identity so plugin-registered types
68
- * are covered too. Two arms need the type NAME as well:
69
- *
70
- * - **NUMERIC** shares REAL's `physicalType` (see the NOTE on `NUMERIC_TYPE` in
71
- * `types/builtin-types.ts`) but its value space includes `bigint`.
72
- * NOTE: matched by NAME, not by identity against the `NUMERIC_TYPE` singleton the way
73
- * `isSeekKeySpaceNumeric` matches, because the surrounding switch is deliberately keyed
74
- * on `physicalType` so plugin-registered types are covered. The cost is that a
75
- * plugin-registered REAL-physical type *named* `NUMERIC` would silently inherit
76
- * bigint admission. No such type exists in tree; if one is ever registered, give
77
- * `LogicalType` an explicit "admits bigint" property and switch on that instead.
78
- * - **`ANY`/NULL** (`PhysicalType.NULL`) impose no R2 constraint at all — R1 already
79
- * passed, and an `ANY` position may legitimately hold any storage class.
80
- *
81
- * TIMESTAMP needs no special case: it declares `physicalType` INTEGER because it IS an
82
- * integer instant, so it takes INTEGER's rule. The string temporals (DATE / TIME /
83
- * DATETIME / TIMESPAN) declare TEXT and take TEXT's — R2 must not demand a `Temporal`
84
- * object for them.
85
- */
86
- function conformsToType(value, type) {
87
- switch (type.physicalType) {
88
- case PhysicalType.INTEGER:
89
- return typeof value === 'bigint' || (typeof value === 'number' && Number.isSafeInteger(value));
90
- case PhysicalType.REAL:
91
- return typeof value === 'number' || (typeof value === 'bigint' && type.name === 'NUMERIC');
92
- case PhysicalType.TEXT:
93
- return typeof value === 'string';
94
- case PhysicalType.BLOB:
95
- return value instanceof Uint8Array;
96
- case PhysicalType.BOOLEAN:
97
- return typeof value === 'boolean';
98
- case PhysicalType.OBJECT:
99
- // Mirrors JSON_TYPE.validate: a native object/array (a blob is not one), or a
100
- // JSON scalar — a JSON string scalar is physically a plain `string`.
101
- return (typeof value === 'object' && !(value instanceof Uint8Array))
102
- || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
103
- default:
104
- // PhysicalType.NULL (ANY / NULL) and any unrecognized plugin code: R1 only.
105
- return true;
106
- }
107
- }
108
65
  const DOC_POINTER = 'See docs/types.md § Physical representation.';
109
66
  /**
110
67
  * R1 for one value: no `bigint` may hold a safe-range integer. Needs no declared type,
@@ -1 +1 @@
1
- {"version":3,"file":"strict-representation.js","sourceRoot":"","sources":["../../../src/runtime/strict-representation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAA8C,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAoB,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAiDpD;;oCAEoC;AACpC,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IACpD,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;CACD;AAED,iFAAiF;AACjF,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;;;;;;;;GAUG;AACH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,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACP,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC;IACF,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"strict-representation.js","sourceRoot":"","sources":["../../../src/runtime/strict-representation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAA2B,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAqB,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAsDpD;;oCAEoC;AACpC,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IACpD,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;CACD;AAED,iFAAiF;AACjF,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,SAAS,WAAW,CAAC,KAAe;IACnC,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACJ,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC;IACrC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,MAAM,MAAM,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC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,EAAE,EAAE,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACP,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC;IACF,CAAC;AACF,CAAC"}
@@ -3,7 +3,15 @@ import type { Database } from '../core/database.js';
3
3
  import type { Schema } from './schema.js';
4
4
  import { type ObjectReach } from './object-dependency-closure.js';
5
5
  export interface AssertionDependentTable {
6
- /** Instance-unique table reference key, e.g. schema.table#nodeId */
6
+ /**
7
+ * Instance-unique table reference key, e.g. `schema.table#nodeId`.
8
+ *
9
+ * Meaningful ONLY within one recorded list, where it tells two references to
10
+ * the same table apart (a self-join records two entries). The embedded node id
11
+ * comes from a process-wide counter over whichever plan produced the list, so
12
+ * it will never equal the key the commit-time evaluator computes for the same
13
+ * table — do not build a lookup that compares the two.
14
+ */
7
15
  relationKey: string;
8
16
  /** Base table identifier, e.g. schema.table */
9
17
  base: string;
@@ -19,7 +27,22 @@ export interface IntegrityAssertionSchema {
19
27
  deferrable: boolean;
20
28
  /** If true, initially deferred. Currently informational. */
21
29
  initiallyDeferred: boolean;
22
- /** Base tables referenced; filled during assertion preparation/creation. */
30
+ /**
31
+ * Base-table references in the body — informational only; it feeds
32
+ * `assertion_info().dependent_tables` and enforcement never reads it (the
33
+ * commit-time evaluator derives its own set when it compiles the body, from
34
+ * the same `planAssertionBodyForAnalysis` + `collectTableReferences` pair — see
35
+ * `planner/analysis/relation-key.ts`).
36
+ *
37
+ * NOTE: recorded once at CREATE, and after that only string-re-keyed by the
38
+ * `ALTER TABLE … RENAME` propagation — no other schema change re-derives it.
39
+ * It can therefore go stale where the body's plan shape depends on something
40
+ * other than the table names in its text (a view in the body redefined over
41
+ * different tables is the reachable case). Harmless while nothing but
42
+ * introspection reads it; the day a consumer needs it to be live, re-derive it
43
+ * on the schema-change events the evaluator already invalidates its cache on
44
+ * rather than adding another remap.
45
+ */
23
46
  dependentTables?: AssertionDependentTable[];
24
47
  /**
25
48
  * Original CHECK expression AST. Populated when the assertion is created
@@ -1 +1 @@
1
- {"version":3,"file":"assertion.d.ts","sourceRoot":"","sources":["../../../src/schema/assertion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAEpF,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,kGAAkG;IAClG,UAAU,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,UAAU,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,iBAAiB,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,eAAe,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAC5C;;;;;OAKG;IACH,eAAe,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,GAAG,MAAM,CAExE;AAED,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC9B,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,wBAAwB,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAiB,yBAAyB,CACzC,EAAE,EAAE,QAAQ,EACZ,cAAc,EAAE,MAAM,GACpB,QAAQ,CAAC,cAAc,CAAC,CAW1B;AAED;;;;;GAKG;AAC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,cAAc,CAAC,WAAW,EAAE;QACtE,CAAC,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG;QAC7B,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC;AACrD,CAAC;AAQD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,SAAS,CAAC,CAAC,+BAA+B,CAC/C,EAAY,EACZ,cAAsB;IAEtB,MAAM,SAAS,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC;IACjD,KAAK,MAAM,KAAK,IAAI,yBAAyB,CAAC,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC;QACnE,yEAAyE;QACzE,2EAA2E;QAC3E,qEAAqE;QACrE,oEAAoE;QACpE,6DAA6D;QAC7D,yEAAyE;QACzE,8EAA8E;QAC9E,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;QAC9C,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnF,CAAC;AACF,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { SchemaCatalog } from './catalog.js';
2
+ /**
3
+ * Canonical text rendering of a {@link SchemaCatalog}, for the `apply schema`
4
+ * applied-state snapshot (see `docs/schema.md` § Applied-state snapshot).
5
+ *
6
+ * The rendering exists to answer exactly one question: *is this catalog, field
7
+ * for field, the one that was in place at the end of the last successful,
8
+ * no-op `apply schema`?* Two catalogs that render to the same string must be
9
+ * indistinguishable to `computeSchemaDiff`. It is deliberately NOT a
10
+ * hash — an exact string compare is both cheaper (measured 0.003–0.008 ms vs
11
+ * 1.46 ms to FNV-1a hash 119 KB of rendered text) and carries no hash-collision
12
+ * risk.
13
+ *
14
+ * NOTE: the *encoding* is not provably injective, though. Fields and items are
15
+ * separated by literal spaces / tabs / newlines, and a leaf value can contain
16
+ * any of them — a tag value or a DEFAULT holding a raw newline reaches the
17
+ * output verbatim (via `sqlValueToLiteral` / `expressionToString`, and via the
18
+ * `ddl` text that embeds the same literal). So a value crafted to imitate the
19
+ * rendering of a *different* catalog item makes two distinct catalogs render
20
+ * alike, and an out-of-band change between exactly those two catalogs would be
21
+ * skipped. It takes deliberately hostile tag/DEFAULT text to build one, so it is
22
+ * left open; the fix that retires the class is a uniquely-decodable encoding
23
+ * (JSON-frame each part instead of joining on separators — measured ~+0.25 ms on
24
+ * the 308.8 KB rendering of `bench/apply-schema-unchanged.mjs 30`, against a
25
+ * 1.50 ms fast-pathed apply). See `tickets/backlog/debt-catalog-rendering-injective-encoding`.
26
+ *
27
+ * It is also NOT the schema *version* hash. `computeSchemaHash` strips tags
28
+ * before hashing, because tags must not affect versioning; the differ, by
29
+ * contrast, DOES diff tags and emits `SET TAGS` steps for them. So this
30
+ * rendering is tags-inclusive and the two must never be conflated.
31
+ *
32
+ * Every arm destructures **every** field of its catalog interface and hands the
33
+ * rest to {@link assertEveryFieldConsidered}, so a new field on any catalog
34
+ * interface fails the build here until someone decides whether it belongs in
35
+ * the comparison.
36
+ */
37
+ export declare function renderCatalogForComparison(catalog: SchemaCatalog): string;
38
+ //# sourceMappingURL=catalog-rendering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-rendering.d.ts","sourceRoot":"","sources":["../../../src/schema/catalog-rendering.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAA6D,MAAM,cAAc,CAAC;AAE7G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAYzE"}
@@ -0,0 +1,171 @@
1
+ import { expressionToString } from '../emit/ast-stringify.js';
2
+ import { sqlValueToLiteral } from '../util/sql-literal.js';
3
+ /**
4
+ * Canonical text rendering of a {@link SchemaCatalog}, for the `apply schema`
5
+ * applied-state snapshot (see `docs/schema.md` § Applied-state snapshot).
6
+ *
7
+ * The rendering exists to answer exactly one question: *is this catalog, field
8
+ * for field, the one that was in place at the end of the last successful,
9
+ * no-op `apply schema`?* Two catalogs that render to the same string must be
10
+ * indistinguishable to `computeSchemaDiff`. It is deliberately NOT a
11
+ * hash — an exact string compare is both cheaper (measured 0.003–0.008 ms vs
12
+ * 1.46 ms to FNV-1a hash 119 KB of rendered text) and carries no hash-collision
13
+ * risk.
14
+ *
15
+ * NOTE: the *encoding* is not provably injective, though. Fields and items are
16
+ * separated by literal spaces / tabs / newlines, and a leaf value can contain
17
+ * any of them — a tag value or a DEFAULT holding a raw newline reaches the
18
+ * output verbatim (via `sqlValueToLiteral` / `expressionToString`, and via the
19
+ * `ddl` text that embeds the same literal). So a value crafted to imitate the
20
+ * rendering of a *different* catalog item makes two distinct catalogs render
21
+ * alike, and an out-of-band change between exactly those two catalogs would be
22
+ * skipped. It takes deliberately hostile tag/DEFAULT text to build one, so it is
23
+ * left open; the fix that retires the class is a uniquely-decodable encoding
24
+ * (JSON-frame each part instead of joining on separators — measured ~+0.25 ms on
25
+ * the 308.8 KB rendering of `bench/apply-schema-unchanged.mjs 30`, against a
26
+ * 1.50 ms fast-pathed apply). See `tickets/backlog/debt-catalog-rendering-injective-encoding`.
27
+ *
28
+ * It is also NOT the schema *version* hash. `computeSchemaHash` strips tags
29
+ * before hashing, because tags must not affect versioning; the differ, by
30
+ * contrast, DOES diff tags and emits `SET TAGS` steps for them. So this
31
+ * rendering is tags-inclusive and the two must never be conflated.
32
+ *
33
+ * Every arm destructures **every** field of its catalog interface and hands the
34
+ * rest to {@link assertEveryFieldConsidered}, so a new field on any catalog
35
+ * interface fails the build here until someone decides whether it belongs in
36
+ * the comparison.
37
+ */
38
+ export function renderCatalogForComparison(catalog) {
39
+ const { schemaName, tables, views, indexes, assertions, ...rest } = catalog;
40
+ assertEveryFieldConsidered(rest);
41
+ return [
42
+ // Lowercased: the snapshot is keyed by lowercased schema name, so
43
+ // `apply schema MyApp` and `apply schema myapp` must render alike.
44
+ `schema ${schemaName.toLowerCase()}`,
45
+ ...sortedRenderings(tables, renderTable),
46
+ ...sortedRenderings(views, renderView),
47
+ ...sortedRenderings(indexes, renderIndex),
48
+ ...sortedRenderings(assertions, renderAssertion),
49
+ ].join('\n');
50
+ }
51
+ /**
52
+ * Compile error if a catalog interface grows a field this renderer does not
53
+ * consider. The rest object of an exhaustive destructure is `{}`, which is
54
+ * assignable to `Record<string, never>`; one left-over field of any other type
55
+ * is not.
56
+ */
57
+ function assertEveryFieldConsidered(_leftover) { }
58
+ /**
59
+ * Renders every item and sorts the RESULTS, so a drop+recreate that only changes
60
+ * the live `Map` insertion order produces no spurious mismatch. Sorting the
61
+ * rendered strings (rather than the items by name) also keeps two objects that
62
+ * legitimately share a name — an index name is unique per *table*, not per
63
+ * schema — in a stable order without needing a composite sort key.
64
+ */
65
+ function sortedRenderings(items, render) {
66
+ return items.map(render).sort();
67
+ }
68
+ function renderTable(t) {
69
+ const { name, ddl, columns, primaryKey, referencedTables, tags, namedConstraints, maintained, ...rest } = t;
70
+ assertEveryFieldConsidered(rest);
71
+ return [
72
+ `table ${name}`,
73
+ // `ddl` is deliberately redundant with the structured fields below: it costs
74
+ // nothing extra (it is already computed by `collectSchemaCatalog`) and removes
75
+ // any need to argue about what `generateTableDDL` does or does not render.
76
+ `\tddl ${ddl}`,
77
+ // Column ORDER is behavioural — never sorted.
78
+ ...columns.map(c => `\t${renderColumn(c)}`),
79
+ `\tpk ${primaryKey.map(pk => `${pk.columnName} ${pk.desc ? 'desc' : 'asc'}`).join(', ')}`,
80
+ // Sorted: only feeds the differ's drop ORDERING, which is inert on an empty diff.
81
+ `\trefs ${[...referencedTables].sort().join(', ')}`,
82
+ `\ttags ${renderTags(tags)}`,
83
+ // Sorted: the differ keys named constraints by name, so their order carries no meaning.
84
+ ...sortedRenderings(namedConstraints, renderNamedConstraint).map(s => `\t${s}`),
85
+ `\tmaintained ${maintained ? renderMaintained(maintained) : '-'}`,
86
+ ].join('\n');
87
+ }
88
+ function renderColumn(c) {
89
+ const { name, type, notNull, primaryKey, defaultValue, collation, tags, ...rest } = c;
90
+ assertEveryFieldConsidered(rest);
91
+ return `column ${name} ${type} ${notNull ? 'not null' : 'null'} ${primaryKey ? 'pk' : '-'}`
92
+ // `defaultValue` is an `AST.Expression`; rendered with the same
93
+ // `expressionToString` the catalog itself uses for DEFAULT text. Measured at
94
+ // 0.140 ms of a 0.871 ms whole-catalog render on the 112.7 KB / 54-table ×
95
+ // 38-column declaration of `bench/apply-schema-unchanged.mjs` (median of 15),
96
+ // against the 4.35 ms `computeSchemaDiff` the whole render replaces — so
97
+ // keeping it costs nothing worth trading for leaning on `ddl` alone.
98
+ + ` default ${defaultValue ? expressionToString(defaultValue) : '-'}`
99
+ + ` collate ${collation} tags ${renderTags(tags)}`;
100
+ }
101
+ function renderNamedConstraint(c) {
102
+ const { name, tags, definition, ...rest } = c;
103
+ assertEveryFieldConsidered(rest);
104
+ return `constraint ${name} ${definition} tags ${renderTags(tags)}`;
105
+ }
106
+ function renderMaintained(m) {
107
+ // `select` (the live derivation body AST) is deliberately NOT rendered: the
108
+ // differ compares `bodyHash` first and only walks the AST when that comparison
109
+ // FAILS, to tolerate rename artifacts (schema-differ.ts § maintained-table
110
+ // compare). This rendering only ever fires the fast path when every hash
111
+ // matches, so the AST-tolerant path is unreachable and the hash fully
112
+ // determines the outcome.
113
+ const { bodyHash, backingModuleName, backingModuleArgs, select: _select, ...rest } = m;
114
+ assertEveryFieldConsidered(rest);
115
+ return `body ${bodyHash} module ${backingModuleName ?? '-'} args ${renderTags(backingModuleArgs)}`;
116
+ }
117
+ function renderView(v) {
118
+ // `select` omitted for the same reason as `CatalogTable.maintained.select`:
119
+ // the differ consults it only when `definition` already differs.
120
+ const { name, ddl, definition, tags, select: _select, ...rest } = v;
121
+ assertEveryFieldConsidered(rest);
122
+ return `view ${name}\n\tddl ${ddl}\n\tdef ${definition}\n\ttags ${renderTags(tags)}`;
123
+ }
124
+ function renderIndex(x) {
125
+ const { name, tableName, ddl, definition, tags, implicit, ...rest } = x;
126
+ assertEveryFieldConsidered(rest);
127
+ return `index ${name} on ${tableName}${implicit ? ' implicit' : ''}\n\tddl ${ddl}\n\tdef ${definition}\n\ttags ${renderTags(tags)}`;
128
+ }
129
+ function renderAssertion(a) {
130
+ // `check` omitted for the same reason as `CatalogView.select`.
131
+ const { name, ddl, definition, check: _check, ...rest } = a;
132
+ assertEveryFieldConsidered(rest);
133
+ return `assertion ${name}\n\tddl ${ddl}\n\tdef ${definition}`;
134
+ }
135
+ /**
136
+ * Order-independent rendering of a tag set. Keys are sorted and an empty set
137
+ * renders as an absent one, matching the differ's own tag comparison
138
+ * (`tagsDrifted`, which stable-stringifies both sides).
139
+ *
140
+ * The rename-hint keys (`quereus.id` / `quereus.previous_name`) that the differ
141
+ * excludes from drift comparison ARE rendered here. A hint-only change therefore
142
+ * costs one extra full reconcile — the safe direction, and cheaper than keeping
143
+ * a second copy of the differ's exclusion list in sync.
144
+ */
145
+ function renderTags(tags) {
146
+ if (!tags)
147
+ return '-';
148
+ const keys = Object.keys(tags).sort();
149
+ if (keys.length === 0)
150
+ return '-';
151
+ return `(${keys.map(k => `${JSON.stringify(k)}=${renderTagValue(tags[k])}`).join(', ')})`;
152
+ }
153
+ /**
154
+ * A tag value as a SQL literal, prefixed with a one-character type tag.
155
+ *
156
+ * The prefix is what makes the encoding injective: `sqlValueToLiteral` renders a
157
+ * JSON value as its quoted JSON text, which is byte-identical to what it renders
158
+ * for a *string* holding that same text. Without the discriminator, a tag flipping
159
+ * between `{"a":1}` and `'{"a":1}'` would render unchanged and be skipped.
160
+ */
161
+ function renderTagValue(v) {
162
+ const kind = v === null ? 'n' :
163
+ typeof v === 'string' ? 's' :
164
+ typeof v === 'number' ? 'f' :
165
+ typeof v === 'bigint' ? 'i' :
166
+ typeof v === 'boolean' ? 'b' :
167
+ v instanceof Uint8Array ? 'x' :
168
+ 'j';
169
+ return kind + sqlValueToLiteral(v);
170
+ }
171
+ //# sourceMappingURL=catalog-rendering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-rendering.js","sourceRoot":"","sources":["../../../src/schema/catalog-rendering.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAsB;IAChE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAC5E,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO;QACN,kEAAkE;QAClE,mEAAmE;QACnE,UAAU,UAAU,CAAC,WAAW,EAAE,EAAE;QACpC,GAAG,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC;QACxC,GAAG,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC;QACtC,GAAG,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC;QACzC,GAAG,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC;KAChD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAS,0BAA0B,CAAC,SAAgC,IAAgC,CAAC;AAErG;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAI,KAAmB,EAAE,MAA2B;IAC5E,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,WAAW,CAAC,CAAe;IACnC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,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;;GAOG;AACH,SAAS,cAAc,CAAC,CAAW;IAClC,MAAM,IAAI,GACT,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAClB,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBAC7B,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;oBAC7B,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;wBAC9B,CAAC,YAAY,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;4BAC/B,GAAG,CAAC;IACL,OAAO,IAAI,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
@@ -4,6 +4,13 @@ import type * as AST from '../parser/ast.js';
4
4
  import { type SqlValue } from '../common/types.js';
5
5
  /**
6
6
  * Represents a catalog snapshot of the current database schema state
7
+ *
8
+ * Adding a field to this interface — or to any `Catalog*` interface below —
9
+ * requires a matching arm in `renderCatalogForComparison`
10
+ * (`schema/catalog-rendering.ts`), which decides whether the field participates
11
+ * in `apply schema`'s unchanged-catalog fast path. The compiler enforces it: the
12
+ * renderer destructures every field and hands the remainder to a
13
+ * `Record<string, never>` guard, so an unconsidered field fails the build.
7
14
  */
8
15
  export interface SchemaCatalog {
9
16
  schemaName: string;
@@ -12,6 +19,7 @@ export interface SchemaCatalog {
12
19
  indexes: CatalogIndex[];
13
20
  assertions: CatalogAssertion[];
14
21
  }
22
+ /** New field ⇒ new arm in `renderCatalogForComparison` (compiler-enforced; see {@link SchemaCatalog}). */
15
23
  export interface CatalogTable {
16
24
  name: string;
17
25
  ddl: string;
@@ -70,6 +78,7 @@ export interface CatalogTable {
70
78
  select?: AST.QueryExpr;
71
79
  };
72
80
  }
81
+ /** New field ⇒ new arm in `renderCatalogForComparison` (compiler-enforced; see {@link SchemaCatalog}). */
73
82
  export interface CatalogView {
74
83
  name: string;
75
84
  ddl: string;
@@ -96,6 +105,7 @@ export interface CatalogView {
96
105
  */
97
106
  select?: AST.QueryExpr;
98
107
  }
108
+ /** New field ⇒ new arm in `renderCatalogForComparison` (compiler-enforced; see {@link SchemaCatalog}). */
99
109
  export interface CatalogIndex {
100
110
  name: string;
101
111
  tableName: string;
@@ -127,6 +137,7 @@ export interface CatalogIndex {
127
137
  */
128
138
  implicit?: boolean;
129
139
  }
140
+ /** New field ⇒ new arm in `renderCatalogForComparison` (compiler-enforced; see {@link SchemaCatalog}). */
130
141
  export interface CatalogAssertion {
131
142
  name: string;
132
143
  ddl: string;
@@ -150,18 +161,73 @@ export interface CatalogAssertion {
150
161
  export declare function collectSchemaCatalog(db: Database, schemaName?: string): SchemaCatalog;
151
162
  /**
152
163
  * Rejects a UNIQUE constraint declaration whose implicit backing structure would
153
- * claim a name already held by an index on the same table (see
154
- * {@link findIndexShadowedByUniqueConstraint}). No-op for any other constraint
155
- * kind — CHECK and FOREIGN KEY build no backing index, so they cannot collide.
164
+ * claim a name already held on the same table — by another UNIQUE constraint's
165
+ * backing structure ({@link findUniqueConstraintSharingBackingName}) or by an index
166
+ * ({@link findIndexShadowedByUniqueConstraint}). No-op for any other constraint kind
167
+ * — CHECK and FOREIGN KEY build no backing index, so they cannot collide.
156
168
  *
157
169
  * Called from the engine side BEFORE `module.alterTable`, which is what makes one
158
170
  * guard cover both backends and keeps a rejected statement from reaching the
159
171
  * store's persistence side effects.
160
172
  *
173
+ * The constraint arm runs FIRST so a collision both arms can see reports identically
174
+ * on memory and store: memory materializes a constraint's structure into `.indexes`
175
+ * and store does not, so letting the index arm rule first would name an index the
176
+ * user never created under one backend and a constraint under the other.
177
+ *
161
178
  * `operation` describes what the statement was doing, e.g.
162
179
  * `add constraint 'foo' to table 't'`.
163
180
  */
164
181
  export declare function assertUniqueConstraintIndexNameFree(tableSchema: TableSchema, constraintName: string | undefined, columnNames: ReadonlyArray<string>, operation: string): void;
182
+ /**
183
+ * A UNIQUE constraint as its declaration spells it — the name the user wrote (absent
184
+ * when unnamed) and the names of the columns it covers. Enough to derive its backing
185
+ * structure name and to describe it back in a message, and available before the
186
+ * constraint (or, for `ADD COLUMN`, its column) exists on any schema.
187
+ */
188
+ export interface DeclaredUniqueConstraint {
189
+ readonly name?: string;
190
+ readonly columnNames: ReadonlyArray<string>;
191
+ }
192
+ /**
193
+ * The pairwise form of {@link assertUniqueConstraintIndexNameFree}'s constraint arm:
194
+ * refuses a set of UNIQUE constraints declared TOGETHER, none of them on a table yet,
195
+ * in which two derive one backing structure name.
196
+ *
197
+ * Two callers hold a whole declaration at once and so have no table to compare
198
+ * against: `CREATE TABLE` (its entire constraint list) and
199
+ * `ALTER TABLE … ADD COLUMN` (the inline `unique` constraints on the new column).
200
+ * Both run it AFTER the duplicate-constraint guards, so a genuine duplicate keeps
201
+ * producing the constraint-worded duplicate message rather than a structure-name one,
202
+ * and — for `CREATE TABLE` — before `module.create`, so a refusal leaves no storage
203
+ * behind.
204
+ *
205
+ * Takes {@link DeclaredUniqueConstraint}s rather than built
206
+ * {@link UniqueConstraintSchema}s so the ADD COLUMN caller, whose column does not exist
207
+ * on any schema yet, can use it;
208
+ * {@link assertNoDuplicateUniqueConstraintBackingNames} is the built-constraint wrapper.
209
+ */
210
+ export declare function assertUniqueConstraintBackingNamesDistinct(declared: ReadonlyArray<DeclaredUniqueConstraint>, operation: string): void;
211
+ /**
212
+ * The `CREATE TABLE` wrapper over {@link assertUniqueConstraintBackingNamesDistinct},
213
+ * reading the BUILT constraints (column indices already resolved) so inline and
214
+ * table-level spellings are compared in one place. A `CREATE TABLE` declares no
215
+ * indexes, so this pairwise comparison is the whole of the check there.
216
+ *
217
+ * `derivedFromIndex` constraints are skipped for the same reason
218
+ * {@link findUniqueConstraintSharingBackingName} skips them — unreachable from a
219
+ * `CREATE TABLE` today (the statement carries no index declarations), kept so the two
220
+ * arms answer alike if that ever changes.
221
+ *
222
+ * Called from `SchemaManager.createTable` only — never from the import / rehydrate
223
+ * path, so a catalog written before this guard existed still opens (same placement
224
+ * rationale as {@link assertNoDuplicateUniqueConstraints}; the memory backend's
225
+ * `ensureUniqueConstraintIndexes` keeps its adoption behaviour as damage limitation
226
+ * for exactly those catalogs).
227
+ */
228
+ export declare function assertNoDuplicateUniqueConstraintBackingNames(constraints: ReadonlyArray<UniqueConstraintSchema>, columns: ReadonlyArray<{
229
+ name: string;
230
+ }>, operation: string): void;
165
231
  /**
166
232
  * Order- and repetition-insensitive key for the column set a UNIQUE constraint
167
233
  * covers. `unique (a, b)` and `unique (b, a)` enforce the identical rule, so they
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/schema/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAe,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAOtG,OAAO,KAAK,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,KAAK,QAAQ,EAAc,MAAM,oBAAoB,CAAC;AAM/D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;QACpB,YAAY,EAAE,GAAG,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