@quereus/quereus 2.8.0 → 3.0.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 (454) hide show
  1. package/README.md +224 -222
  2. package/dist/src/core/database-assertions.d.ts +36 -16
  3. package/dist/src/core/database-assertions.d.ts.map +1 -1
  4. package/dist/src/core/database-assertions.js +222 -118
  5. package/dist/src/core/database-assertions.js.map +1 -1
  6. package/dist/src/core/database-transaction.d.ts +96 -13
  7. package/dist/src/core/database-transaction.d.ts.map +1 -1
  8. package/dist/src/core/database-transaction.js +294 -35
  9. package/dist/src/core/database-transaction.js.map +1 -1
  10. package/dist/src/core/database-watchers.d.ts +58 -0
  11. package/dist/src/core/database-watchers.d.ts.map +1 -0
  12. package/dist/src/core/database-watchers.js +206 -0
  13. package/dist/src/core/database-watchers.js.map +1 -0
  14. package/dist/src/core/database.d.ts +78 -5
  15. package/dist/src/core/database.d.ts.map +1 -1
  16. package/dist/src/core/database.js +120 -20
  17. package/dist/src/core/database.js.map +1 -1
  18. package/dist/src/core/statement.d.ts +9 -0
  19. package/dist/src/core/statement.d.ts.map +1 -1
  20. package/dist/src/core/statement.js +29 -0
  21. package/dist/src/core/statement.js.map +1 -1
  22. package/dist/src/core/table-handle.d.ts +45 -0
  23. package/dist/src/core/table-handle.d.ts.map +1 -0
  24. package/dist/src/core/table-handle.js +54 -0
  25. package/dist/src/core/table-handle.js.map +1 -0
  26. package/dist/src/emit/ast-stringify.d.ts.map +1 -1
  27. package/dist/src/emit/ast-stringify.js +0 -3
  28. package/dist/src/emit/ast-stringify.js.map +1 -1
  29. package/dist/src/func/builtins/conversion.d.ts.map +1 -1
  30. package/dist/src/func/builtins/conversion.js +12 -1
  31. package/dist/src/func/builtins/conversion.js.map +1 -1
  32. package/dist/src/func/builtins/explain.d.ts.map +1 -1
  33. package/dist/src/func/builtins/explain.js +22 -8
  34. package/dist/src/func/builtins/explain.js.map +1 -1
  35. package/dist/src/func/builtins/generation.d.ts.map +1 -1
  36. package/dist/src/func/builtins/generation.js +26 -1
  37. package/dist/src/func/builtins/generation.js.map +1 -1
  38. package/dist/src/func/builtins/index.d.ts.map +1 -1
  39. package/dist/src/func/builtins/index.js +5 -1
  40. package/dist/src/func/builtins/index.js.map +1 -1
  41. package/dist/src/func/builtins/json-tvf.d.ts.map +1 -1
  42. package/dist/src/func/builtins/json-tvf.js +16 -2
  43. package/dist/src/func/builtins/json-tvf.js.map +1 -1
  44. package/dist/src/func/builtins/schema.d.ts +4 -0
  45. package/dist/src/func/builtins/schema.d.ts.map +1 -1
  46. package/dist/src/func/builtins/schema.js +270 -11
  47. package/dist/src/func/builtins/schema.js.map +1 -1
  48. package/dist/src/func/registration.d.ts +19 -1
  49. package/dist/src/func/registration.d.ts.map +1 -1
  50. package/dist/src/func/registration.js +8 -3
  51. package/dist/src/func/registration.js.map +1 -1
  52. package/dist/src/index.d.ts +7 -1
  53. package/dist/src/index.d.ts.map +1 -1
  54. package/dist/src/index.js +5 -0
  55. package/dist/src/index.js.map +1 -1
  56. package/dist/src/parser/ast.d.ts +3 -2
  57. package/dist/src/parser/ast.d.ts.map +1 -1
  58. package/dist/src/parser/parser.d.ts.map +1 -1
  59. package/dist/src/parser/parser.js +25 -8
  60. package/dist/src/parser/parser.js.map +1 -1
  61. package/dist/src/planner/analysis/assertion-classifier.d.ts +71 -0
  62. package/dist/src/planner/analysis/assertion-classifier.d.ts.map +1 -0
  63. package/dist/src/planner/analysis/assertion-classifier.js +286 -0
  64. package/dist/src/planner/analysis/assertion-classifier.js.map +1 -0
  65. package/dist/src/planner/analysis/assertion-hoist-cache.d.ts +34 -0
  66. package/dist/src/planner/analysis/assertion-hoist-cache.d.ts.map +1 -0
  67. package/dist/src/planner/analysis/assertion-hoist-cache.js +119 -0
  68. package/dist/src/planner/analysis/assertion-hoist-cache.js.map +1 -0
  69. package/dist/src/planner/analysis/binding-extractor.d.ts +58 -0
  70. package/dist/src/planner/analysis/binding-extractor.d.ts.map +1 -0
  71. package/dist/src/planner/analysis/binding-extractor.js +110 -0
  72. package/dist/src/planner/analysis/binding-extractor.js.map +1 -0
  73. package/dist/src/planner/analysis/change-scope.d.ts +184 -0
  74. package/dist/src/planner/analysis/change-scope.d.ts.map +1 -0
  75. package/dist/src/planner/analysis/change-scope.js +825 -0
  76. package/dist/src/planner/analysis/change-scope.js.map +1 -0
  77. package/dist/src/planner/analysis/check-extraction.d.ts +29 -0
  78. package/dist/src/planner/analysis/check-extraction.d.ts.map +1 -0
  79. package/dist/src/planner/analysis/check-extraction.js +420 -0
  80. package/dist/src/planner/analysis/check-extraction.js.map +1 -0
  81. package/dist/src/planner/analysis/constraint-extractor.d.ts +47 -7
  82. package/dist/src/planner/analysis/constraint-extractor.d.ts.map +1 -1
  83. package/dist/src/planner/analysis/constraint-extractor.js +169 -92
  84. package/dist/src/planner/analysis/constraint-extractor.js.map +1 -1
  85. package/dist/src/planner/analysis/partial-unique-extraction.d.ts +68 -0
  86. package/dist/src/planner/analysis/partial-unique-extraction.d.ts.map +1 -0
  87. package/dist/src/planner/analysis/partial-unique-extraction.js +347 -0
  88. package/dist/src/planner/analysis/partial-unique-extraction.js.map +1 -0
  89. package/dist/src/planner/analysis/predicate-conjuncts.d.ts +14 -0
  90. package/dist/src/planner/analysis/predicate-conjuncts.d.ts.map +1 -0
  91. package/dist/src/planner/analysis/predicate-conjuncts.js +31 -0
  92. package/dist/src/planner/analysis/predicate-conjuncts.js.map +1 -0
  93. package/dist/src/planner/analysis/predicate-shape.d.ts +52 -0
  94. package/dist/src/planner/analysis/predicate-shape.d.ts.map +1 -0
  95. package/dist/src/planner/analysis/predicate-shape.js +119 -0
  96. package/dist/src/planner/analysis/predicate-shape.js.map +1 -0
  97. package/dist/src/planner/analysis/sat-checker.d.ts +43 -0
  98. package/dist/src/planner/analysis/sat-checker.d.ts.map +1 -0
  99. package/dist/src/planner/analysis/sat-checker.js +393 -0
  100. package/dist/src/planner/analysis/sat-checker.js.map +1 -0
  101. package/dist/src/planner/building/foreign-key-builder.d.ts.map +1 -1
  102. package/dist/src/planner/building/foreign-key-builder.js +3 -2
  103. package/dist/src/planner/building/foreign-key-builder.js.map +1 -1
  104. package/dist/src/planner/building/select.js +14 -2
  105. package/dist/src/planner/building/select.js.map +1 -1
  106. package/dist/src/planner/building/table.d.ts.map +1 -1
  107. package/dist/src/planner/building/table.js +1 -1
  108. package/dist/src/planner/building/table.js.map +1 -1
  109. package/dist/src/planner/building/update.d.ts.map +1 -1
  110. package/dist/src/planner/building/update.js +10 -6
  111. package/dist/src/planner/building/update.js.map +1 -1
  112. package/dist/src/planner/framework/characteristics.d.ts +13 -2
  113. package/dist/src/planner/framework/characteristics.d.ts.map +1 -1
  114. package/dist/src/planner/framework/characteristics.js +31 -5
  115. package/dist/src/planner/framework/characteristics.js.map +1 -1
  116. package/dist/src/planner/framework/pass.d.ts.map +1 -1
  117. package/dist/src/planner/framework/pass.js +46 -16
  118. package/dist/src/planner/framework/pass.js.map +1 -1
  119. package/dist/src/planner/framework/physical-utils.d.ts +21 -9
  120. package/dist/src/planner/framework/physical-utils.d.ts.map +1 -1
  121. package/dist/src/planner/framework/physical-utils.js +47 -31
  122. package/dist/src/planner/framework/physical-utils.js.map +1 -1
  123. package/dist/src/planner/nodes/aggregate-node.d.ts +25 -0
  124. package/dist/src/planner/nodes/aggregate-node.d.ts.map +1 -1
  125. package/dist/src/planner/nodes/aggregate-node.js +75 -8
  126. package/dist/src/planner/nodes/aggregate-node.js.map +1 -1
  127. package/dist/src/planner/nodes/alias-node.d.ts.map +1 -1
  128. package/dist/src/planner/nodes/alias-node.js +8 -1
  129. package/dist/src/planner/nodes/alias-node.js.map +1 -1
  130. package/dist/src/planner/nodes/asof-scan-node.d.ts +137 -0
  131. package/dist/src/planner/nodes/asof-scan-node.d.ts.map +1 -0
  132. package/dist/src/planner/nodes/asof-scan-node.js +237 -0
  133. package/dist/src/planner/nodes/asof-scan-node.js.map +1 -0
  134. package/dist/src/planner/nodes/bloom-join-node.d.ts.map +1 -1
  135. package/dist/src/planner/nodes/bloom-join-node.js +19 -9
  136. package/dist/src/planner/nodes/bloom-join-node.js.map +1 -1
  137. package/dist/src/planner/nodes/constraint-check-node.d.ts +3 -0
  138. package/dist/src/planner/nodes/constraint-check-node.d.ts.map +1 -1
  139. package/dist/src/planner/nodes/constraint-check-node.js.map +1 -1
  140. package/dist/src/planner/nodes/distinct-node.d.ts.map +1 -1
  141. package/dist/src/planner/nodes/distinct-node.js +17 -6
  142. package/dist/src/planner/nodes/distinct-node.js.map +1 -1
  143. package/dist/src/planner/nodes/empty-relation-node.d.ts +27 -0
  144. package/dist/src/planner/nodes/empty-relation-node.d.ts.map +1 -0
  145. package/dist/src/planner/nodes/empty-relation-node.js +61 -0
  146. package/dist/src/planner/nodes/empty-relation-node.js.map +1 -0
  147. package/dist/src/planner/nodes/filter.d.ts.map +1 -1
  148. package/dist/src/planner/nodes/filter.js +67 -5
  149. package/dist/src/planner/nodes/filter.js.map +1 -1
  150. package/dist/src/planner/nodes/function.d.ts +11 -1
  151. package/dist/src/planner/nodes/function.d.ts.map +1 -1
  152. package/dist/src/planner/nodes/function.js +94 -1
  153. package/dist/src/planner/nodes/function.js.map +1 -1
  154. package/dist/src/planner/nodes/hash-aggregate.d.ts +1 -1
  155. package/dist/src/planner/nodes/hash-aggregate.d.ts.map +1 -1
  156. package/dist/src/planner/nodes/hash-aggregate.js +10 -6
  157. package/dist/src/planner/nodes/hash-aggregate.js.map +1 -1
  158. package/dist/src/planner/nodes/join-node.d.ts.map +1 -1
  159. package/dist/src/planner/nodes/join-node.js +21 -10
  160. package/dist/src/planner/nodes/join-node.js.map +1 -1
  161. package/dist/src/planner/nodes/join-utils.d.ts +42 -1
  162. package/dist/src/planner/nodes/join-utils.d.ts.map +1 -1
  163. package/dist/src/planner/nodes/join-utils.js +132 -0
  164. package/dist/src/planner/nodes/join-utils.js.map +1 -1
  165. package/dist/src/planner/nodes/limit-offset.d.ts.map +1 -1
  166. package/dist/src/planner/nodes/limit-offset.js +8 -1
  167. package/dist/src/planner/nodes/limit-offset.js.map +1 -1
  168. package/dist/src/planner/nodes/merge-join-node.d.ts.map +1 -1
  169. package/dist/src/planner/nodes/merge-join-node.js +22 -9
  170. package/dist/src/planner/nodes/merge-join-node.js.map +1 -1
  171. package/dist/src/planner/nodes/ordinal-slice-node.d.ts +50 -0
  172. package/dist/src/planner/nodes/ordinal-slice-node.d.ts.map +1 -0
  173. package/dist/src/planner/nodes/ordinal-slice-node.js +130 -0
  174. package/dist/src/planner/nodes/ordinal-slice-node.js.map +1 -0
  175. package/dist/src/planner/nodes/plan-node-type.d.ts +3 -0
  176. package/dist/src/planner/nodes/plan-node-type.d.ts.map +1 -1
  177. package/dist/src/planner/nodes/plan-node-type.js +3 -0
  178. package/dist/src/planner/nodes/plan-node-type.js.map +1 -1
  179. package/dist/src/planner/nodes/plan-node.d.ts +316 -5
  180. package/dist/src/planner/nodes/plan-node.d.ts.map +1 -1
  181. package/dist/src/planner/nodes/plan-node.js +49 -0
  182. package/dist/src/planner/nodes/plan-node.js.map +1 -1
  183. package/dist/src/planner/nodes/project-node.d.ts.map +1 -1
  184. package/dist/src/planner/nodes/project-node.js +78 -28
  185. package/dist/src/planner/nodes/project-node.js.map +1 -1
  186. package/dist/src/planner/nodes/reference.d.ts +27 -2
  187. package/dist/src/planner/nodes/reference.d.ts.map +1 -1
  188. package/dist/src/planner/nodes/reference.js +117 -1
  189. package/dist/src/planner/nodes/reference.js.map +1 -1
  190. package/dist/src/planner/nodes/retrieve-node.d.ts +9 -1
  191. package/dist/src/planner/nodes/retrieve-node.d.ts.map +1 -1
  192. package/dist/src/planner/nodes/retrieve-node.js +21 -0
  193. package/dist/src/planner/nodes/retrieve-node.js.map +1 -1
  194. package/dist/src/planner/nodes/returning-node.d.ts.map +1 -1
  195. package/dist/src/planner/nodes/returning-node.js +64 -28
  196. package/dist/src/planner/nodes/returning-node.js.map +1 -1
  197. package/dist/src/planner/nodes/scalar.d.ts +8 -1
  198. package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
  199. package/dist/src/planner/nodes/scalar.js +112 -1
  200. package/dist/src/planner/nodes/scalar.js.map +1 -1
  201. package/dist/src/planner/nodes/set-operation-node.d.ts +2 -1
  202. package/dist/src/planner/nodes/set-operation-node.d.ts.map +1 -1
  203. package/dist/src/planner/nodes/set-operation-node.js +24 -0
  204. package/dist/src/planner/nodes/set-operation-node.js.map +1 -1
  205. package/dist/src/planner/nodes/single-row.d.ts.map +1 -1
  206. package/dist/src/planner/nodes/single-row.js +3 -1
  207. package/dist/src/planner/nodes/single-row.js.map +1 -1
  208. package/dist/src/planner/nodes/sort.d.ts.map +1 -1
  209. package/dist/src/planner/nodes/sort.js +28 -1
  210. package/dist/src/planner/nodes/sort.js.map +1 -1
  211. package/dist/src/planner/nodes/stream-aggregate.d.ts +1 -1
  212. package/dist/src/planner/nodes/stream-aggregate.d.ts.map +1 -1
  213. package/dist/src/planner/nodes/stream-aggregate.js +10 -8
  214. package/dist/src/planner/nodes/stream-aggregate.js.map +1 -1
  215. package/dist/src/planner/nodes/table-access-nodes.d.ts +40 -5
  216. package/dist/src/planner/nodes/table-access-nodes.d.ts.map +1 -1
  217. package/dist/src/planner/nodes/table-access-nodes.js +113 -18
  218. package/dist/src/planner/nodes/table-access-nodes.js.map +1 -1
  219. package/dist/src/planner/nodes/table-function-call.d.ts +4 -1
  220. package/dist/src/planner/nodes/table-function-call.d.ts.map +1 -1
  221. package/dist/src/planner/nodes/table-function-call.js +224 -14
  222. package/dist/src/planner/nodes/table-function-call.js.map +1 -1
  223. package/dist/src/planner/nodes/update-node.d.ts +1 -3
  224. package/dist/src/planner/nodes/update-node.d.ts.map +1 -1
  225. package/dist/src/planner/nodes/update-node.js +3 -9
  226. package/dist/src/planner/nodes/update-node.js.map +1 -1
  227. package/dist/src/planner/nodes/window-node.d.ts +61 -2
  228. package/dist/src/planner/nodes/window-node.d.ts.map +1 -1
  229. package/dist/src/planner/nodes/window-node.js +71 -3
  230. package/dist/src/planner/nodes/window-node.js.map +1 -1
  231. package/dist/src/planner/optimizer-tuning.d.ts +38 -1
  232. package/dist/src/planner/optimizer-tuning.d.ts.map +1 -1
  233. package/dist/src/planner/optimizer-tuning.js +6 -0
  234. package/dist/src/planner/optimizer-tuning.js.map +1 -1
  235. package/dist/src/planner/optimizer.d.ts.map +1 -1
  236. package/dist/src/planner/optimizer.js +278 -0
  237. package/dist/src/planner/optimizer.js.map +1 -1
  238. package/dist/src/planner/rules/access/rule-asof-strategy-select.d.ts +30 -0
  239. package/dist/src/planner/rules/access/rule-asof-strategy-select.d.ts.map +1 -0
  240. package/dist/src/planner/rules/access/rule-asof-strategy-select.js +112 -0
  241. package/dist/src/planner/rules/access/rule-asof-strategy-select.js.map +1 -0
  242. package/dist/src/planner/rules/access/rule-monotonic-limit-pushdown.d.ts +33 -0
  243. package/dist/src/planner/rules/access/rule-monotonic-limit-pushdown.d.ts.map +1 -0
  244. package/dist/src/planner/rules/access/rule-monotonic-limit-pushdown.js +162 -0
  245. package/dist/src/planner/rules/access/rule-monotonic-limit-pushdown.js.map +1 -0
  246. package/dist/src/planner/rules/access/rule-monotonic-range-access.d.ts +29 -0
  247. package/dist/src/planner/rules/access/rule-monotonic-range-access.d.ts.map +1 -0
  248. package/dist/src/planner/rules/access/rule-monotonic-range-access.js +175 -0
  249. package/dist/src/planner/rules/access/rule-monotonic-range-access.js.map +1 -0
  250. package/dist/src/planner/rules/access/rule-select-access-path.d.ts.map +1 -1
  251. package/dist/src/planner/rules/access/rule-select-access-path.js +53 -17
  252. package/dist/src/planner/rules/access/rule-select-access-path.js.map +1 -1
  253. package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.d.ts +30 -0
  254. package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.d.ts.map +1 -0
  255. package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.js +116 -0
  256. package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.js.map +1 -0
  257. package/dist/src/planner/rules/distinct/rule-distinct-elimination.d.ts +7 -7
  258. package/dist/src/planner/rules/distinct/rule-distinct-elimination.d.ts.map +1 -1
  259. package/dist/src/planner/rules/distinct/rule-distinct-elimination.js +18 -16
  260. package/dist/src/planner/rules/distinct/rule-distinct-elimination.js.map +1 -1
  261. package/dist/src/planner/rules/join/equi-pair-extractor.d.ts +61 -0
  262. package/dist/src/planner/rules/join/equi-pair-extractor.d.ts.map +1 -0
  263. package/dist/src/planner/rules/join/equi-pair-extractor.js +155 -0
  264. package/dist/src/planner/rules/join/equi-pair-extractor.js.map +1 -0
  265. package/dist/src/planner/rules/join/rule-join-elimination.d.ts +56 -0
  266. package/dist/src/planner/rules/join/rule-join-elimination.d.ts.map +1 -0
  267. package/dist/src/planner/rules/join/rule-join-elimination.js +326 -0
  268. package/dist/src/planner/rules/join/rule-join-elimination.js.map +1 -0
  269. package/dist/src/planner/rules/join/rule-join-greedy-commute.d.ts.map +1 -1
  270. package/dist/src/planner/rules/join/rule-join-greedy-commute.js +10 -2
  271. package/dist/src/planner/rules/join/rule-join-greedy-commute.js.map +1 -1
  272. package/dist/src/planner/rules/join/rule-join-physical-selection.d.ts.map +1 -1
  273. package/dist/src/planner/rules/join/rule-join-physical-selection.js +2 -122
  274. package/dist/src/planner/rules/join/rule-join-physical-selection.js.map +1 -1
  275. package/dist/src/planner/rules/join/rule-lateral-top1-asof.d.ts +21 -0
  276. package/dist/src/planner/rules/join/rule-lateral-top1-asof.d.ts.map +1 -0
  277. package/dist/src/planner/rules/join/rule-lateral-top1-asof.js +405 -0
  278. package/dist/src/planner/rules/join/rule-lateral-top1-asof.js.map +1 -0
  279. package/dist/src/planner/rules/join/rule-monotonic-merge-join.d.ts +31 -0
  280. package/dist/src/planner/rules/join/rule-monotonic-merge-join.d.ts.map +1 -0
  281. package/dist/src/planner/rules/join/rule-monotonic-merge-join.js +113 -0
  282. package/dist/src/planner/rules/join/rule-monotonic-merge-join.js.map +1 -0
  283. package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.d.ts +20 -0
  284. package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.d.ts.map +1 -0
  285. package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.js +181 -0
  286. package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.js.map +1 -0
  287. package/dist/src/planner/rules/predicate/rule-empty-relation-folding.d.ts +46 -0
  288. package/dist/src/planner/rules/predicate/rule-empty-relation-folding.d.ts.map +1 -0
  289. package/dist/src/planner/rules/predicate/rule-empty-relation-folding.js +156 -0
  290. package/dist/src/planner/rules/predicate/rule-empty-relation-folding.js.map +1 -0
  291. package/dist/src/planner/rules/predicate/rule-filter-contradiction.d.ts +30 -0
  292. package/dist/src/planner/rules/predicate/rule-filter-contradiction.d.ts.map +1 -0
  293. package/dist/src/planner/rules/predicate/rule-filter-contradiction.js +60 -0
  294. package/dist/src/planner/rules/predicate/rule-filter-contradiction.js.map +1 -0
  295. package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.d.ts +45 -0
  296. package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.d.ts.map +1 -0
  297. package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.js +210 -0
  298. package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.js.map +1 -0
  299. package/dist/src/planner/rules/predicate/rule-sargable-range-rewrite.d.ts +29 -0
  300. package/dist/src/planner/rules/predicate/rule-sargable-range-rewrite.d.ts.map +1 -0
  301. package/dist/src/planner/rules/predicate/rule-sargable-range-rewrite.js +161 -0
  302. package/dist/src/planner/rules/predicate/rule-sargable-range-rewrite.js.map +1 -0
  303. package/dist/src/planner/rules/sort/rule-orderby-fd-pruning.d.ts +39 -0
  304. package/dist/src/planner/rules/sort/rule-orderby-fd-pruning.d.ts.map +1 -0
  305. package/dist/src/planner/rules/sort/rule-orderby-fd-pruning.js +91 -0
  306. package/dist/src/planner/rules/sort/rule-orderby-fd-pruning.js.map +1 -0
  307. package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.d.ts +35 -0
  308. package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.d.ts.map +1 -0
  309. package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.js +74 -0
  310. package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.js.map +1 -0
  311. package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.d.ts +27 -0
  312. package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.d.ts.map +1 -0
  313. package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.js +103 -0
  314. package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.js.map +1 -0
  315. package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.d.ts.map +1 -1
  316. package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.js +1 -25
  317. package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.js.map +1 -1
  318. package/dist/src/planner/rules/window/rule-monotonic-window.d.ts +47 -0
  319. package/dist/src/planner/rules/window/rule-monotonic-window.d.ts.map +1 -0
  320. package/dist/src/planner/rules/window/rule-monotonic-window.js +341 -0
  321. package/dist/src/planner/rules/window/rule-monotonic-window.js.map +1 -0
  322. package/dist/src/planner/scopes/global.js +2 -2
  323. package/dist/src/planner/scopes/global.js.map +1 -1
  324. package/dist/src/planner/type-utils.d.ts.map +1 -1
  325. package/dist/src/planner/type-utils.js +11 -0
  326. package/dist/src/planner/type-utils.js.map +1 -1
  327. package/dist/src/planner/util/fd-utils.d.ts +245 -0
  328. package/dist/src/planner/util/fd-utils.d.ts.map +1 -0
  329. package/dist/src/planner/util/fd-utils.js +1416 -0
  330. package/dist/src/planner/util/fd-utils.js.map +1 -0
  331. package/dist/src/planner/util/ind-utils.d.ts +79 -0
  332. package/dist/src/planner/util/ind-utils.d.ts.map +1 -0
  333. package/dist/src/planner/util/ind-utils.js +146 -0
  334. package/dist/src/planner/util/ind-utils.js.map +1 -0
  335. package/dist/src/planner/util/key-utils.d.ts +75 -14
  336. package/dist/src/planner/util/key-utils.d.ts.map +1 -1
  337. package/dist/src/planner/util/key-utils.js +234 -57
  338. package/dist/src/planner/util/key-utils.js.map +1 -1
  339. package/dist/src/runtime/context-helpers.d.ts +9 -0
  340. package/dist/src/runtime/context-helpers.d.ts.map +1 -1
  341. package/dist/src/runtime/context-helpers.js +5 -0
  342. package/dist/src/runtime/context-helpers.js.map +1 -1
  343. package/dist/src/runtime/delta-executor.d.ts +134 -0
  344. package/dist/src/runtime/delta-executor.d.ts.map +1 -0
  345. package/dist/src/runtime/delta-executor.js +382 -0
  346. package/dist/src/runtime/delta-executor.js.map +1 -0
  347. package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
  348. package/dist/src/runtime/emit/alter-table.js +52 -16
  349. package/dist/src/runtime/emit/alter-table.js.map +1 -1
  350. package/dist/src/runtime/emit/asof-scan.d.ts +10 -0
  351. package/dist/src/runtime/emit/asof-scan.d.ts.map +1 -0
  352. package/dist/src/runtime/emit/asof-scan.js +467 -0
  353. package/dist/src/runtime/emit/asof-scan.js.map +1 -0
  354. package/dist/src/runtime/emit/constraint-check.d.ts.map +1 -1
  355. package/dist/src/runtime/emit/constraint-check.js +20 -0
  356. package/dist/src/runtime/emit/constraint-check.js.map +1 -1
  357. package/dist/src/runtime/emit/create-assertion.d.ts.map +1 -1
  358. package/dist/src/runtime/emit/create-assertion.js +3 -2
  359. package/dist/src/runtime/emit/create-assertion.js.map +1 -1
  360. package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
  361. package/dist/src/runtime/emit/dml-executor.js +40 -13
  362. package/dist/src/runtime/emit/dml-executor.js.map +1 -1
  363. package/dist/src/runtime/emit/drop-assertion.js +1 -1
  364. package/dist/src/runtime/emit/drop-assertion.js.map +1 -1
  365. package/dist/src/runtime/emit/empty-relation.d.ts +5 -0
  366. package/dist/src/runtime/emit/empty-relation.d.ts.map +1 -0
  367. package/dist/src/runtime/emit/empty-relation.js +11 -0
  368. package/dist/src/runtime/emit/empty-relation.js.map +1 -0
  369. package/dist/src/runtime/emit/ordinal-slice.d.ts +13 -0
  370. package/dist/src/runtime/emit/ordinal-slice.d.ts.map +1 -0
  371. package/dist/src/runtime/emit/ordinal-slice.js +89 -0
  372. package/dist/src/runtime/emit/ordinal-slice.js.map +1 -0
  373. package/dist/src/runtime/emit/returning.d.ts.map +1 -1
  374. package/dist/src/runtime/emit/returning.js +9 -4
  375. package/dist/src/runtime/emit/returning.js.map +1 -1
  376. package/dist/src/runtime/emit/scan.d.ts +19 -3
  377. package/dist/src/runtime/emit/scan.d.ts.map +1 -1
  378. package/dist/src/runtime/emit/scan.js +12 -8
  379. package/dist/src/runtime/emit/scan.js.map +1 -1
  380. package/dist/src/runtime/emit/schema-declarative.d.ts.map +1 -1
  381. package/dist/src/runtime/emit/schema-declarative.js +91 -14
  382. package/dist/src/runtime/emit/schema-declarative.js.map +1 -1
  383. package/dist/src/runtime/emit/window.d.ts.map +1 -1
  384. package/dist/src/runtime/emit/window.js +732 -37
  385. package/dist/src/runtime/emit/window.js.map +1 -1
  386. package/dist/src/runtime/foreign-key-actions.d.ts +16 -0
  387. package/dist/src/runtime/foreign-key-actions.d.ts.map +1 -1
  388. package/dist/src/runtime/foreign-key-actions.js +86 -5
  389. package/dist/src/runtime/foreign-key-actions.js.map +1 -1
  390. package/dist/src/runtime/register.d.ts.map +1 -1
  391. package/dist/src/runtime/register.js +6 -0
  392. package/dist/src/runtime/register.js.map +1 -1
  393. package/dist/src/schema/assertion.d.ts +8 -0
  394. package/dist/src/schema/assertion.d.ts.map +1 -1
  395. package/dist/src/schema/catalog.d.ts +10 -0
  396. package/dist/src/schema/catalog.d.ts.map +1 -1
  397. package/dist/src/schema/catalog.js +29 -6
  398. package/dist/src/schema/catalog.js.map +1 -1
  399. package/dist/src/schema/change-events.d.ts +5 -1
  400. package/dist/src/schema/change-events.d.ts.map +1 -1
  401. package/dist/src/schema/change-events.js.map +1 -1
  402. package/dist/src/schema/function.d.ts +89 -1
  403. package/dist/src/schema/function.d.ts.map +1 -1
  404. package/dist/src/schema/function.js +31 -0
  405. package/dist/src/schema/function.js.map +1 -1
  406. package/dist/src/schema/manager.d.ts +43 -0
  407. package/dist/src/schema/manager.d.ts.map +1 -1
  408. package/dist/src/schema/manager.js +105 -4
  409. package/dist/src/schema/manager.js.map +1 -1
  410. package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
  411. package/dist/src/schema/rename-rewriter.js +303 -102
  412. package/dist/src/schema/rename-rewriter.js.map +1 -1
  413. package/dist/src/schema/schema-differ.d.ts +18 -1
  414. package/dist/src/schema/schema-differ.d.ts.map +1 -1
  415. package/dist/src/schema/schema-differ.js +307 -42
  416. package/dist/src/schema/schema-differ.js.map +1 -1
  417. package/dist/src/schema/table.d.ts +21 -2
  418. package/dist/src/schema/table.d.ts.map +1 -1
  419. package/dist/src/schema/table.js +17 -8
  420. package/dist/src/schema/table.js.map +1 -1
  421. package/dist/src/types/logical-type.d.ts +11 -0
  422. package/dist/src/types/logical-type.d.ts.map +1 -1
  423. package/dist/src/types/logical-type.js.map +1 -1
  424. package/dist/src/types/temporal-types.d.ts.map +1 -1
  425. package/dist/src/types/temporal-types.js +32 -0
  426. package/dist/src/types/temporal-types.js.map +1 -1
  427. package/dist/src/util/ast-literal.d.ts +11 -0
  428. package/dist/src/util/ast-literal.d.ts.map +1 -0
  429. package/dist/src/util/ast-literal.js +26 -0
  430. package/dist/src/util/ast-literal.js.map +1 -0
  431. package/dist/src/vtab/best-access-plan.d.ts +41 -0
  432. package/dist/src/vtab/best-access-plan.d.ts.map +1 -1
  433. package/dist/src/vtab/best-access-plan.js +29 -0
  434. package/dist/src/vtab/best-access-plan.js.map +1 -1
  435. package/dist/src/vtab/events.d.ts +9 -0
  436. package/dist/src/vtab/events.d.ts.map +1 -1
  437. package/dist/src/vtab/events.js +19 -0
  438. package/dist/src/vtab/events.js.map +1 -1
  439. package/dist/src/vtab/filter-info.d.ts +14 -0
  440. package/dist/src/vtab/filter-info.d.ts.map +1 -1
  441. package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
  442. package/dist/src/vtab/memory/layer/manager.js +24 -5
  443. package/dist/src/vtab/memory/layer/manager.js.map +1 -1
  444. package/dist/src/vtab/memory/module.d.ts +39 -1
  445. package/dist/src/vtab/memory/module.d.ts.map +1 -1
  446. package/dist/src/vtab/memory/module.js +206 -44
  447. package/dist/src/vtab/memory/module.js.map +1 -1
  448. package/dist/src/vtab/memory/utils/predicate.d.ts +2 -1
  449. package/dist/src/vtab/memory/utils/predicate.d.ts.map +1 -1
  450. package/dist/src/vtab/memory/utils/predicate.js +32 -1
  451. package/dist/src/vtab/memory/utils/predicate.js.map +1 -1
  452. package/dist/src/vtab/module.d.ts +24 -0
  453. package/dist/src/vtab/module.d.ts.map +1 -1
  454. package/package.json +3 -3
