@quereus/quereus 4.8.0 → 4.10.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 (280) hide show
  1. package/dist/src/core/database.d.ts +6 -0
  2. package/dist/src/core/database.d.ts.map +1 -1
  3. package/dist/src/core/database.js +45 -5
  4. package/dist/src/core/database.js.map +1 -1
  5. package/dist/src/core/statement.d.ts.map +1 -1
  6. package/dist/src/core/statement.js +74 -15
  7. package/dist/src/core/statement.js.map +1 -1
  8. package/dist/src/func/builtins/aggregate.d.ts.map +1 -1
  9. package/dist/src/func/builtins/aggregate.js +88 -35
  10. package/dist/src/func/builtins/aggregate.js.map +1 -1
  11. package/dist/src/func/builtins/conversion.d.ts +5 -0
  12. package/dist/src/func/builtins/conversion.d.ts.map +1 -1
  13. package/dist/src/func/builtins/conversion.js +16 -2
  14. package/dist/src/func/builtins/conversion.js.map +1 -1
  15. package/dist/src/func/builtins/explain.d.ts.map +1 -1
  16. package/dist/src/func/builtins/explain.js +9 -2
  17. package/dist/src/func/builtins/explain.js.map +1 -1
  18. package/dist/src/func/builtins/index.d.ts.map +1 -1
  19. package/dist/src/func/builtins/index.js +5 -2
  20. package/dist/src/func/builtins/index.js.map +1 -1
  21. package/dist/src/func/builtins/scalar.d.ts.map +1 -1
  22. package/dist/src/func/builtins/scalar.js +4 -2
  23. package/dist/src/func/builtins/scalar.js.map +1 -1
  24. package/dist/src/func/builtins/string.d.ts +2 -0
  25. package/dist/src/func/builtins/string.d.ts.map +1 -1
  26. package/dist/src/func/builtins/string.js +60 -4
  27. package/dist/src/func/builtins/string.js.map +1 -1
  28. package/dist/src/func/registration.d.ts +6 -0
  29. package/dist/src/func/registration.d.ts.map +1 -1
  30. package/dist/src/func/registration.js +1 -0
  31. package/dist/src/func/registration.js.map +1 -1
  32. package/dist/src/index.d.ts +7 -3
  33. package/dist/src/index.d.ts.map +1 -1
  34. package/dist/src/index.js +21 -2
  35. package/dist/src/index.js.map +1 -1
  36. package/dist/src/planner/building/constraint-builder.js +1 -1
  37. package/dist/src/planner/building/constraint-builder.js.map +1 -1
  38. package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
  39. package/dist/src/planner/nodes/scalar.js +13 -1
  40. package/dist/src/planner/nodes/scalar.js.map +1 -1
  41. package/dist/src/planner/rules/retrieve/rule-grow-retrieve.d.ts.map +1 -1
  42. package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js +121 -51
  43. package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js.map +1 -1
  44. package/dist/src/planner/rules/shared/index-style-context.d.ts +14 -4
  45. package/dist/src/planner/rules/shared/index-style-context.d.ts.map +1 -1
  46. package/dist/src/planner/rules/shared/index-style-context.js +14 -4
  47. package/dist/src/planner/rules/shared/index-style-context.js.map +1 -1
  48. package/dist/src/runtime/emission-context.d.ts +14 -1
  49. package/dist/src/runtime/emission-context.d.ts.map +1 -1
  50. package/dist/src/runtime/emission-context.js +17 -5
  51. package/dist/src/runtime/emission-context.js.map +1 -1
  52. package/dist/src/runtime/emit/aggregate-setup.d.ts +44 -8
  53. package/dist/src/runtime/emit/aggregate-setup.d.ts.map +1 -1
  54. package/dist/src/runtime/emit/aggregate-setup.js +79 -15
  55. package/dist/src/runtime/emit/aggregate-setup.js.map +1 -1
  56. package/dist/src/runtime/emit/aggregate.d.ts.map +1 -1
  57. package/dist/src/runtime/emit/aggregate.js +21 -106
  58. package/dist/src/runtime/emit/aggregate.js.map +1 -1
  59. package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
  60. package/dist/src/runtime/emit/alter-table.js +212 -155
  61. package/dist/src/runtime/emit/alter-table.js.map +1 -1
  62. package/dist/src/runtime/emit/asof-scan.js +1 -1
  63. package/dist/src/runtime/emit/asof-scan.js.map +1 -1
  64. package/dist/src/runtime/emit/assertion-drop-guard.d.ts +26 -12
  65. package/dist/src/runtime/emit/assertion-drop-guard.d.ts.map +1 -1
  66. package/dist/src/runtime/emit/assertion-drop-guard.js +45 -26
  67. package/dist/src/runtime/emit/assertion-drop-guard.js.map +1 -1
  68. package/dist/src/runtime/emit/assertion-rename-helpers.d.ts +6 -6
  69. package/dist/src/runtime/emit/assertion-rename-helpers.d.ts.map +1 -1
  70. package/dist/src/runtime/emit/assertion-rename-helpers.js +18 -20
  71. package/dist/src/runtime/emit/assertion-rename-helpers.js.map +1 -1
  72. package/dist/src/runtime/emit/between.d.ts +2 -0
  73. package/dist/src/runtime/emit/between.d.ts.map +1 -1
  74. package/dist/src/runtime/emit/between.js +7 -8
  75. package/dist/src/runtime/emit/between.js.map +1 -1
  76. package/dist/src/runtime/emit/binary.d.ts +27 -5
  77. package/dist/src/runtime/emit/binary.d.ts.map +1 -1
  78. package/dist/src/runtime/emit/binary.js +278 -187
  79. package/dist/src/runtime/emit/binary.js.map +1 -1
  80. package/dist/src/runtime/emit/case.d.ts +34 -0
  81. package/dist/src/runtime/emit/case.d.ts.map +1 -1
  82. package/dist/src/runtime/emit/case.js +18 -11
  83. package/dist/src/runtime/emit/case.js.map +1 -1
  84. package/dist/src/runtime/emit/cast.d.ts +2 -0
  85. package/dist/src/runtime/emit/cast.d.ts.map +1 -1
  86. package/dist/src/runtime/emit/cast.js +7 -5
  87. package/dist/src/runtime/emit/cast.js.map +1 -1
  88. package/dist/src/runtime/emit/column-reference.d.ts +3 -1
  89. package/dist/src/runtime/emit/column-reference.d.ts.map +1 -1
  90. package/dist/src/runtime/emit/column-reference.js +6 -2
  91. package/dist/src/runtime/emit/column-reference.js.map +1 -1
  92. package/dist/src/runtime/emit/column-rename-cascade.d.ts +84 -0
  93. package/dist/src/runtime/emit/column-rename-cascade.d.ts.map +1 -0
  94. package/dist/src/runtime/emit/column-rename-cascade.js +134 -0
  95. package/dist/src/runtime/emit/column-rename-cascade.js.map +1 -0
  96. package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
  97. package/dist/src/runtime/emit/dml-executor.js +21 -0
  98. package/dist/src/runtime/emit/dml-executor.js.map +1 -1
  99. package/dist/src/runtime/emit/drop-column-guards.d.ts +82 -53
  100. package/dist/src/runtime/emit/drop-column-guards.d.ts.map +1 -1
  101. package/dist/src/runtime/emit/drop-column-guards.js +155 -90
  102. package/dist/src/runtime/emit/drop-column-guards.js.map +1 -1
  103. package/dist/src/runtime/emit/drop-table.d.ts.map +1 -1
  104. package/dist/src/runtime/emit/drop-table.js +5 -0
  105. package/dist/src/runtime/emit/drop-table.js.map +1 -1
  106. package/dist/src/runtime/emit/drop-view.d.ts.map +1 -1
  107. package/dist/src/runtime/emit/drop-view.js +5 -0
  108. package/dist/src/runtime/emit/drop-view.js.map +1 -1
  109. package/dist/src/runtime/emit/expression-drop-guard.d.ts +57 -0
  110. package/dist/src/runtime/emit/expression-drop-guard.d.ts.map +1 -0
  111. package/dist/src/runtime/emit/expression-drop-guard.js +82 -0
  112. package/dist/src/runtime/emit/expression-drop-guard.js.map +1 -0
  113. package/dist/src/runtime/emit/filter.d.ts +1 -1
  114. package/dist/src/runtime/emit/filter.js +1 -1
  115. package/dist/src/runtime/emit/hash-aggregate.d.ts.map +1 -1
  116. package/dist/src/runtime/emit/hash-aggregate.js +18 -88
  117. package/dist/src/runtime/emit/hash-aggregate.js.map +1 -1
  118. package/dist/src/runtime/emit/literal.d.ts +14 -1
  119. package/dist/src/runtime/emit/literal.d.ts.map +1 -1
  120. package/dist/src/runtime/emit/literal.js +33 -7
  121. package/dist/src/runtime/emit/literal.js.map +1 -1
  122. package/dist/src/runtime/emit/materialized-view-helpers.d.ts +33 -10
  123. package/dist/src/runtime/emit/materialized-view-helpers.d.ts.map +1 -1
  124. package/dist/src/runtime/emit/materialized-view-helpers.js +158 -49
  125. package/dist/src/runtime/emit/materialized-view-helpers.js.map +1 -1
  126. package/dist/src/runtime/emit/materialized-view.d.ts.map +1 -1
  127. package/dist/src/runtime/emit/materialized-view.js +3 -0
  128. package/dist/src/runtime/emit/materialized-view.js.map +1 -1
  129. package/dist/src/runtime/emit/parameter.d.ts +3 -1
  130. package/dist/src/runtime/emit/parameter.d.ts.map +1 -1
  131. package/dist/src/runtime/emit/parameter.js +7 -2
  132. package/dist/src/runtime/emit/parameter.js.map +1 -1
  133. package/dist/src/runtime/emit/scalar-function.d.ts +29 -1
  134. package/dist/src/runtime/emit/scalar-function.d.ts.map +1 -1
  135. package/dist/src/runtime/emit/scalar-function.js +66 -16
  136. package/dist/src/runtime/emit/scalar-function.js.map +1 -1
  137. package/dist/src/runtime/emit/scalar-op.d.ts +63 -0
  138. package/dist/src/runtime/emit/scalar-op.d.ts.map +1 -0
  139. package/dist/src/runtime/emit/scalar-op.js +37 -0
  140. package/dist/src/runtime/emit/scalar-op.js.map +1 -0
  141. package/dist/src/runtime/emit/scan.d.ts.map +1 -1
  142. package/dist/src/runtime/emit/scan.js +19 -1
  143. package/dist/src/runtime/emit/scan.js.map +1 -1
  144. package/dist/src/runtime/emit/temporal-arithmetic.d.ts +18 -8
  145. package/dist/src/runtime/emit/temporal-arithmetic.d.ts.map +1 -1
  146. package/dist/src/runtime/emit/temporal-arithmetic.js +29 -311
  147. package/dist/src/runtime/emit/temporal-arithmetic.js.map +1 -1
  148. package/dist/src/runtime/emit/unary.d.ts +2 -0
  149. package/dist/src/runtime/emit/unary.d.ts.map +1 -1
  150. package/dist/src/runtime/emit/unary.js +125 -53
  151. package/dist/src/runtime/emit/unary.js.map +1 -1
  152. package/dist/src/runtime/emitters.d.ts +22 -0
  153. package/dist/src/runtime/emitters.d.ts.map +1 -1
  154. package/dist/src/runtime/emitters.js +29 -0
  155. package/dist/src/runtime/emitters.js.map +1 -1
  156. package/dist/src/runtime/scalar-fusion.d.ts +47 -0
  157. package/dist/src/runtime/scalar-fusion.d.ts.map +1 -0
  158. package/dist/src/runtime/scalar-fusion.js +275 -0
  159. package/dist/src/runtime/scalar-fusion.js.map +1 -0
  160. package/dist/src/runtime/strict-flags.d.ts +9 -0
  161. package/dist/src/runtime/strict-flags.d.ts.map +1 -1
  162. package/dist/src/runtime/strict-flags.js +9 -0
  163. package/dist/src/runtime/strict-flags.js.map +1 -1
  164. package/dist/src/runtime/strict-fork.js +2 -2
  165. package/dist/src/runtime/strict-fork.js.map +1 -1
  166. package/dist/src/runtime/strict-representation.d.ts +78 -0
  167. package/dist/src/runtime/strict-representation.d.ts.map +1 -0
  168. package/dist/src/runtime/strict-representation.js +159 -0
  169. package/dist/src/runtime/strict-representation.js.map +1 -0
  170. package/dist/src/schema/assertion.d.ts +58 -0
  171. package/dist/src/schema/assertion.d.ts.map +1 -1
  172. package/dist/src/schema/assertion.js +78 -0
  173. package/dist/src/schema/assertion.js.map +1 -1
  174. package/dist/src/schema/catalog-persistability.d.ts +11 -3
  175. package/dist/src/schema/catalog-persistability.d.ts.map +1 -1
  176. package/dist/src/schema/catalog-persistability.js +48 -29
  177. package/dist/src/schema/catalog-persistability.js.map +1 -1
  178. package/dist/src/schema/catalog.d.ts +22 -0
  179. package/dist/src/schema/catalog.d.ts.map +1 -1
  180. package/dist/src/schema/catalog.js +4 -1
  181. package/dist/src/schema/catalog.js.map +1 -1
  182. package/dist/src/schema/column-republication.d.ts +126 -0
  183. package/dist/src/schema/column-republication.d.ts.map +1 -0
  184. package/dist/src/schema/column-republication.js +121 -0
  185. package/dist/src/schema/column-republication.js.map +1 -0
  186. package/dist/src/schema/column-source-resolver.d.ts +29 -6
  187. package/dist/src/schema/column-source-resolver.d.ts.map +1 -1
  188. package/dist/src/schema/column-source-resolver.js +78 -9
  189. package/dist/src/schema/column-source-resolver.js.map +1 -1
  190. package/dist/src/schema/expression-dependents.d.ts +160 -0
  191. package/dist/src/schema/expression-dependents.d.ts.map +1 -0
  192. package/dist/src/schema/expression-dependents.js +228 -0
  193. package/dist/src/schema/expression-dependents.js.map +1 -0
  194. package/dist/src/schema/function.d.ts +15 -0
  195. package/dist/src/schema/function.d.ts.map +1 -1
  196. package/dist/src/schema/function.js.map +1 -1
  197. package/dist/src/schema/object-dependency-closure.d.ts +127 -0
  198. package/dist/src/schema/object-dependency-closure.d.ts.map +1 -0
  199. package/dist/src/schema/object-dependency-closure.js +117 -0
  200. package/dist/src/schema/object-dependency-closure.js.map +1 -0
  201. package/dist/src/schema/object-ref-resolver.d.ts +83 -0
  202. package/dist/src/schema/object-ref-resolver.d.ts.map +1 -0
  203. package/dist/src/schema/object-ref-resolver.js +135 -0
  204. package/dist/src/schema/object-ref-resolver.js.map +1 -0
  205. package/dist/src/schema/rename/column-rename.d.ts +228 -0
  206. package/dist/src/schema/rename/column-rename.d.ts.map +1 -0
  207. package/dist/src/schema/rename/column-rename.js +1225 -0
  208. package/dist/src/schema/rename/column-rename.js.map +1 -0
  209. package/dist/src/schema/rename/self-qualifier-strip.d.ts +29 -0
  210. package/dist/src/schema/rename/self-qualifier-strip.d.ts.map +1 -0
  211. package/dist/src/schema/rename/self-qualifier-strip.js +267 -0
  212. package/dist/src/schema/rename/self-qualifier-strip.js.map +1 -0
  213. package/dist/src/schema/rename/shared.d.ts +108 -0
  214. package/dist/src/schema/rename/shared.d.ts.map +1 -0
  215. package/dist/src/schema/rename/shared.js +49 -0
  216. package/dist/src/schema/rename/shared.js.map +1 -0
  217. package/dist/src/schema/rename/table-rename.d.ts +263 -0
  218. package/dist/src/schema/rename/table-rename.d.ts.map +1 -0
  219. package/dist/src/schema/rename/table-rename.js +860 -0
  220. package/dist/src/schema/rename/table-rename.js.map +1 -0
  221. package/dist/src/schema/rename-rewriter.d.ts +18 -278
  222. package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
  223. package/dist/src/schema/rename-rewriter.js +17 -1506
  224. package/dist/src/schema/rename-rewriter.js.map +1 -1
  225. package/dist/src/schema/schema-differ.d.ts.map +1 -1
  226. package/dist/src/schema/schema-differ.js +228 -21
  227. package/dist/src/schema/schema-differ.js.map +1 -1
  228. package/dist/src/types/builtin-types.d.ts.map +1 -1
  229. package/dist/src/types/builtin-types.js +29 -36
  230. package/dist/src/types/builtin-types.js.map +1 -1
  231. package/dist/src/types/cast-semantics.d.ts +7 -5
  232. package/dist/src/types/cast-semantics.d.ts.map +1 -1
  233. package/dist/src/types/cast-semantics.js +20 -9
  234. package/dist/src/types/cast-semantics.js.map +1 -1
  235. package/dist/src/types/index.d.ts +1 -1
  236. package/dist/src/types/index.d.ts.map +1 -1
  237. package/dist/src/types/index.js +1 -1
  238. package/dist/src/types/index.js.map +1 -1
  239. package/dist/src/types/registry.d.ts.map +1 -1
  240. package/dist/src/types/registry.js +2 -1
  241. package/dist/src/types/registry.js.map +1 -1
  242. package/dist/src/types/temporal-ops.d.ts +119 -0
  243. package/dist/src/types/temporal-ops.d.ts.map +1 -0
  244. package/dist/src/types/temporal-ops.js +348 -0
  245. package/dist/src/types/temporal-ops.js.map +1 -0
  246. package/dist/src/types/temporal-types.d.ts +11 -0
  247. package/dist/src/types/temporal-types.d.ts.map +1 -1
  248. package/dist/src/types/temporal-types.js +87 -0
  249. package/dist/src/types/temporal-types.js.map +1 -1
  250. package/dist/src/util/affinity.d.ts +2 -1
  251. package/dist/src/util/affinity.d.ts.map +1 -1
  252. package/dist/src/util/affinity.js +16 -5
  253. package/dist/src/util/affinity.js.map +1 -1
  254. package/dist/src/util/ast-spine-clone.d.ts +2 -2
  255. package/dist/src/util/ast-spine-clone.js +2 -2
  256. package/dist/src/util/coercion.d.ts +22 -7
  257. package/dist/src/util/coercion.d.ts.map +1 -1
  258. package/dist/src/util/coercion.js +28 -15
  259. package/dist/src/util/coercion.js.map +1 -1
  260. package/dist/src/util/comparison.d.ts +25 -0
  261. package/dist/src/util/comparison.d.ts.map +1 -1
  262. package/dist/src/util/comparison.js +25 -0
  263. package/dist/src/util/comparison.js.map +1 -1
  264. package/dist/src/util/key-tuple-codec.d.ts +12 -3
  265. package/dist/src/util/key-tuple-codec.d.ts.map +1 -1
  266. package/dist/src/util/key-tuple-codec.js.map +1 -1
  267. package/dist/src/util/numeric-canonical.d.ts +26 -0
  268. package/dist/src/util/numeric-canonical.d.ts.map +1 -0
  269. package/dist/src/util/numeric-canonical.js +66 -0
  270. package/dist/src/util/numeric-canonical.js.map +1 -0
  271. package/dist/src/util/value-text.d.ts +48 -0
  272. package/dist/src/util/value-text.d.ts.map +1 -0
  273. package/dist/src/util/value-text.js +35 -0
  274. package/dist/src/util/value-text.js.map +1 -0
  275. package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
  276. package/dist/src/vtab/memory/layer/manager.js +14 -5
  277. package/dist/src/vtab/memory/layer/manager.js.map +1 -1
  278. package/dist/src/vtab/module.d.ts +25 -0
  279. package/dist/src/vtab/module.d.ts.map +1 -1
  280. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"file":"scalar-function.js","sourceRoot":"","sources":["../../../../src/runtime/emit/scalar-function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAmC,MAAM,uBAAuB,CAAC;AAGpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAAC,IAA4B,EAAE,GAAoB;IAC/F,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACxD,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAE3C,uCAAuC;IACvC,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,YAAY,CAAC,YAAY,YAAY,2BAA2B,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/F,CAAC;IAED,SAAS,GAAG,CAAC,KAAqB,EAAE,GAAG,IAAqB;QAC3D,0DAA0D;QAC1D,MAAM,cAAc,GAAG,cAAsC,CAAC;QAE9D,0BAA0B;QAC1B,IAAI,cAAc,CAAC,OAAO,IAAI,CAAC,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AAC,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAAC;IAC/E,CAAC;IAED,6BAA6B;IAC7B,OAAO,6BAA6B,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { type SqlValue } from '../../common/types.js';
2
+ import type { Instruction, RuntimeContext } from '../types.js';
3
+ import type { ScalarPlanNode } from '../../planner/nodes/plan-node.js';
4
+ import type { EmissionContext } from '../emission-context.js';
5
+ /**
6
+ * The synchronous body of one scalar operation: it receives the runtime context plus
7
+ * one already-evaluated value per declared operand, and returns a plain value.
8
+ *
9
+ * A fixed-arity body (`(ctx, v1: SqlValue, v2: SqlValue) => SqlValue`) assigns to this
10
+ * rest signature directly — no `asRun`-style cast is needed, and every declared param
11
+ * and the return stay checked against `SqlValue`.
12
+ *
13
+ * What a rest signature cannot check is that the body's arity matches `operands.length`
14
+ * — a spec declaring two operands with a body taking one compiles, and the extra value
15
+ * is silently dropped at runtime. `buildLikeOpSpec` varies both together between its two
16
+ * paths, so the pairing is not statically detectable in general; {@link assertSpecArity}
17
+ * checks it at emit time instead.
18
+ *
19
+ * Deliberately NOT widened to `OutputValue`. A spec body that could return a Promise
20
+ * would be unusable by the fusion consumer described on {@link ScalarOpSpec}, so an
21
+ * emitter whose body is genuinely async keeps building its own `Instruction` instead
22
+ * of being forced through here.
23
+ */
24
+ export type ScalarOpRun = (ctx: RuntimeContext, ...args: SqlValue[]) => SqlValue;
25
+ /**
26
+ * Emit-time description of one scalar node's evaluation: the operand plan nodes whose
27
+ * values it consumes, and the synchronous body that combines them.
28
+ *
29
+ * Two consumers read this. {@link emitScalarOp} emits each operand as an `Instruction`
30
+ * param and hands the body to the scheduler as the instruction's `run` — today's
31
+ * behavior. The scalar-fusion compiler instead composes each operand's own fused
32
+ * closure into a direct call, with no scheduler and no per-row allocation. Both must
33
+ * agree exactly, which is why the body lives here and not inside either one.
34
+ *
35
+ * `operands` is the list that becomes `Instruction.params` — NOT the plan node's
36
+ * children. `buildLikeOpSpec`'s constant-pattern fast path bakes its right operand into the
37
+ * closure and declares one operand; the spec describes what is actually evaluated.
38
+ */
39
+ export interface ScalarOpSpec {
40
+ readonly operands: readonly ScalarPlanNode[];
41
+ readonly run: ScalarOpRun;
42
+ readonly note: string;
43
+ }
44
+ /**
45
+ * Emit-time guard that a spec's body takes exactly one parameter per declared operand,
46
+ * plus the leading context. A mismatch is an emitter bug, not a per-row condition, and
47
+ * it is otherwise silent: the scheduler spreads `params.length` args into a body that
48
+ * ignores the tail, and a fused call would drop the same values.
49
+ *
50
+ * NOTE: a body with a rest signature (`(ctx, ...args)`) or a defaulted parameter reports
51
+ * a `Function.length` that stops short, so it trips this. No spec is variadic today —
52
+ * `buildScalarFunctionRun` (emit/scalar-function.ts), the one variadic scalar body,
53
+ * deliberately stays off `ScalarOpSpec` and is composed by the fusion compiler without
54
+ * this guard. A future variadic spec needs an explicit opt-out here, not a weakened
55
+ * check for everyone.
56
+ *
57
+ * Exported for the scalar-fusion compiler (runtime/scalar-fusion.ts), which composes
58
+ * spec bodies without going through {@link emitScalarOp} and needs the same guard.
59
+ */
60
+ export declare function assertSpecArity(spec: ScalarOpSpec): void;
61
+ /** Emit a spec as the `Instruction` its emitter returned before this factoring. */
62
+ export declare function emitScalarOp(spec: ScalarOpSpec, ctx: EmissionContext): Instruction;
63
+ //# sourceMappingURL=scalar-op.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalar-op.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/scalar-op.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,QAAQ,CAAC;AAEjF;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IAC7C,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAQxD;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAOlF"}
@@ -0,0 +1,37 @@
1
+ import { StatusCode } from '../../common/types.js';
2
+ import { QuereusError } from '../../common/errors.js';
3
+ import { asRun } from '../types.js';
4
+ import { emitPlanNode } from '../emitters.js';
5
+ /**
6
+ * Emit-time guard that a spec's body takes exactly one parameter per declared operand,
7
+ * plus the leading context. A mismatch is an emitter bug, not a per-row condition, and
8
+ * it is otherwise silent: the scheduler spreads `params.length` args into a body that
9
+ * ignores the tail, and a fused call would drop the same values.
10
+ *
11
+ * NOTE: a body with a rest signature (`(ctx, ...args)`) or a defaulted parameter reports
12
+ * a `Function.length` that stops short, so it trips this. No spec is variadic today —
13
+ * `buildScalarFunctionRun` (emit/scalar-function.ts), the one variadic scalar body,
14
+ * deliberately stays off `ScalarOpSpec` and is composed by the fusion compiler without
15
+ * this guard. A future variadic spec needs an explicit opt-out here, not a weakened
16
+ * check for everyone.
17
+ *
18
+ * Exported for the scalar-fusion compiler (runtime/scalar-fusion.ts), which composes
19
+ * spec bodies without going through {@link emitScalarOp} and needs the same guard.
20
+ */
21
+ export function assertSpecArity(spec) {
22
+ const expected = spec.operands.length + 1;
23
+ if (spec.run.length !== expected) {
24
+ throw new QuereusError(`Internal error: scalar op '${spec.note}' declares ${spec.operands.length} operand(s) `
25
+ + `but its body takes ${spec.run.length - 1}`, StatusCode.INTERNAL);
26
+ }
27
+ }
28
+ /** Emit a spec as the `Instruction` its emitter returned before this factoring. */
29
+ export function emitScalarOp(spec, ctx) {
30
+ assertSpecArity(spec);
31
+ return {
32
+ params: spec.operands.map(operand => emitPlanNode(operand, ctx)),
33
+ run: asRun(spec.run),
34
+ note: spec.note,
35
+ };
36
+ }
37
+ //# sourceMappingURL=scalar-op.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalar-op.js","sourceRoot":"","sources":["../../../../src/runtime/emit/scalar-op.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA4C9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,eAAe,CAAC,IAAkB;IACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1C,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,IAAI,YAAY,CACrB,8BAA8B,IAAI,CAAC,IAAI,cAAc,IAAI,CAAC,QAAQ,CAAC,MAAM,cAAc;cACrF,sBAAsB,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,EAC7C,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;AACF,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,YAAY,CAAC,IAAkB,EAAE,GAAoB;IACpE,eAAe,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO;QACN,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,EAAE,IAAI,CAAC,IAAI;KACf,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAItG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAM9D;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAChC,cAAc,EAAE,UAAU,EAC1B,UAAU,EAAE,cAAc,EAC1B,WAAW,EAAE,QAAQ,EAAE,KACnB,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,WAAW,CAC1B,IAAI,EAAE,WAAW,GAAG,aAAa,GAAG,aAAa,EACjD,GAAG,EAAE,eAAe,EACpB,kBAAkB,CAAC,EAAE,kBAAkB,GACrC,WAAW,CAuJb"}
1
+ {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAItG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQ9D;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAChC,cAAc,EAAE,UAAU,EAC1B,UAAU,EAAE,cAAc,EAC1B,WAAW,EAAE,QAAQ,EAAE,KACnB,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,WAAW,CAC1B,IAAI,EAAE,WAAW,GAAG,aAAa,GAAG,aAAa,EACjD,GAAG,EAAE,eAAe,EACpB,kBAAkB,CAAC,EAAE,kBAAkB,GACrC,WAAW,CAuKb"}
@@ -6,6 +6,8 @@ import { createValidatedInstruction, emitPlanNode } from "../emitters.js";
6
6
  import { disconnectVTable } from "../utils.js";
7
7
  import { buildRowDescriptor } from "../../util/row-descriptor.js";
8
8
  import { createRowSlot } from "../context-helpers.js";
9
+ import { REPR_STRICT } from "../strict-flags.js";
10
+ import { assertRowConforms, RepresentationError } from "../strict-representation.js";
9
11
  /**
10
12
  * Emits instructions for physical table access nodes (SeqScan, IndexScan, IndexSeek).
11
13
  *
@@ -33,6 +35,16 @@ export function emitSeqScan(plan, ctx, filterInfoOverride) {
33
35
  // scan site — a self-join's two scans over the same table get different keys and
34
36
  // therefore isolated instances. Mirrors the executionMemo symbol pattern.
35
37
  const scanConnectionKey = Symbol(`scan:${plan.nodeType}(${schema.name})`);
38
+ // QUEREUS_REPR_STRICT seam: rows leaving a module's `query()`, checked against the
39
+ // table's declared column types. Catches a non-conforming module (in-tree or
40
+ // third-party) at its OWN boundary rather than three layers downstream. Everything
41
+ // the check needs is built here only when the flag is on, so a normal emit allocates
42
+ // nothing on its behalf.
43
+ const reprColumnTypes = REPR_STRICT ? schema.columns.map(col => col.logicalType) : undefined;
44
+ const reprColumnNames = REPR_STRICT ? schema.columns.map(col => col.name) : undefined;
45
+ const reprWhere = REPR_STRICT
46
+ ? `module '${schema.vtabModuleName}' query() row for ${schema.schemaName}.${schema.name}`
47
+ : '';
36
48
  async function* run(runtimeCtx, ...dynamicArgs) {
37
49
  // Use the captured module info instead of doing a fresh lookup
38
50
  const capturedModuleInfo = ctx.getCapturedSchemaObject(moduleKey);
@@ -113,13 +125,19 @@ export function emitSeqScan(plan, ctx, filterInfoOverride) {
113
125
  // checkpoint — the inner scan layers (safeIterate/scanLayer) went sync,
114
126
  // so do not remove it expecting an inner checkpoint to cover the scan.
115
127
  throwIfAborted(runtimeCtx.signal);
128
+ // Synchronous and inside this loop on purpose: enabling the flag must not
129
+ // introduce a microtask hop into the scan's fast path (docs/runtime.md).
130
+ if (REPR_STRICT)
131
+ assertRowConforms(row, reprColumnTypes, reprWhere, reprColumnNames);
116
132
  rowSlot.set(row);
117
133
  yield row;
118
134
  }
119
135
  }
120
136
  catch (e) {
121
137
  // Preserve cancellation identity — don't re-wrap it as a generic query error.
122
- if (e instanceof AbortError)
138
+ // A representation violation is likewise rethrown verbatim: re-wrapping it
139
+ // would bury the seam/column/type detail its message exists to carry.
140
+ if (e instanceof AbortError || e instanceof RepresentationError)
123
141
  throw e;
124
142
  const message = e instanceof Error ? e.message : String(e);
125
143
  throw new QuereusError(`Error during query on table '${schema.name}': ${message}`, e instanceof QuereusError ? e.code : StatusCode.ERROR, e instanceof Error ? e : undefined);
@@ -1 +1 @@
1
- {"version":3,"file":"scan.js","sourceRoot":"","sources":["../../../../src/runtime/emit/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA2B,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAA8B,aAAa,EAAE,MAAM,2CAA2C,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAKlF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,0BAA0B,EAAE,Y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
  import type { SqlValue } from "../../common/types.js";
2
- import type { Instruction } from "../types.js";
3
- import type { BinaryOpNode } from "../../planner/nodes/scalar.js";
4
- import type { EmissionContext } from "../emission-context.js";
5
2
  /**
6
3
  * Try to perform temporal arithmetic on two values.
7
4
  * Returns the result if successful, or undefined if the values are not temporal types.
8
5
  * Throws QuereusError if the operation is invalid.
6
+ *
7
+ * Which combinations exist, what each produces, and what each announces as its result
8
+ * type all live in one table (`types/temporal-ops.ts`) that the planner reads too. This
9
+ * function is the *value-sniffed* entry into that table: it derives both operand kinds
10
+ * from the runtime values, which is the defined behavior whenever the declared types
11
+ * cannot settle the case (a TEXT column holding a duration string, for instance).
9
12
  */
10
13
  export declare function tryTemporalArithmetic(operator: string, v1: SqlValue, v2: SqlValue): SqlValue | undefined;
11
- /**
12
- * Emit temporal arithmetic operations
13
- * Handles operations between temporal types (DATE, TIME, DATETIME, TIMESPAN)
14
- */
15
- export declare function emitTemporalArithmetic(plan: BinaryOpNode, ctx: EmissionContext): Instruction;
16
14
  /**
17
15
  * Attempts to perform temporal comparison. Returns undefined if not a temporal comparison.
18
16
  * This allows the caller to fall back to standard comparison logic.
@@ -24,6 +22,18 @@ export declare function emitTemporalArithmetic(plan: BinaryOpNode, ctx: Emission
24
22
  * Note: DATE, TIME, and DATETIME use ISO 8601 format which compares correctly lexicographically,
25
23
  * so they don't need special handling here.
26
24
  *
25
+ * NOTE: deliberately NOT given the emit-time specialization `buildNumericOpSpec`'s temporal
26
+ * arm got. The shapes look alike, but the economics do not:
27
+ * - the per-row cost here is one `startsWith` per operand, not four regexes — TIMESPAN is
28
+ * the only temporal type whose text order differs from its semantic order, so it is the
29
+ * only one {@link tryTemporalCompare} probes for;
30
+ * - `buildComparisonOpSpec` already bypasses this function for the hot case: two operands
31
+ * of the same semantic-ordering type take the `sharedSemanticType` path
32
+ * (`=(compare-typed)`) and never reach the generic comparison run;
33
+ * - what is left is the mixed TIMESPAN-vs-TEXT/ANY shape, where runtime sniffing is the
34
+ * defined semantics and cannot be resolved from the declared types anyway.
35
+ * Revisit only if a profile shows the generic comparison run hot on temporal operands.
36
+ *
27
37
  * @param operator The comparison operator (=, !=, <, <=, >, >=)
28
38
  * @param v1 First value
29
39
  * @param v2 Second value
@@ -1 +1 @@
1
- {"version":3,"file":"temporal-arithmetic.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/temporal-arithmetic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAmI9D;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAmMxG;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAe5F;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAsBxG;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAKjF"}
1
+ {"version":3,"file":"temporal-arithmetic.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/temporal-arithmetic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUtD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAaxG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAsBxG;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAKjF"}
@@ -1,323 +1,29 @@
1
- import { StatusCode } from "../../common/types.js";
2
- import { QuereusError } from "../../common/errors.js";
3
- import { asRun } from "../types.js";
4
- import { emitPlanNode } from "../emitters.js";
5
- import { Temporal } from 'temporal-polyfill';
6
1
  import { TIMESPAN_TYPE } from "../../types/temporal-types.js";
7
- /**
8
- * Check if a value is a date string (YYYY-MM-DD format)
9
- */
10
- function isDateValue(v) {
11
- if (typeof v !== 'string')
12
- return false;
13
- // Simple check for ISO 8601 date format
14
- return /^\d{4}-\d{2}-\d{2}$/.test(v);
15
- }
16
- /**
17
- * Check if a value is a time string (HH:MM:SS format)
18
- */
19
- function isTimeValue(v) {
20
- if (typeof v !== 'string')
21
- return false;
22
- // Simple check for ISO 8601 time format
23
- return /^\d{2}:\d{2}:\d{2}/.test(v);
24
- }
25
- /**
26
- * Check if a value is a datetime string (ISO 8601 format)
27
- */
28
- function isDateTimeValue(v) {
29
- if (typeof v !== 'string')
30
- return false;
31
- // Check for ISO 8601 datetime format (with T separator)
32
- return v.includes('T') && /^\d{4}-\d{2}-\d{2}T/.test(v);
33
- }
34
- /**
35
- * Check if a value is a timespan/duration string (ISO 8601 duration format)
36
- */
37
- function isTimespanValue(v) {
38
- if (typeof v !== 'string')
39
- return false;
40
- // ISO 8601 duration starts with P (or -P for negative)
41
- return v.startsWith('P') || v.startsWith('-P');
42
- }
43
- /**
44
- * Check if a Temporal.Duration contains calendar units (years, months, weeks)
45
- * that cannot be converted to a single time unit without a relativeTo reference.
46
- */
47
- function hasCalendarUnits(d) {
48
- return d.years !== 0 || d.months !== 0 || d.weeks !== 0;
49
- }
50
- /**
51
- * Scale each field of a duration by a factor.
52
- * Works for both calendar and non-calendar durations.
53
- */
54
- function scaleDuration(d, factor) {
55
- return Temporal.Duration.from({
56
- years: d.years * factor,
57
- months: d.months * factor,
58
- weeks: d.weeks * factor,
59
- days: d.days * factor,
60
- hours: d.hours * factor,
61
- minutes: d.minutes * factor,
62
- seconds: d.seconds * factor,
63
- milliseconds: d.milliseconds * factor,
64
- microseconds: d.microseconds * factor,
65
- nanoseconds: d.nanoseconds * factor,
66
- });
67
- }
68
- /**
69
- * Divide a duration's fields by a divisor, cascading remainders to smaller units.
70
- * Cascade chain: years→months(×12), weeks→days(×7), days→hours(×24),
71
- * hours→minutes(×60), minutes→seconds(×60), seconds→ms(×1000),
72
- * ms→μs(×1000), μs→ns(×1000).
73
- * Note: months cannot cascade to days (variable month length).
74
- */
75
- function divideDuration(d, divisor) {
76
- // Cascade pairs: [field, next-field, conversion-factor]
77
- const cascade = [
78
- ['years', 'months', 12],
79
- // months→days gap: no fixed conversion
80
- ['weeks', 'days', 7],
81
- ['days', 'hours', 24],
82
- ['hours', 'minutes', 60],
83
- ['minutes', 'seconds', 60],
84
- ['seconds', 'milliseconds', 1000],
85
- ['milliseconds', 'microseconds', 1000],
86
- ['microseconds', 'nanoseconds', 1000],
87
- ];
88
- // Build a mutable map of field values
89
- const fields = {
90
- years: d.years, months: d.months, weeks: d.weeks,
91
- days: d.days, hours: d.hours, minutes: d.minutes,
92
- seconds: d.seconds, milliseconds: d.milliseconds,
93
- microseconds: d.microseconds, nanoseconds: d.nanoseconds,
94
- };
95
- for (const [field, nextField, factor] of cascade) {
96
- const value = fields[field];
97
- const quotient = Math.trunc(value / divisor);
98
- const remainder = value - quotient * divisor;
99
- fields[field] = quotient;
100
- fields[nextField] += remainder * factor;
101
- }
102
- // Final field (nanoseconds) — just divide, truncate to integer
103
- fields['nanoseconds'] = Math.trunc(fields['nanoseconds'] / divisor);
104
- // Handle months independently (not part of cascade chain above for months→days)
105
- // months was already accumulated from years cascade; now divide it
106
- const monthQuotient = Math.trunc(fields['months'] / divisor);
107
- const monthRemainder = fields['months'] - monthQuotient * divisor;
108
- fields['months'] = monthQuotient;
109
- // Fractional months can't be converted to days; truncate
110
- if (monthRemainder !== 0) {
111
- // Best-effort: drop sub-month remainder since we can't convert to days
112
- }
113
- return Temporal.Duration.from({
114
- years: fields['years'],
115
- months: fields['months'],
116
- weeks: fields['weeks'],
117
- days: fields['days'],
118
- hours: fields['hours'],
119
- minutes: fields['minutes'],
120
- seconds: fields['seconds'],
121
- milliseconds: fields['milliseconds'],
122
- microseconds: fields['microseconds'],
123
- nanoseconds: fields['nanoseconds'],
124
- });
125
- }
2
+ import { isTemporalKind, runTemporalCase, temporalKindOfValue, temporalOpCase, unsupportedTemporalOp, } from "../../types/temporal-ops.js";
126
3
  /**
127
4
  * Try to perform temporal arithmetic on two values.
128
5
  * Returns the result if successful, or undefined if the values are not temporal types.
129
6
  * Throws QuereusError if the operation is invalid.
7
+ *
8
+ * Which combinations exist, what each produces, and what each announces as its result
9
+ * type all live in one table (`types/temporal-ops.ts`) that the planner reads too. This
10
+ * function is the *value-sniffed* entry into that table: it derives both operand kinds
11
+ * from the runtime values, which is the defined behavior whenever the declared types
12
+ * cannot settle the case (a TEXT column holding a duration string, for instance).
130
13
  */
131
14
  export function tryTemporalArithmetic(operator, v1, v2) {
132
15
  if (v1 === null || v2 === null)
133
16
  return null;
134
- // Detect types at runtime
135
- const isV1Date = isDateValue(v1);
136
- const isV1Time = isTimeValue(v1);
137
- const isV1DateTime = isDateTimeValue(v1);
138
- const isV1Timespan = isTimespanValue(v1);
139
- const isV2Date = isDateValue(v2);
140
- const isV2Time = isTimeValue(v2);
141
- const isV2DateTime = isDateTimeValue(v2);
142
- const isV2Timespan = isTimespanValue(v2);
143
- // If neither operand is temporal, return undefined to signal non-temporal operation
144
- const isV1Temporal = isV1Date || isV1Time || isV1DateTime || isV1Timespan;
145
- const isV2Temporal = isV2Date || isV2Time || isV2DateTime || isV2Timespan;
146
- if (!isV1Temporal && !isV2Temporal) {
17
+ const lk = temporalKindOfValue(v1);
18
+ const rk = temporalKindOfValue(v2);
19
+ // Neither operand looks temporal — signal "not a temporal operation" so the caller
20
+ // falls through to numeric arithmetic. ('number' is a kind, but not a temporal one.)
21
+ if (!isTemporalKind(lk) && !isTemporalKind(rk))
147
22
  return undefined;
148
- }
149
- try {
150
- // DATE/DATETIME - DATE/DATETIME → TIMESPAN
151
- if (operator === '-' &&
152
- (isV1Date || isV1DateTime) &&
153
- (isV2Date || isV2DateTime)) {
154
- // Parse both values as dates
155
- const date1 = isV1DateTime
156
- ? Temporal.PlainDateTime.from(v1).toPlainDate()
157
- : Temporal.PlainDate.from(v1);
158
- const date2 = isV2DateTime
159
- ? Temporal.PlainDateTime.from(v2).toPlainDate()
160
- : Temporal.PlainDate.from(v2);
161
- const duration = date1.since(date2);
162
- return duration.toString();
163
- }
164
- // TIME - TIME → TIMESPAN
165
- if (operator === '-' && isV1Time && isV2Time) {
166
- const time1 = Temporal.PlainTime.from(v1);
167
- const time2 = Temporal.PlainTime.from(v2);
168
- const duration = time1.since(time2);
169
- return duration.toString();
170
- }
171
- // DATE + TIMESPAN → DATE
172
- if (operator === '+' && isV1Date && isV2Timespan) {
173
- const date = Temporal.PlainDate.from(v1);
174
- const duration = Temporal.Duration.from(v2);
175
- const result = date.add(duration);
176
- return result.toString();
177
- }
178
- // TIMESPAN + DATE → DATE (commutative)
179
- if (operator === '+' && isV1Timespan && isV2Date) {
180
- const duration = Temporal.Duration.from(v1);
181
- const date = Temporal.PlainDate.from(v2);
182
- const result = date.add(duration);
183
- return result.toString();
184
- }
185
- // DATE - TIMESPAN → DATE
186
- if (operator === '-' && isV1Date && isV2Timespan) {
187
- const date = Temporal.PlainDate.from(v1);
188
- const duration = Temporal.Duration.from(v2);
189
- const result = date.subtract(duration);
190
- return result.toString();
191
- }
192
- // DATETIME + TIMESPAN → DATETIME
193
- if (operator === '+' && isV1DateTime && isV2Timespan) {
194
- const dt = Temporal.PlainDateTime.from(v1);
195
- const duration = Temporal.Duration.from(v2);
196
- const result = dt.add(duration);
197
- return result.toString();
198
- }
199
- // TIMESPAN + DATETIME → DATETIME (commutative)
200
- if (operator === '+' && isV1Timespan && isV2DateTime) {
201
- const duration = Temporal.Duration.from(v1);
202
- const dt = Temporal.PlainDateTime.from(v2);
203
- const result = dt.add(duration);
204
- return result.toString();
205
- }
206
- // DATETIME - TIMESPAN → DATETIME
207
- if (operator === '-' && isV1DateTime && isV2Timespan) {
208
- const dt = Temporal.PlainDateTime.from(v1);
209
- const duration = Temporal.Duration.from(v2);
210
- const result = dt.subtract(duration);
211
- return result.toString();
212
- }
213
- // TIME + TIMESPAN → TIME
214
- if (operator === '+' && isV1Time && isV2Timespan) {
215
- const time = Temporal.PlainTime.from(v1);
216
- const duration = Temporal.Duration.from(v2);
217
- const result = time.add(duration);
218
- return result.toString();
219
- }
220
- // TIMESPAN + TIME → TIME (commutative)
221
- if (operator === '+' && isV1Timespan && isV2Time) {
222
- const duration = Temporal.Duration.from(v1);
223
- const time = Temporal.PlainTime.from(v2);
224
- const result = time.add(duration);
225
- return result.toString();
226
- }
227
- // TIME - TIMESPAN → TIME
228
- if (operator === '-' && isV1Time && isV2Timespan) {
229
- const time = Temporal.PlainTime.from(v1);
230
- const duration = Temporal.Duration.from(v2);
231
- const result = time.subtract(duration);
232
- return result.toString();
233
- }
234
- // TIMESPAN + TIMESPAN → TIMESPAN
235
- if (operator === '+' && isV1Timespan && isV2Timespan) {
236
- const d1 = Temporal.Duration.from(v1);
237
- const d2 = Temporal.Duration.from(v2);
238
- const result = d1.add(d2);
239
- return result.toString();
240
- }
241
- // TIMESPAN - TIMESPAN → TIMESPAN
242
- if (operator === '-' && isV1Timespan && isV2Timespan) {
243
- const d1 = Temporal.Duration.from(v1);
244
- const d2 = Temporal.Duration.from(v2);
245
- const result = d1.subtract(d2);
246
- return result.toString();
247
- }
248
- // TIMESPAN * NUMBER → TIMESPAN
249
- if (operator === '*' && isV1Timespan && typeof v2 === 'number') {
250
- const duration = Temporal.Duration.from(v1);
251
- if (hasCalendarUnits(duration)) {
252
- return scaleDuration(duration, v2).toString();
253
- }
254
- const totalSeconds = duration.total({ unit: 'seconds' });
255
- const newDuration = Temporal.Duration.from({ seconds: totalSeconds * v2 });
256
- return newDuration.toString();
257
- }
258
- // NUMBER * TIMESPAN → TIMESPAN (commutative)
259
- if (operator === '*' && typeof v1 === 'number' && isV2Timespan) {
260
- const duration = Temporal.Duration.from(v2);
261
- if (hasCalendarUnits(duration)) {
262
- return scaleDuration(duration, v1).toString();
263
- }
264
- const totalSeconds = duration.total({ unit: 'seconds' });
265
- const newDuration = Temporal.Duration.from({ seconds: totalSeconds * v1 });
266
- return newDuration.toString();
267
- }
268
- // TIMESPAN / NUMBER → TIMESPAN
269
- if (operator === '/' && isV1Timespan && typeof v2 === 'number') {
270
- if (v2 === 0)
271
- return null;
272
- const duration = Temporal.Duration.from(v1);
273
- if (hasCalendarUnits(duration)) {
274
- return divideDuration(duration, v2).toString();
275
- }
276
- const totalSeconds = duration.total({ unit: 'seconds' });
277
- const newDuration = Temporal.Duration.from({ seconds: totalSeconds / v2 });
278
- return newDuration.toString();
279
- }
280
- // TIMESPAN / TIMESPAN → NUMBER (ratio)
281
- if (operator === '/' && isV1Timespan && isV2Timespan) {
282
- const d1 = Temporal.Duration.from(v1);
283
- const d2 = Temporal.Duration.from(v2);
284
- if (hasCalendarUnits(d1) || hasCalendarUnits(d2)) {
285
- // Cannot compute a numeric ratio when calendar units are involved
286
- // (months/years have variable lengths without a reference date)
287
- return null;
288
- }
289
- const total1 = d1.total({ unit: 'seconds' });
290
- const total2 = d2.total({ unit: 'seconds' });
291
- if (total2 === 0)
292
- return null;
293
- return total1 / total2;
294
- }
295
- // If we get here, the operation is not supported
296
- throw new QuereusError(`Unsupported temporal operation`, StatusCode.UNSUPPORTED);
297
- }
298
- catch (e) {
299
- // Invalid temporal operation - return null
300
- if (e instanceof QuereusError)
301
- throw e;
302
- return null;
303
- }
304
- }
305
- /**
306
- * Emit temporal arithmetic operations
307
- * Handles operations between temporal types (DATE, TIME, DATETIME, TIMESPAN)
308
- */
309
- export function emitTemporalArithmetic(plan, ctx) {
310
- const operator = plan.expression.operator;
311
- function run(ctx, v1, v2) {
312
- return tryTemporalArithmetic(operator, v1, v2) ?? null;
313
- }
314
- const leftExpr = emitPlanNode(plan.left, ctx);
315
- const rightExpr = emitPlanNode(plan.right, ctx);
316
- return {
317
- params: [leftExpr, rightExpr],
318
- run: asRun(run),
319
- note: `${operator}(temporal)`
320
- };
23
+ const entry = lk && rk ? temporalOpCase(operator, lk, rk) : undefined;
24
+ if (!entry)
25
+ unsupportedTemporalOp();
26
+ return runTemporalCase(entry, v1, v2);
321
27
  }
322
28
  /**
323
29
  * Attempts to perform temporal comparison. Returns undefined if not a temporal comparison.
@@ -330,6 +36,18 @@ export function emitTemporalArithmetic(plan, ctx) {
330
36
  * Note: DATE, TIME, and DATETIME use ISO 8601 format which compares correctly lexicographically,
331
37
  * so they don't need special handling here.
332
38
  *
39
+ * NOTE: deliberately NOT given the emit-time specialization `buildNumericOpSpec`'s temporal
40
+ * arm got. The shapes look alike, but the economics do not:
41
+ * - the per-row cost here is one `startsWith` per operand, not four regexes — TIMESPAN is
42
+ * the only temporal type whose text order differs from its semantic order, so it is the
43
+ * only one {@link tryTemporalCompare} probes for;
44
+ * - `buildComparisonOpSpec` already bypasses this function for the hot case: two operands
45
+ * of the same semantic-ordering type take the `sharedSemanticType` path
46
+ * (`=(compare-typed)`) and never reach the generic comparison run;
47
+ * - what is left is the mixed TIMESPAN-vs-TEXT/ANY shape, where runtime sniffing is the
48
+ * defined semantics and cannot be resolved from the declared types anyway.
49
+ * Revisit only if a profile shows the generic comparison run hot on temporal operands.
50
+ *
333
51
  * @param operator The comparison operator (=, !=, <, <=, >, >=)
334
52
  * @param v1 First value
335
53
  * @param v2 Second value
@@ -367,7 +85,7 @@ export function tryTemporalComparison(operator, v1, v2) {
367
85
  export function tryTemporalCompare(v1, v2) {
368
86
  // Timespans are the only temporal type that needs special comparison logic
369
87
  // because ISO 8601 duration strings don't compare correctly lexicographically
370
- if (!isTimespanValue(v1) || !isTimespanValue(v2))
88
+ if (temporalKindOfValue(v1) !== 'timespan' || temporalKindOfValue(v2) !== 'timespan')
371
89
  return undefined;
372
90
  return TIMESPAN_TYPE.compare(v1, v2);
373
91
  }