package/README.md CHANGED
@@ -1,222 +1,224 @@
1
- # Quereus - A TypeScript SQL Query Processor
2
-
3
- <img src="../../docs/images/Quereus_colored_wide.svg" alt="Quereus Logo" height="150">
4
-
5
- Quereus is a feature-complete SQL query processor specifically designed for efficient in-memory data processing with a strong emphasis on the **virtual table** interface. It provides rich SQL query and constraint capabilities (joins, aggregates, subqueries, CTEs, window functions, constraints) over data sources exposed via the virtual table mechanism. Quereus features a modern type system with temporal types, JSON support, and plugin-extensible custom types. It has no persistent file storage, though one could be built as a virtual table module.
6
-
7
- ## Project Goals
8
-
9
- * **Virtual Table Centric** — provide a robust and flexible virtual table API as the primary means of interacting with data sources. All tables are virtual tables.
10
- * **In-Memory Default** — includes a comprehensive in-memory virtual table implementation (`MemoryTable`) with support for transactions and savepoints.
11
- * **Modern Type System** — extensible logical/physical type separation with built-in temporal types (DATE, TIME, DATETIME), native JSON type with deep equality comparison, and plugin support for custom types. See [Type System Documentation](../../docs/types.md).
12
- * **TypeScript & Modern JS** — leverage TypeScript's type system and modern JavaScript features and idioms.
13
- * **Async VTab Operations** — virtual table data operations (reads/writes) are asynchronous. Cursors are implemented as async iterables.
14
- * **Cross-Platform** — target diverse Javascript runtime environments, including Node.js, browser, and React Native. Plugin loading (via `@quereus/plugin-loader`) uses dynamic `import()` and is not compatible with React Native; use static imports for RN.
15
- * **Minimal Dependencies** — avoid heavy external dependencies where possible.
16
- * **SQL Compatibility** — comprehensive support for modern SQL features including joins, window functions, subqueries, CTEs, constraints, views, and advanced DML/DDL operations.
17
- * **Key-Based Addressing** — all tables are addressed by their defined Primary Key. The concept of a separate, implicit `rowid` for addressing rows is not used.
18
- * **Third Manifesto Friendly** — embraces some of the principles of the [Third Manifesto](https://www.dcs.warwick.ac.uk/~hugh/TTM/DTATRM.pdf), such as allowing for empty keys. Utilizes algebraic planning.
19
-
20
- ## Quick Start
21
-
22
- ```typescript
23
- import { Database } from '@quereus/quereus';
24
-
25
- const db = new Database();
26
-
27
- // Create a table and insert data
28
- await db.exec("create table users (id integer primary key, name text, email text)");
29
- await db.exec("insert into users values (1, 'Alice', 'alice@example.com')");
30
-
31
- // Query returns objects: { id: 1, name: 'Alice', email: 'alice@example.com' }
32
- const user = await db.get("select * from users where id = ?", [1]);
33
- console.log(user.name); // "Alice"
34
-
35
- // Iterate over multiple rows
36
- for await (const row of db.eval("select * from users")) {
37
- console.log(row.name);
38
- }
39
- ```
40
-
41
- ### Reactive Patterns with Event Hooks
42
-
43
- ```typescript
44
- import { Database } from '@quereus/quereus';
45
-
46
- const db = new Database();
47
-
48
- // Subscribe to data changes at the database level
49
- db.onDataChange((event) => {
50
- console.log(`${event.type} on ${event.tableName} (module: ${event.moduleName})`);
51
- if (event.remote) {
52
- console.log('Change came from remote sync');
53
- }
54
- if (event.type === 'update') {
55
- console.log('Changed columns:', event.changedColumns);
56
- }
57
- });
58
-
59
- // Subscribe to schema changes
60
- db.onSchemaChange((event) => {
61
- console.log(`${event.type} ${event.objectType}: ${event.objectName}`);
62
- });
63
-
64
- // Events fire after commit
65
- await db.exec("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)");
66
- // Output: create table: users
67
-
68
- await db.exec("INSERT INTO users VALUES (1, 'Alice')");
69
- // Output: insert on users (module: memory)
70
- ```
71
-
72
- The database-level event system aggregates events from all modules automatically. Events are batched within transactions and delivered only after successful commit.
73
-
74
- SQL values use native JavaScript types (`string`, `number`, `bigint`, `Uint8Array`, `null`). Temporal types are ISO 8601 strings. Results stream as async iterators.
75
-
76
- See the [Usage Guide](../../docs/usage.md) for complete API reference and [Module Authoring Guide](../../docs/module-authoring.md) for event system details.
77
-
78
- ## Platform Support & Storage
79
-
80
- Quereus runs on any JavaScript runtime. For persistent storage, platform-specific plugins provide the `store` virtual table module:
81
-
82
- ### Node.js
83
-
84
- Use [`@quereus/plugin-leveldb`](../quereus-plugin-leveldb/) for LevelDB-based persistent storage with full transaction isolation. Each table becomes a subdirectory under `basePath`:
85
-
86
- ```typescript
87
- import { Database, registerPlugin } from '@quereus/quereus';
88
- import leveldbPlugin from '@quereus/plugin-leveldb/plugin';
89
-
90
- const db = new Database();
91
- await registerPlugin(db, leveldbPlugin, { basePath: './data' }); // ./data/users/, ./data/orders/, etc.
92
-
93
- await db.exec(`create table users (id integer primary key, name text) using store`);
94
-
95
- // Full transaction isolation enabled by default
96
- await db.exec('BEGIN');
97
- await db.exec(`INSERT INTO users VALUES (1, 'Alice')`);
98
- const user = await db.get('SELECT * FROM users WHERE id = 1'); // Sees uncommitted insert
99
- await db.exec('COMMIT');
100
- ```
101
-
102
- ### Browser
103
-
104
- Use [`@quereus/plugin-indexeddb`](../quereus-plugin-indexeddb/) for IndexedDB-based persistent storage with cross-tab sync and full transaction isolation. All tables share one IndexedDB database:
105
-
106
- ```typescript
107
- import { Database, registerPlugin } from '@quereus/quereus';
108
- import indexeddbPlugin from '@quereus/plugin-indexeddb/plugin';
109
-
110
- const db = new Database();
111
- await registerPlugin(db, indexeddbPlugin, { databaseName: 'myapp' }); // IndexedDB database name
112
-
113
- await db.exec(`create table users (id integer primary key, name text) using store`);
114
- ```
115
-
116
- ### React Native
117
-
118
- Use [`@quereus/plugin-react-native-leveldb`](../quereus-plugin-react-native-leveldb/) for fast LevelDB storage with full transaction isolation. Each table becomes a separate LevelDB database with a name prefix:
119
-
120
- ```typescript
121
- import { LevelDB, LevelDBWriteBatch } from 'react-native-leveldb';
122
- import { Database, registerPlugin } from '@quereus/quereus';
123
- import leveldbPlugin from '@quereus/plugin-react-native-leveldb/plugin';
124
-
125
- const db = new Database();
126
- await registerPlugin(db, leveldbPlugin, {
127
- openFn: LevelDB.open,
128
- WriteBatch: LevelDBWriteBatch,
129
- databaseName: 'myapp' // creates myapp_users, myapp_orders, etc.
130
- });
131
-
132
- await db.exec(`create table users (id integer primary key, name text) using store`);
133
- ```
134
-
135
- **Note:** React Native requires runtime polyfills and static plugin loading. See the [plugin README](../quereus-plugin-react-native-leveldb/) for setup details.
136
-
137
- **Required polyfills:**
138
- - `structuredClone` (Quereus uses it internally)
139
- - `TextEncoder` / `TextDecoder` (used by store plugins)
140
- - `Symbol.asyncIterator` (required for async-iterable support; Quereus has a Hermes workaround for AsyncGenerator iterables, but the symbol must exist)
141
-
142
- ### NativeScript
143
-
144
- Use [`@quereus/plugin-nativescript-sqlite`](../quereus-plugin-nativescript-sqlite/) for SQLite-based storage with full transaction isolation. All tables share one SQLite database file:
145
-
146
- ```typescript
147
- import { openOrCreate } from '@nativescript-community/sqlite';
148
- import { Database, registerPlugin } from '@quereus/quereus';
149
- import sqlitePlugin from '@quereus/plugin-nativescript-sqlite/plugin';
150
-
151
- const sqliteDb = openOrCreate('myapp.db'); // SQLite database file
152
- const db = new Database();
153
- await registerPlugin(db, sqlitePlugin, { db: sqliteDb });
154
-
155
- await db.exec(`create table users (id integer primary key, name text) using store`);
156
- ```
157
-
158
- See [Store Documentation](../../docs/store.md) for the storage architecture and custom backend implementation.
159
-
160
- ## Documentation
161
-
162
- **Architecture deep dive:** [Architecture](../../docs/architecture.md) — the pipeline (parser → planner → runtime), source layout, extension patterns, design decisions, constraints model, and testing strategy. Start here if you're working on the engine itself.
163
-
164
- **User & operator docs:**
165
- * [Usage Guide](../../docs/usage.md) — complete API reference (type mappings, parameter binding, logging, tracing, transactions)
166
- * [SQL Reference Guide](../../docs/sql.md) — SQL syntax (includes Declarative Schema)
167
- * [Schema Management](../../docs/schema.md) — SchemaManager API, change events, key types, DDL generation
168
- * [Type System](../../docs/types.md) — logical/physical types, temporal types, JSON, custom types
169
- * [Functions](../../docs/functions.md) — built-in scalar, aggregate, window, and JSON functions
170
- * [Memory Tables](../../docs/memory-table.md) — built-in MemoryTable module
171
- * [Module Authoring](../../docs/module-authoring.md) — virtual table module development and event system
172
- * [Date/Time Handling](../../docs/datetime.md) — temporal parsing, functions, and ISO 8601 formats
173
- * [Runtime](../../docs/runtime.md) — instruction-based execution and opcodes
174
- * [Error Handling](../../docs/errors.md) — error types and status codes
175
- * [Plugin System](../../docs/plugins.md) — virtual tables, functions, and collations
176
- * [Optimizer](../../docs/optimizer.md) / [Optimizer Conventions](../../docs/optimizer-conventions.md)
177
- * [TODO List](../../docs/todo.md) — planned features
178
-
179
- ### Plugin Development
180
-
181
- Quereus exports all critical utilities needed for plugin and module development:
182
-
183
- * **Comparison Functions** — `compareSqlValues`, `compareRows`, `compareTypedValues`, `createTypedComparator` — match Quereus SQL semantics in custom implementations
184
- * **Coercion Utilities** — `tryCoerceToNumber`, `coerceForAggregate` — handle type coercion for aggregates and arithmetic
185
- * **Collation Support** — `registerCollation`, `getCollation`, built-in collations (`BINARY_COLLATION`, `NOCASE_COLLATION`, `RTRIM_COLLATION`)
186
- * **Type System** — full access to logical types, validation, and parsing utilities
187
- * **Event Hooks** — `VTableEventEmitter` interface for mutation and schema change events; enable reactive patterns, caching, and replication
188
- * **DDL Generation** — `generateTableDDL(tableSchema, db?)`, `generateIndexDDL(indexSchema, tableSchema, db?)` canonical `CREATE TABLE` / `CREATE INDEX` output from runtime schema objects. With a `Database`, matches session defaults (schema qualification, `default_column_nullability`, `default_vtab_module`/`default_vtab_args`) for readable output; without one, emits fully-qualified, explicitly-annotated DDL safe for cross-session persistence. See [Schema Management — DDL Generation](../../docs/schema.md#ddl-generation).
189
-
190
- See the [Plugin System documentation](../../docs/plugins.md#comparison-and-coercion-utilities) for complete API reference and examples.
191
-
192
- ## Current Status
193
-
194
- Quereus is a feature-complete SQL query processor with a modern planner and instruction-based runtime architecture. The engine successfully handles complex SQL workloads including joins, window functions, subqueries, CTEs, constraints, and comprehensive DML/DDL operations.
195
-
196
- **Current capabilities include:**
197
- * **Modern Type System** — temporal types (DATE, TIME, DATETIME), JSON with deep equality, plugin-extensible custom types
198
- * **Complete JOIN support** — INNER, LEFT, RIGHT, CROSS, SEMI, and ANTI joins with proper NULL padding
199
- * **Advanced window functions** — ranking, aggregates, and frame specifications
200
- * **Full constraint system** — NOT NULL, CHECK, FOREIGN KEY, and CREATE ASSERTION. Row-level constraints that reference other tables are automatically deferred to COMMIT. The `committed.tablename` pseudo-schema provides read-only access to pre-transaction state for transition constraints (e.g., "balance may not decrease"). See [Architecture — Constraints](../../docs/architecture.md#constraints).
201
- * **Comprehensive subqueries** — scalar, correlated, EXISTS, and IN subqueries
202
- * **Relational orthogonality** — INSERT/UPDATE/DELETE with RETURNING can be used as table sources
203
- * **Complete set operations** — UNION, INTERSECT, EXCEPT with proper deduplication
204
- * **DIFF (symmetric difference)** — `A diff B` equals `(A except B) union (B except A)`, handy for table equality checks via `not exists(A diff B)`
205
- * **Robust transaction support** — multi-level savepoints and rollback. See [Usage Guide](../../docs/usage.md#transactions) for details
206
- * **Rich built-in function library** — scalar, aggregate, window, JSON, and date/time functions
207
- * **Rule-based optimizer** — constant folding, caching, streaming aggregation, bloom-join selection, and correlated subquery decorrelation. See [Architecture — Optimizer](../../docs/architecture.md#optimizer).
208
-
209
- [TODO List](../../docs/todo.md) has remaining priorities.
210
-
211
- ## Supported Built-in Functions
212
-
213
- * **Scalar** `lower`, `upper`, `length`, `substr`/`substring`, `abs`, `round`, `coalesce`, `nullif`, `like`, `glob`, `typeof`
214
- * **Aggregate** — `count`, `sum`, `avg`, `min`, `max`, `group_concat`, `json_group_array`, `json_group_object`
215
- * **Window Functions** — complete implementation with `row_number`, `rank`, `dense_rank`, `ntile` (ranking); `count`, `sum`, `avg`, `min`, `max` with OVER clause (aggregates); full frame specification support (`ROWS BETWEEN`, `UNBOUNDED PRECEDING/FOLLOWING`); `NULLS FIRST/LAST` ordering
216
- * **Date/Time** — `date`, `time`, `datetime`, `julianday`, `strftime` (supports common formats and modifiers), `epoch_s`, `epoch_ms`, `epoch_s_frac` (Unix epoch conversions with strict parsing)
217
- * **JSON** — `json_valid`, `json_schema`, `json_type`, `json_extract`, `json_quote`, `json_array`, `json_object`, `json_insert`, `json_replace`, `json_set`, `json_remove`, `json_array_length`, `json_patch`
218
- * **Query Analysis** — `query_plan`, `scheduler_program`, `execution_trace` (debugging and performance analysis)
219
-
220
- ## Testing
221
-
222
- Tests live in `test/*.spec.ts`, driven by Mocha with ts-node/esm. Run with `yarn test`. Quereus uses SQL logic tests (primary), property-based tests, performance sentinels, unit tests, and a benchmark suite — see [Architecture — Testing Strategy](../../docs/architecture.md#testing-strategy) for details.
1
+ # Quereus - A TypeScript SQL Query Processor
2
+
3
+ <img src="../../docs/images/Quereus_colored_wide.svg" alt="Quereus Logo" height="150">
4
+
5
+ Quereus is a feature-complete SQL query processor specifically designed for efficient in-memory data processing with a strong emphasis on the **virtual table** interface. It provides rich SQL query and constraint capabilities (joins, aggregates, subqueries, CTEs, window functions, constraints) over data sources exposed via the virtual table mechanism. Quereus features a modern type system with temporal types, JSON support, and plugin-extensible custom types. It has no persistent file storage, though one could be built as a virtual table module.
6
+
7
+ ## Project Goals
8
+
9
+ * **Virtual Table Centric** — provide a robust and flexible virtual table API as the primary means of interacting with data sources. All tables are virtual tables.
10
+ * **In-Memory Default** — includes a comprehensive in-memory virtual table implementation (`MemoryTable`) with support for transactions and savepoints.
11
+ * **Modern Type System** — extensible logical/physical type separation with built-in temporal types (DATE, TIME, DATETIME), native JSON type with deep equality comparison, and plugin support for custom types. See [Type System Documentation](../../docs/types.md).
12
+ * **TypeScript & Modern JS** — leverage TypeScript's type system and modern JavaScript features and idioms.
13
+ * **Async VTab Operations** — virtual table data operations (reads/writes) are asynchronous. Cursors are implemented as async iterables.
14
+ * **Cross-Platform** — target diverse Javascript runtime environments, including Node.js, browser, and React Native. Plugin loading (via `@quereus/plugin-loader`) uses dynamic `import()` and is not compatible with React Native; use static imports for RN.
15
+ * **Minimal Dependencies** — avoid heavy external dependencies where possible.
16
+ * **SQL Compatibility** — comprehensive support for modern SQL features including joins, window functions, subqueries, CTEs, constraints, views, and advanced DML/DDL operations.
17
+ * **Key-Based Addressing** — all tables are addressed by their defined Primary Key. The concept of a separate, implicit `rowid` for addressing rows is not used.
18
+ * **Third Manifesto Friendly** — embraces some of the principles of the [Third Manifesto](https://www.dcs.warwick.ac.uk/~hugh/TTM/DTATRM.pdf), such as allowing for empty keys. Utilizes algebraic planning.
19
+
20
+ ## Quick Start
21
+
22
+ ```typescript
23
+ import { Database } from '@quereus/quereus';
24
+
25
+ const db = new Database();
26
+
27
+ // Create a table and insert data
28
+ await db.exec("create table users (id integer primary key, name text, email text)");
29
+ await db.exec("insert into users values (1, 'Alice', 'alice@example.com')");
30
+
31
+ // Query returns objects: { id: 1, name: 'Alice', email: 'alice@example.com' }
32
+ const user = await db.get("select * from users where id = ?", [1]);
33
+ console.log(user.name); // "Alice"
34
+
35
+ // Iterate over multiple rows
36
+ for await (const row of db.eval("select * from users")) {
37
+ console.log(row.name);
38
+ }
39
+ ```
40
+
41
+ ### Reactive Patterns with Event Hooks
42
+
43
+ ```typescript
44
+ import { Database } from '@quereus/quereus';
45
+
46
+ const db = new Database();
47
+
48
+ // Subscribe to data changes at the database level
49
+ db.onDataChange((event) => {
50
+ console.log(`${event.type} on ${event.tableName} (module: ${event.moduleName})`);
51
+ if (event.remote) {
52
+ console.log('Change came from remote sync');
53
+ }
54
+ if (event.type === 'update') {
55
+ console.log('Changed columns:', event.changedColumns);
56
+ }
57
+ });
58
+
59
+ // Subscribe to schema changes
60
+ db.onSchemaChange((event) => {
61
+ console.log(`${event.type} ${event.objectType}: ${event.objectName}`);
62
+ });
63
+
64
+ // Events fire after commit
65
+ await db.exec("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)");
66
+ // Output: create table: users
67
+
68
+ await db.exec("INSERT INTO users VALUES (1, 'Alice')");
69
+ // Output: insert on users (module: memory)
70
+ ```
71
+
72
+ The database-level event system aggregates events from all modules automatically. Events are batched within transactions and delivered only after successful commit.
73
+
74
+ SQL values use native JavaScript types (`string`, `number`, `bigint`, `Uint8Array`, `null`). Temporal types are ISO 8601 strings. Results stream as async iterators.
75
+
76
+ See the [Usage Guide](../../docs/usage.md) for complete API reference and [Module Authoring Guide](../../docs/module-authoring.md) for event system details.
77
+
78
+ ## Platform Support & Storage
79
+
80
+ Quereus runs on any JavaScript runtime. For persistent storage, platform-specific plugins provide the `store` virtual table module:
81
+
82
+ ### Node.js
83
+
84
+ Use [`@quereus/plugin-leveldb`](../quereus-plugin-leveldb/) for LevelDB-based persistent storage with full transaction isolation. Each table becomes a subdirectory under `basePath`:
85
+
86
+ ```typescript
87
+ import { Database, registerPlugin } from '@quereus/quereus';
88
+ import leveldbPlugin from '@quereus/plugin-leveldb/plugin';
89
+
90
+ const db = new Database();
91
+ await registerPlugin(db, leveldbPlugin, { basePath: './data' }); // ./data/users/, ./data/orders/, etc.
92
+
93
+ await db.exec(`create table users (id integer primary key, name text) using store`);
94
+
95
+ // Full transaction isolation enabled by default
96
+ await db.exec('BEGIN');
97
+ await db.exec(`INSERT INTO users VALUES (1, 'Alice')`);
98
+ const user = await db.get('SELECT * FROM users WHERE id = 1'); // Sees uncommitted insert
99
+ await db.exec('COMMIT');
100
+ ```
101
+
102
+ ### Browser
103
+
104
+ Use [`@quereus/plugin-indexeddb`](../quereus-plugin-indexeddb/) for IndexedDB-based persistent storage with cross-tab sync and full transaction isolation. All tables share one IndexedDB database:
105
+
106
+ ```typescript
107
+ import { Database, registerPlugin } from '@quereus/quereus';
108
+ import indexeddbPlugin from '@quereus/plugin-indexeddb/plugin';
109
+
110
+ const db = new Database();
111
+ await registerPlugin(db, indexeddbPlugin, { databaseName: 'myapp' }); // IndexedDB database name
112
+
113
+ await db.exec(`create table users (id integer primary key, name text) using store`);
114
+ ```
115
+
116
+ ### React Native
117
+
118
+ Use [`@quereus/plugin-react-native-leveldb`](../quereus-plugin-react-native-leveldb/) for fast LevelDB storage with full transaction isolation. Each table becomes a separate LevelDB database with a name prefix:
119
+
120
+ ```typescript
121
+ import { LevelDB, LevelDBWriteBatch } from 'react-native-leveldb';
122
+ import { Database, registerPlugin } from '@quereus/quereus';
123
+ import leveldbPlugin from '@quereus/plugin-react-native-leveldb/plugin';
124
+
125
+ const db = new Database();
126
+ await registerPlugin(db, leveldbPlugin, {
127
+ openFn: LevelDB.open,
128
+ WriteBatch: LevelDBWriteBatch,
129
+ databaseName: 'myapp' // creates myapp_users, myapp_orders, etc.
130
+ });
131
+
132
+ await db.exec(`create table users (id integer primary key, name text) using store`);
133
+ ```
134
+
135
+ **Note:** React Native requires runtime polyfills and static plugin loading. See the [plugin README](../quereus-plugin-react-native-leveldb/) for setup details.
136
+
137
+ **Required polyfills:**
138
+ - `structuredClone` (Quereus uses it internally)
139
+ - `TextEncoder` / `TextDecoder` (used by store plugins)
140
+ - `Symbol.asyncIterator` (required for async-iterable support; Quereus has a Hermes workaround for AsyncGenerator iterables, but the symbol must exist)
141
+
142
+ ### NativeScript
143
+
144
+ Use [`@quereus/plugin-nativescript-sqlite`](../quereus-plugin-nativescript-sqlite/) for SQLite-based storage with full transaction isolation. All tables share one SQLite database file:
145
+
146
+ ```typescript
147
+ import { openOrCreate } from '@nativescript-community/sqlite';
148
+ import { Database, registerPlugin } from '@quereus/quereus';
149
+ import sqlitePlugin from '@quereus/plugin-nativescript-sqlite/plugin';
150
+
151
+ const sqliteDb = openOrCreate('myapp.db'); // SQLite database file
152
+ const db = new Database();
153
+ await registerPlugin(db, sqlitePlugin, { db: sqliteDb });
154
+
155
+ await db.exec(`create table users (id integer primary key, name text) using store`);
156
+ ```
157
+
158
+ See [Store Documentation](../../docs/store.md) for the storage architecture and custom backend implementation.
159
+
160
+ ## Documentation
161
+
162
+ **Architecture deep dive:** [Architecture](../../docs/architecture.md) — the pipeline (parser → planner → runtime), source layout, extension patterns, design decisions, constraints model, and testing strategy. Start here if you're working on the engine itself.
163
+
164
+ **User & operator docs:**
165
+ * [Usage Guide](../../docs/usage.md) — complete API reference (type mappings, parameter binding, logging, tracing, transactions)
166
+ * [SQL Reference Guide](../../docs/sql.md) — SQL syntax (includes Declarative Schema)
167
+ * [Schema Management](../../docs/schema.md) — SchemaManager API, change events, key types, DDL generation
168
+ * [Type System](../../docs/types.md) — logical/physical types, temporal types, JSON, custom types
169
+ * [Functions](../../docs/functions.md) — built-in scalar, aggregate, window, and JSON functions
170
+ * [Memory Tables](../../docs/memory-table.md) — built-in MemoryTable module
171
+ * [Module Authoring](../../docs/module-authoring.md) — virtual table module development and event system
172
+ * [Date/Time Handling](../../docs/datetime.md) — temporal parsing, functions, and ISO 8601 formats
173
+ * [Runtime](../../docs/runtime.md) — instruction-based execution and opcodes
174
+ * [Error Handling](../../docs/errors.md) — error types and status codes
175
+ * [Plugin System](../../docs/plugins.md) — virtual tables, functions, and collations
176
+ * [Optimizer](../../docs/optimizer.md) / [Optimizer Conventions](../../docs/optimizer-conventions.md)
177
+ * [Change-scope Introspection](../../docs/change-scope.md) — what a prepared statement reads from
178
+ * [TODO List](../../docs/todo.md) — planned features
179
+
180
+ ### Plugin Development
181
+
182
+ Quereus exports all critical utilities needed for plugin and module development:
183
+
184
+ * **Comparison Functions** — `compareSqlValues`, `compareRows`, `compareTypedValues`, `createTypedComparator` match Quereus SQL semantics in custom implementations
185
+ * **Coercion Utilities** — `tryCoerceToNumber`, `coerceForAggregate` handle type coercion for aggregates and arithmetic
186
+ * **Collation Support** — `registerCollation`, `getCollation`, built-in collations (`BINARY_COLLATION`, `NOCASE_COLLATION`, `RTRIM_COLLATION`)
187
+ * **Type System** — full access to logical types, validation, and parsing utilities
188
+ * **Event Hooks** — `VTableEventEmitter` interface for mutation and schema change events; enable reactive patterns, caching, and replication
189
+ * **DDL Generation** — `generateTableDDL(tableSchema, db?)`, `generateIndexDDL(indexSchema, tableSchema, db?)` — canonical `CREATE TABLE` / `CREATE INDEX` output from runtime schema objects. With a `Database`, matches session defaults (schema qualification, `default_column_nullability`, `default_vtab_module`/`default_vtab_args`) for readable output; without one, emits fully-qualified, explicitly-annotated DDL safe for cross-session persistence. See [Schema Management — DDL Generation](../../docs/schema.md#ddl-generation).
190
+
191
+ See the [Plugin System documentation](../../docs/plugins.md#comparison-and-coercion-utilities) for complete API reference and examples.
192
+
193
+ ## Current Status
194
+
195
+ Quereus is a feature-complete SQL query processor with a modern planner and instruction-based runtime architecture. The engine successfully handles complex SQL workloads including joins, window functions, subqueries, CTEs, constraints, and comprehensive DML/DDL operations.
196
+
197
+ **Current capabilities include:**
198
+ * **Modern Type System** — temporal types (DATE, TIME, DATETIME), JSON with deep equality, plugin-extensible custom types
199
+ * **Complete JOIN support** — INNER, LEFT, RIGHT, CROSS, SEMI, and ANTI joins with proper NULL padding
200
+ * **Advanced window functions** — ranking, aggregates, and frame specifications
201
+ * **Full constraint system** — NOT NULL, CHECK, FOREIGN KEY, and CREATE ASSERTION. Row-level constraints that reference other tables are automatically deferred to COMMIT. The `committed.tablename` pseudo-schema provides read-only access to pre-transaction state for transition constraints (e.g., "balance may not decrease"). See [Architecture — Constraints](../../docs/architecture.md#constraints).
202
+ * **Comprehensive subqueries** — scalar, correlated, EXISTS, and IN subqueries
203
+ * **Relational orthogonality** — INSERT/UPDATE/DELETE with RETURNING can be used as table sources
204
+ * **Complete set operations** — UNION, INTERSECT, EXCEPT with proper deduplication
205
+ * **DIFF (symmetric difference)** — `A diff B` equals `(A except B) union (B except A)`, handy for table equality checks via `not exists(A diff B)`
206
+ * **Robust transaction support** — multi-level savepoints and rollback. See [Usage Guide](../../docs/usage.md#transactions) for details
207
+ * **Rich built-in function library** — scalar, aggregate, window, JSON, and date/time functions
208
+ * **Rule-based optimizer** — constant folding, caching, streaming aggregation, bloom-join selection, and correlated subquery decorrelation. See [Architecture — Optimizer](../../docs/architecture.md#optimizer).
209
+ * **Change-scope introspection and reactive subscriptions** — `Statement.getChangeScope()` returns a JSON-serializable description of what base-table state and external inputs a prepared statement reads from. The companion `Database.watch(scope, handler)` consumes any `ChangeScope` value (analyzed, deserialized, or hand-built) and fires a post-commit callback whenever matching rows, groups, or tables change. See [Change-scope Documentation](../../docs/change-scope.md).
210
+
211
+ [TODO List](../../docs/todo.md) has remaining priorities.
212
+
213
+ ## Supported Built-in Functions
214
+
215
+ * **Scalar** — `lower`, `upper`, `length`, `substr`/`substring`, `abs`, `round`, `coalesce`, `nullif`, `like`, `glob`, `typeof`
216
+ * **Aggregate** — `count`, `sum`, `avg`, `min`, `max`, `group_concat`, `json_group_array`, `json_group_object`
217
+ * **Window Functions** — complete implementation with `row_number`, `rank`, `dense_rank`, `ntile` (ranking); `count`, `sum`, `avg`, `min`, `max` with OVER clause (aggregates); full frame specification support (`ROWS BETWEEN`, `UNBOUNDED PRECEDING/FOLLOWING`); `NULLS FIRST/LAST` ordering
218
+ * **Date/Time** — `date`, `time`, `datetime`, `julianday`, `strftime` (supports common formats and modifiers), `epoch_s`, `epoch_ms`, `epoch_s_frac` (Unix epoch conversions with strict parsing)
219
+ * **JSON** — `json_valid`, `json_schema`, `json_type`, `json_extract`, `json_quote`, `json_array`, `json_object`, `json_insert`, `json_replace`, `json_set`, `json_remove`, `json_array_length`, `json_patch`
220
+ * **Query Analysis** — `query_plan`, `scheduler_program`, `execution_trace` (debugging and performance analysis)
221
+
222
+ ## Testing
223
+
224
+ Tests live in `test/*.spec.ts`, driven by Mocha with ts-node/esm. Run with `yarn test`. Quereus uses SQL logic tests (primary), property-based tests, performance sentinels, unit tests, and a benchmark suite — see [Architecture — Testing Strategy](../../docs/architecture.md#testing-strategy) for details.
@@ -1,13 +1,16 @@
1
1
  /**
2
2
  * Global assertion evaluation for deferred constraint checking.
3
3
  *
4
- * This module handles the evaluation of CREATE ASSERTION constraints at transaction
5
- * commit time. It optimizes assertion checking by:
4
+ * This module handles the evaluation of CREATE ASSERTION constraints at
5
+ * transaction commit time. It optimizes assertion checking by:
6
6
  * - Only evaluating assertions impacted by changed tables
7
- * - Caching compiled plans and classifications across commits
7
+ * - Caching compiled plans, classifications, and residual variants across commits
8
8
  * - Invalidating cached plans on schema changes
9
- * - Using row-specific filtering when possible to avoid full table scans
10
- * - Injecting PK filters for parameterized per-row evaluation
9
+ * - Driving per-binding execution through the reusable `DeltaExecutor` kernel
10
+ *
11
+ * Assertions are the first consumer of `DeltaExecutor`. Materialized views,
12
+ * reactive signals, and triggers will plug in by registering their own
13
+ * `DeltaSubscription`s.
11
14
  */
12
15
  import { type SqlValue } from '../common/types.js';
13
16
  import * as AST from '../parser/ast.js';
@@ -28,16 +31,22 @@ export interface AssertionEvaluatorContext {
28
31
  getChangedBaseTables(): Set<string>;
29
32
  /** Get changed PK tuples for a specific base table */
30
33
  getChangedKeyTuples(base: string): SqlValue[][];
34
+ /** Get changed projected tuples for a specific base table */
35
+ getChangedTuples(base: string, columnIndices: readonly number[], pkIndices: readonly number[]): SqlValue[][];
36
+ /** Register a column-projection capture spec for a base table */
37
+ registerCaptureSpec(baseTable: string, spec: {
38
+ extraColumns: ReadonlySet<number>;
39
+ }): () => void;
31
40
  }
32
41
  /**
33
42
  * Evaluates global assertions (CREATE ASSERTION) at transaction commit time.
34
43
  *
35
44
  * Assertions are evaluated only when the tables they reference have been modified.
36
- * The evaluator uses constraint analysis to determine whether assertions can be
37
- * checked per-row (more efficient) or require a full violation query.
45
+ * The evaluator uses binding analysis to determine whether assertions can be
46
+ * checked per-row, per-group, or require a full violation query.
38
47
  *
39
- * Compiled plans are cached and invalidated on schema changes to avoid
40
- * re-parsing/re-planning on every commit.
48
+ * Compiled plans and residual variants are cached and invalidated on schema
49
+ * changes to avoid re-parsing/re-planning on every commit.
41
50
  */
42
51
  export declare class AssertionEvaluator {
43
52
  private readonly ctx;
@@ -47,25 +56,36 @@ export declare class AssertionEvaluator {
47
56
  private schemaGeneration;
48
57
  /** Unsubscribe function for schema change listener */
49
58
  private unsubscribeSchemaChanges;
59
+ /** The shared delta dispatcher */
60
+ private readonly executor;
50
61
  constructor(ctx: AssertionEvaluatorContext);
51
62
  private subscribeToSchemaChanges;
52
63
  /** Remove an assertion from the plan cache (called on DROP ASSERTION) */
53
64
  invalidateAssertion(name: string): void;
54
65
  /** Unsubscribe from schema changes and clear cached plans */
55
66
  dispose(): void;
67
+ private releaseCached;
56
68
  /**
57
- * Run all global assertions that are impacted by changes in the current transaction.
58
- * @throws QuereusError with CONSTRAINT status if any assertion is violated
69
+ * Run all global assertions impacted by changes in the current transaction.
70
+ * The DeltaExecutor walks all live subscriptions; assertion subscriptions
71
+ * dispatch their own residual scheduler per binding tuple.
72
+ *
73
+ * @throws QuereusError with CONSTRAINT status if any assertion is violated.
59
74
  */
60
75
  runGlobalAssertions(): Promise<void>;
61
76
  private getOrCompilePlan;
62
- private evaluateAssertion;
77
+ private compileUnderSuppression;
78
+ private buildSubscription;
63
79
  private executeViolationOnce;
64
- private executeViolationPerChangedKeys;
80
+ private executeResidualPerTuple;
65
81
  private buildViolationError;
66
- private injectPkFilter;
67
- private rewriteForPkFilter;
82
+ /**
83
+ * Inject a key-equality filter onto the `TableReferenceNode` matching
84
+ * `targetRelationKey`. Used for both `'row'` (with PK columns + 'pk' prefix)
85
+ * and `'group'` (with group-key columns + 'gk' prefix).
86
+ */
87
+ private injectKeyFilter;
88
+ private rewriteForKeyFilter;
68
89
  private tryWrapTableReference;
69
- private collectTables;
70
90
  }
71
91
  //# sourceMappingURL=database-assertions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"database-assertions.d.ts","sourceRoot":"","sources":["../../../src/core/database-assertions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI/D,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAaxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQ9C;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAClD,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEtC,UAAU,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,OAAO,eAAe,EAAE,eAAe,CAAC;IACjF,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,oBAAoB,IAAI,UAAU,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAErE,qEAAqE;IACrE,oBAAoB,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,sDAAsD;IACtD,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,CAAC;CAChD;AAwBD;;;;;;;;;GASG;AACH,qBAAa,kBAAkB;IAQlB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAPhC,gEAAgE;IAChE,OAAO,CAAC,KAAK,CAA0C;IACvD,6FAA6F;IAC7F,OAAO,CAAC,gBAAgB,CAAK;IAC7B,sDAAsD;IACtD,OAAO,CAAC,wBAAwB,CAA6B;gBAEhC,GAAG,EAAE,yBAAyB;IAI3D,OAAO,CAAC,wBAAwB;IAUhC,yEAAyE;IACzE,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIvC,6DAA6D;IAC7D,OAAO,IAAI,IAAI;IAQf;;;OAGG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAY1C,OAAO,CAAC,gBAAgB;YA+DV,iBAAiB;YA+DjB,oBAAoB;YAkBpB,8BAA8B;IAmC5C,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,qBAAqB;IAiD7B,OAAO,CAAC,aAAa;CAYrB"}
1
+ {"version":3,"file":"database-assertions.d.ts","sourceRoot":"","sources":["../../../src/core/database-assertions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI/D,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAcxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQ9C;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAClD,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEtC,UAAU,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,OAAO,eAAe,EAAE,eAAe,CAAC;IACjF,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,oBAAoB,IAAI,UAAU,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAErE,qEAAqE;IACrE,oBAAoB,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,sDAAsD;IACtD,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,CAAC;IAChD,6DAA6D;IAC7D,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,QAAQ,EAAE,EAAE,CAAC;IAC7G,iEAAiE;IACjE,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;KAAE,GAAG,MAAM,IAAI,CAAC;CAChG;AAwCD;;;;;;;;;GASG;AACH,qBAAa,kBAAkB;IAUlB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAThC,gEAAgE;IAChE,OAAO,CAAC,KAAK,CAA0C;IACvD,6FAA6F;IAC7F,OAAO,CAAC,gBAAgB,CAAK;IAC7B,sDAAsD;IACtD,OAAO,CAAC,wBAAwB,CAA6B;IAC7D,kCAAkC;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;gBAEZ,GAAG,EAAE,yBAAyB;IAe3D,OAAO,CAAC,wBAAwB;IAUhC,yEAAyE;IACzE,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IASvC,6DAA6D;IAC7D,OAAO,IAAI,IAAI;IAYf,OAAO,CAAC,aAAa;IAMrB;;;;;;OAMG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4B1C,OAAO,CAAC,gBAAgB;IAiCxB,OAAO,CAAC,uBAAuB;IA+F/B,OAAO,CAAC,iBAAiB;YAwCX,oBAAoB;YAsBpB,uBAAuB;IAkCrC,OAAO,CAAC,mBAAmB;IAS3B;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,qBAAqB;CA2E7B"}