@uwdata/mosaic-sql 0.17.0 → 0.19.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 (429) hide show
  1. package/LICENSE +47 -0
  2. package/README.md +0 -2
  3. package/dist/src/ast/aggregate.d.ts +82 -0
  4. package/dist/src/ast/aggregate.d.ts.map +1 -0
  5. package/dist/src/ast/aggregate.js +180 -0
  6. package/dist/src/ast/aggregate.js.map +1 -0
  7. package/dist/src/ast/between-op.d.ts +46 -0
  8. package/dist/src/ast/between-op.d.ts.map +1 -0
  9. package/dist/src/ast/between-op.js +60 -0
  10. package/dist/src/ast/between-op.js.map +1 -0
  11. package/dist/src/ast/binary-op.d.ts +21 -0
  12. package/dist/src/ast/binary-op.d.ts.map +1 -0
  13. package/dist/src/ast/binary-op.js +29 -0
  14. package/dist/src/ast/binary-op.js.map +1 -0
  15. package/dist/src/ast/case.d.ts +53 -0
  16. package/dist/src/ast/case.d.ts.map +1 -0
  17. package/dist/src/ast/case.js +75 -0
  18. package/dist/src/ast/case.js.map +1 -0
  19. package/dist/src/ast/cast.d.ts +18 -0
  20. package/dist/src/ast/cast.d.ts.map +1 -0
  21. package/dist/src/ast/cast.js +26 -0
  22. package/dist/src/ast/cast.js.map +1 -0
  23. package/dist/src/ast/collate.d.ts +18 -0
  24. package/dist/src/ast/collate.d.ts.map +1 -0
  25. package/dist/src/ast/collate.js +25 -0
  26. package/dist/src/ast/collate.js.map +1 -0
  27. package/dist/src/ast/column-param.d.ts +23 -0
  28. package/dist/src/ast/column-param.d.ts.map +1 -0
  29. package/dist/src/ast/column-param.js +29 -0
  30. package/dist/src/ast/column-param.js.map +1 -0
  31. package/dist/src/ast/column-ref.d.ts +40 -0
  32. package/dist/src/ast/column-ref.d.ts.map +1 -0
  33. package/dist/src/ast/column-ref.js +58 -0
  34. package/dist/src/ast/column-ref.js.map +1 -0
  35. package/dist/src/ast/fragment.d.ts +20 -0
  36. package/dist/src/ast/fragment.d.ts.map +1 -0
  37. package/dist/src/ast/fragment.js +26 -0
  38. package/dist/src/ast/fragment.js.map +1 -0
  39. package/dist/src/ast/from.d.ts +22 -0
  40. package/dist/src/ast/from.d.ts.map +1 -0
  41. package/dist/src/ast/from.js +37 -0
  42. package/dist/src/ast/from.js.map +1 -0
  43. package/dist/src/ast/function.d.ts +18 -0
  44. package/dist/src/ast/function.d.ts.map +1 -0
  45. package/dist/src/ast/function.js +26 -0
  46. package/dist/src/ast/function.js.map +1 -0
  47. package/dist/src/ast/in-op.d.ts +18 -0
  48. package/dist/src/ast/in-op.d.ts.map +1 -0
  49. package/dist/src/ast/in-op.js +25 -0
  50. package/dist/src/ast/in-op.js.map +1 -0
  51. package/dist/src/ast/interval.d.ts +18 -0
  52. package/dist/src/ast/interval.d.ts.map +1 -0
  53. package/dist/src/ast/interval.js +25 -0
  54. package/dist/src/ast/interval.js.map +1 -0
  55. package/dist/src/ast/list.d.ts +15 -0
  56. package/dist/src/ast/list.d.ts.map +1 -0
  57. package/dist/src/ast/list.js +21 -0
  58. package/dist/src/ast/list.js.map +1 -0
  59. package/dist/src/ast/literal.d.ts +16 -0
  60. package/dist/src/ast/literal.d.ts.map +1 -0
  61. package/dist/src/ast/literal.js +53 -0
  62. package/dist/src/ast/literal.js.map +1 -0
  63. package/dist/src/ast/logical-op.d.ts +32 -0
  64. package/dist/src/ast/logical-op.d.ts.map +1 -0
  65. package/dist/src/ast/logical-op.js +46 -0
  66. package/dist/src/ast/logical-op.js.map +1 -0
  67. package/dist/src/ast/node.d.ts +25 -0
  68. package/dist/src/ast/node.d.ts.map +1 -0
  69. package/dist/src/ast/node.js +36 -0
  70. package/dist/src/ast/node.js.map +1 -0
  71. package/dist/src/ast/order-by.d.ts +21 -0
  72. package/dist/src/ast/order-by.d.ts.map +1 -0
  73. package/dist/src/ast/order-by.js +36 -0
  74. package/dist/src/ast/order-by.js.map +1 -0
  75. package/dist/src/ast/param.d.ts +20 -0
  76. package/dist/src/ast/param.d.ts.map +1 -0
  77. package/dist/src/ast/param.js +28 -0
  78. package/dist/src/ast/param.js.map +1 -0
  79. package/dist/src/ast/query.d.ts +334 -0
  80. package/dist/src/ast/query.d.ts.map +1 -0
  81. package/dist/src/ast/query.js +640 -0
  82. package/dist/src/ast/query.js.map +1 -0
  83. package/dist/src/ast/sample.d.ts +27 -0
  84. package/dist/src/ast/sample.d.ts.map +1 -0
  85. package/dist/src/ast/sample.js +38 -0
  86. package/dist/src/ast/sample.js.map +1 -0
  87. package/dist/src/ast/select.d.ts +19 -0
  88. package/dist/src/ast/select.d.ts.map +1 -0
  89. package/dist/src/ast/select.js +35 -0
  90. package/dist/src/ast/select.js.map +1 -0
  91. package/dist/src/ast/subquery.d.ts +16 -0
  92. package/dist/src/ast/subquery.d.ts.map +1 -0
  93. package/dist/src/ast/subquery.js +21 -0
  94. package/dist/src/ast/subquery.js.map +1 -0
  95. package/dist/src/ast/table-ref.d.ts +24 -0
  96. package/dist/src/ast/table-ref.d.ts.map +1 -0
  97. package/dist/src/ast/table-ref.js +35 -0
  98. package/dist/src/ast/table-ref.js.map +1 -0
  99. package/dist/src/ast/unary-op.d.ts +40 -0
  100. package/dist/src/ast/unary-op.d.ts.map +1 -0
  101. package/dist/src/ast/unary-op.js +52 -0
  102. package/dist/src/ast/unary-op.js.map +1 -0
  103. package/dist/src/ast/unnest.d.ts +19 -0
  104. package/dist/src/ast/unnest.d.ts.map +1 -0
  105. package/dist/src/ast/unnest.js +29 -0
  106. package/dist/src/ast/unnest.js.map +1 -0
  107. package/dist/src/ast/verbatim.d.ts +18 -0
  108. package/dist/src/ast/verbatim.d.ts.map +1 -0
  109. package/dist/src/ast/verbatim.js +25 -0
  110. package/dist/src/ast/verbatim.js.map +1 -0
  111. package/dist/src/ast/window-frame.d.ts +54 -0
  112. package/dist/src/ast/window-frame.d.ts.map +1 -0
  113. package/dist/src/ast/window-frame.js +79 -0
  114. package/dist/src/ast/window-frame.js.map +1 -0
  115. package/dist/src/ast/window.d.ts +128 -0
  116. package/dist/src/ast/window.d.ts.map +1 -0
  117. package/dist/src/ast/window.js +194 -0
  118. package/dist/src/ast/window.js.map +1 -0
  119. package/dist/src/ast/with.d.ts +25 -0
  120. package/dist/src/ast/with.d.ts.map +1 -0
  121. package/dist/src/ast/with.js +36 -0
  122. package/dist/src/ast/with.js.map +1 -0
  123. package/dist/src/constants.d.ts +40 -0
  124. package/dist/src/constants.d.ts.map +1 -0
  125. package/dist/src/constants.js +40 -0
  126. package/dist/src/constants.js.map +1 -0
  127. package/dist/src/functions/aggregate.d.ts +236 -0
  128. package/dist/src/functions/aggregate.d.ts.map +1 -0
  129. package/dist/src/functions/aggregate.js +308 -0
  130. package/dist/src/functions/aggregate.js.map +1 -0
  131. package/dist/src/functions/case.d.ts +13 -0
  132. package/dist/src/functions/case.d.ts.map +1 -0
  133. package/dist/src/functions/case.js +17 -0
  134. package/dist/src/functions/case.js.map +1 -0
  135. package/dist/src/functions/cast.d.ts +23 -0
  136. package/dist/src/functions/cast.d.ts.map +1 -0
  137. package/dist/src/functions/cast.js +32 -0
  138. package/dist/src/functions/cast.js.map +1 -0
  139. package/dist/src/functions/collate.d.ts +10 -0
  140. package/dist/src/functions/collate.d.ts.map +1 -0
  141. package/dist/src/functions/collate.js +12 -0
  142. package/dist/src/functions/collate.js.map +1 -0
  143. package/dist/src/functions/column.d.ts +10 -0
  144. package/dist/src/functions/column.d.ts.map +1 -0
  145. package/dist/src/functions/column.js +17 -0
  146. package/dist/src/functions/column.js.map +1 -0
  147. package/dist/src/functions/cte.d.ts +13 -0
  148. package/dist/src/functions/cte.d.ts.map +1 -0
  149. package/dist/src/functions/cte.js +14 -0
  150. package/dist/src/functions/cte.js.map +1 -0
  151. package/dist/src/functions/datetime.d.ts +32 -0
  152. package/dist/src/functions/datetime.d.ts.map +1 -0
  153. package/dist/src/functions/datetime.js +45 -0
  154. package/dist/src/functions/datetime.js.map +1 -0
  155. package/dist/src/functions/interval.d.ts +48 -0
  156. package/dist/src/functions/interval.d.ts.map +1 -0
  157. package/dist/src/functions/interval.js +66 -0
  158. package/dist/src/functions/interval.js.map +1 -0
  159. package/dist/src/functions/list.d.ts +31 -0
  160. package/dist/src/functions/list.d.ts.map +1 -0
  161. package/dist/src/functions/list.js +49 -0
  162. package/dist/src/functions/list.js.map +1 -0
  163. package/dist/src/functions/literal.d.ts +16 -0
  164. package/dist/src/functions/literal.d.ts.map +1 -0
  165. package/dist/src/functions/literal.js +20 -0
  166. package/dist/src/functions/literal.js.map +1 -0
  167. package/dist/src/functions/numeric.d.ts +80 -0
  168. package/dist/src/functions/numeric.d.ts.map +1 -0
  169. package/dist/src/functions/numeric.js +110 -0
  170. package/dist/src/functions/numeric.js.map +1 -0
  171. package/dist/src/functions/operators.d.ts +169 -0
  172. package/dist/src/functions/operators.d.ts.map +1 -0
  173. package/dist/src/functions/operators.js +235 -0
  174. package/dist/src/functions/operators.js.map +1 -0
  175. package/dist/src/functions/order-by.d.ts +15 -0
  176. package/dist/src/functions/order-by.d.ts.map +1 -0
  177. package/dist/src/functions/order-by.js +19 -0
  178. package/dist/src/functions/order-by.js.map +1 -0
  179. package/dist/src/functions/spatial.d.ts +32 -0
  180. package/dist/src/functions/spatial.d.ts.map +1 -0
  181. package/dist/src/functions/spatial.js +44 -0
  182. package/dist/src/functions/spatial.js.map +1 -0
  183. package/dist/src/functions/sql-template-tag.d.ts +13 -0
  184. package/dist/src/functions/sql-template-tag.d.ts.map +1 -0
  185. package/dist/src/functions/sql-template-tag.js +44 -0
  186. package/dist/src/functions/sql-template-tag.js.map +1 -0
  187. package/dist/src/functions/string.d.ts +49 -0
  188. package/dist/src/functions/string.d.ts.map +1 -0
  189. package/dist/src/functions/string.js +67 -0
  190. package/dist/src/functions/string.js.map +1 -0
  191. package/dist/src/functions/table-ref.d.ts +10 -0
  192. package/dist/src/functions/table-ref.d.ts.map +1 -0
  193. package/dist/src/functions/table-ref.js +13 -0
  194. package/dist/src/functions/table-ref.js.map +1 -0
  195. package/dist/src/functions/unnest.d.ts +10 -0
  196. package/dist/src/functions/unnest.d.ts.map +1 -0
  197. package/dist/src/functions/unnest.js +12 -0
  198. package/dist/src/functions/unnest.js.map +1 -0
  199. package/dist/src/functions/util.d.ts +7 -0
  200. package/dist/src/functions/util.d.ts.map +1 -0
  201. package/dist/src/functions/util.js +9 -0
  202. package/dist/src/functions/util.js.map +1 -0
  203. package/dist/src/functions/window-frame.d.ts +41 -0
  204. package/dist/src/functions/window-frame.d.ts.map +1 -0
  205. package/dist/src/functions/window-frame.js +52 -0
  206. package/dist/src/functions/window-frame.js.map +1 -0
  207. package/dist/src/functions/window.d.ts +74 -0
  208. package/dist/src/functions/window.d.ts.map +1 -0
  209. package/dist/src/functions/window.js +96 -0
  210. package/dist/src/functions/window.js.map +1 -0
  211. package/dist/src/index.d.ts +73 -0
  212. package/dist/src/index.d.ts.map +1 -0
  213. package/{src → dist/src}/index.js +8 -8
  214. package/dist/src/index.js.map +1 -0
  215. package/dist/src/load/create.d.ts +10 -0
  216. package/dist/src/load/create.d.ts.map +1 -0
  217. package/dist/src/load/create.js +14 -0
  218. package/dist/src/load/create.js.map +1 -0
  219. package/dist/src/load/extension.d.ts +2 -0
  220. package/dist/src/load/extension.d.ts.map +1 -0
  221. package/dist/src/load/extension.js +4 -0
  222. package/dist/src/load/extension.js.map +1 -0
  223. package/dist/src/load/load.d.ts +18 -0
  224. package/dist/src/load/load.d.ts.map +1 -0
  225. package/dist/src/load/load.js +80 -0
  226. package/dist/src/load/load.js.map +1 -0
  227. package/dist/src/load/sql-from.d.ts +14 -0
  228. package/dist/src/load/sql-from.d.ts.map +1 -0
  229. package/dist/src/load/sql-from.js +29 -0
  230. package/dist/src/load/sql-from.js.map +1 -0
  231. package/dist/src/transforms/bin-1d.d.ts +16 -0
  232. package/dist/src/transforms/bin-1d.d.ts.map +1 -0
  233. package/dist/src/transforms/bin-1d.js +21 -0
  234. package/dist/src/transforms/bin-1d.js.map +1 -0
  235. package/dist/src/transforms/bin-2d.d.ts +19 -0
  236. package/dist/src/transforms/bin-2d.d.ts.map +1 -0
  237. package/dist/src/transforms/bin-2d.js +27 -0
  238. package/dist/src/transforms/bin-2d.js.map +1 -0
  239. package/dist/src/transforms/bin-date.d.ts +31 -0
  240. package/dist/src/transforms/bin-date.d.ts.map +1 -0
  241. package/dist/src/transforms/bin-date.js +20 -0
  242. package/dist/src/transforms/bin-date.js.map +1 -0
  243. package/dist/src/transforms/bin-histogram.d.ts +37 -0
  244. package/dist/src/transforms/bin-histogram.d.ts.map +1 -0
  245. package/dist/src/transforms/bin-histogram.js +32 -0
  246. package/dist/src/transforms/bin-histogram.js.map +1 -0
  247. package/dist/src/transforms/bin-linear-1d.d.ts +11 -0
  248. package/dist/src/transforms/bin-linear-1d.d.ts.map +1 -0
  249. package/dist/src/transforms/bin-linear-1d.js +25 -0
  250. package/dist/src/transforms/bin-linear-1d.js.map +1 -0
  251. package/dist/src/transforms/bin-linear-2d.d.ts +20 -0
  252. package/dist/src/transforms/bin-linear-2d.d.ts.map +1 -0
  253. package/dist/src/transforms/bin-linear-2d.js +49 -0
  254. package/dist/src/transforms/bin-linear-2d.js.map +1 -0
  255. package/dist/src/transforms/filter-query.d.ts +12 -0
  256. package/dist/src/transforms/filter-query.d.ts.map +1 -0
  257. package/dist/src/transforms/filter-query.js +39 -0
  258. package/dist/src/transforms/filter-query.js.map +1 -0
  259. package/dist/src/transforms/line-density.d.ts +24 -0
  260. package/dist/src/transforms/line-density.d.ts.map +1 -0
  261. package/dist/src/transforms/line-density.js +98 -0
  262. package/dist/src/transforms/line-density.js.map +1 -0
  263. package/dist/src/transforms/m4.d.ts +19 -0
  264. package/dist/src/transforms/m4.d.ts.map +1 -0
  265. package/dist/src/transforms/m4.js +38 -0
  266. package/dist/src/transforms/m4.js.map +1 -0
  267. package/dist/src/transforms/scales.d.ts +30 -0
  268. package/dist/src/transforms/scales.d.ts.map +1 -0
  269. package/dist/src/transforms/scales.js +103 -0
  270. package/dist/src/transforms/scales.js.map +1 -0
  271. package/dist/src/transforms/util/bin-step.d.ts +50 -0
  272. package/dist/src/transforms/util/bin-step.d.ts.map +1 -0
  273. package/dist/src/transforms/util/bin-step.js +53 -0
  274. package/dist/src/transforms/util/bin-step.js.map +1 -0
  275. package/dist/src/transforms/util/time-interval.d.ts +14 -0
  276. package/dist/src/transforms/util/time-interval.d.ts.map +1 -0
  277. package/dist/src/transforms/util/time-interval.js +88 -0
  278. package/dist/src/transforms/util/time-interval.js.map +1 -0
  279. package/dist/src/types.d.ts +49 -0
  280. package/dist/src/types.d.ts.map +1 -0
  281. package/dist/src/types.js +2 -0
  282. package/dist/src/types.js.map +1 -0
  283. package/dist/src/util/ast.d.ts +62 -0
  284. package/dist/src/util/ast.d.ts.map +1 -0
  285. package/{src → dist/src}/util/ast.js +36 -41
  286. package/dist/src/util/ast.js.map +1 -0
  287. package/dist/src/util/function.d.ts +56 -0
  288. package/dist/src/util/function.d.ts.map +1 -0
  289. package/dist/src/util/function.js +73 -0
  290. package/dist/src/util/function.js.map +1 -0
  291. package/dist/src/util/identity.d.ts +6 -0
  292. package/dist/src/util/identity.d.ts.map +1 -0
  293. package/dist/src/util/identity.js +8 -0
  294. package/dist/src/util/identity.js.map +1 -0
  295. package/dist/src/util/string.d.ts +4 -0
  296. package/dist/src/util/string.d.ts.map +1 -0
  297. package/dist/src/util/string.js +14 -0
  298. package/dist/src/util/string.js.map +1 -0
  299. package/dist/src/util/type-check.d.ts +17 -0
  300. package/dist/src/util/type-check.d.ts.map +1 -0
  301. package/dist/src/util/type-check.js +28 -0
  302. package/dist/src/util/type-check.js.map +1 -0
  303. package/dist/src/visit/clone.d.ts +7 -0
  304. package/dist/src/visit/clone.d.ts.map +1 -0
  305. package/dist/src/visit/clone.js +52 -0
  306. package/dist/src/visit/clone.js.map +1 -0
  307. package/dist/src/visit/recurse.d.ts +2 -0
  308. package/dist/src/visit/recurse.d.ts.map +1 -0
  309. package/dist/src/visit/recurse.js +37 -0
  310. package/dist/src/visit/recurse.js.map +1 -0
  311. package/dist/src/visit/rewrite.d.ts +9 -0
  312. package/dist/src/visit/rewrite.d.ts.map +1 -0
  313. package/dist/src/visit/rewrite.js +39 -0
  314. package/dist/src/visit/rewrite.js.map +1 -0
  315. package/dist/src/visit/visitors.d.ts +32 -0
  316. package/dist/src/visit/visitors.d.ts.map +1 -0
  317. package/dist/src/visit/visitors.js +95 -0
  318. package/dist/src/visit/visitors.js.map +1 -0
  319. package/dist/src/visit/walk.d.ts +21 -0
  320. package/dist/src/visit/walk.d.ts.map +1 -0
  321. package/dist/src/visit/walk.js +32 -0
  322. package/dist/src/visit/walk.js.map +1 -0
  323. package/package.json +13 -7
  324. package/src/ast/{aggregate.js → aggregate.ts} +49 -60
  325. package/src/ast/{between-op.js → between-op.ts} +19 -26
  326. package/src/ast/binary-op.ts +31 -0
  327. package/src/ast/{case.js → case.ts} +29 -44
  328. package/src/ast/{cast.js → cast.ts} +8 -14
  329. package/src/ast/{collate.js → collate.ts} +8 -14
  330. package/src/ast/column-param.ts +34 -0
  331. package/src/ast/{column-ref.js → column-ref.ts} +16 -25
  332. package/src/ast/fragment.ts +28 -0
  333. package/src/ast/{from.js → from.ts} +12 -21
  334. package/src/ast/{function.js → function.ts} +8 -14
  335. package/src/ast/{in-op.js → in-op.ts} +8 -14
  336. package/src/ast/{interval.js → interval.ts} +8 -14
  337. package/src/ast/list.ts +23 -0
  338. package/src/ast/{literal.js → literal.ts} +6 -9
  339. package/src/ast/logical-op.ts +50 -0
  340. package/src/ast/{node.js → node.ts} +10 -13
  341. package/src/ast/order-by.ts +38 -0
  342. package/src/ast/{param.js → param.ts} +6 -12
  343. package/src/ast/{query.js → query.ts} +224 -204
  344. package/src/ast/sample.ts +47 -0
  345. package/src/ast/{select.js → select.ts} +10 -16
  346. package/src/ast/{subquery.js → subquery.ts} +9 -8
  347. package/src/ast/{table-ref.js → table-ref.ts} +7 -12
  348. package/src/ast/{unary-op.js → unary-op.ts} +16 -23
  349. package/src/ast/unnest.ts +31 -0
  350. package/src/ast/verbatim.ts +27 -0
  351. package/src/ast/{window-frame.js → window-frame.ts} +37 -47
  352. package/src/ast/window.ts +246 -0
  353. package/src/ast/{with.js → with.ts} +19 -20
  354. package/src/{constants.js → constants.ts} +2 -0
  355. package/src/functions/aggregate.ts +344 -0
  356. package/src/functions/{case.js → case.ts} +5 -8
  357. package/src/functions/{cast.js → cast.ts} +9 -13
  358. package/src/functions/{collate.js → collate.ts} +4 -7
  359. package/src/functions/{column.js → column.ts} +9 -10
  360. package/src/functions/{cte.js → cte.ts} +9 -6
  361. package/src/functions/{datetime.js → datetime.ts} +12 -20
  362. package/src/functions/interval.ts +74 -0
  363. package/src/functions/list.ts +63 -0
  364. package/src/functions/{literal.js → literal.ts} +5 -7
  365. package/src/functions/numeric.ts +125 -0
  366. package/src/functions/operators.ts +272 -0
  367. package/src/functions/order-by.ts +21 -0
  368. package/src/functions/spatial.ts +50 -0
  369. package/src/functions/{sql-template-tag.js → sql-template-tag.ts} +16 -13
  370. package/src/functions/string.ts +79 -0
  371. package/src/functions/{table-ref.js → table-ref.ts} +4 -4
  372. package/src/functions/unnest.ts +13 -0
  373. package/src/functions/util.ts +10 -0
  374. package/src/functions/window-frame.ts +58 -0
  375. package/src/functions/{window.js → window.ts} +18 -35
  376. package/src/index.ts +79 -0
  377. package/src/load/{create.js → create.ts} +9 -3
  378. package/src/load/extension.ts +3 -0
  379. package/src/load/{load.js → load.ts} +25 -10
  380. package/src/load/{sql-from.js → sql-from.ts} +14 -7
  381. package/src/transforms/{bin-1d.js → bin-1d.ts} +13 -9
  382. package/src/transforms/{bin-2d.js → bin-2d.ts} +17 -13
  383. package/src/transforms/bin-date.ts +48 -0
  384. package/src/transforms/bin-histogram.ts +61 -0
  385. package/src/transforms/{bin-linear-1d.js → bin-linear-1d.ts} +16 -11
  386. package/src/transforms/{bin-linear-2d.js → bin-linear-2d.ts} +23 -35
  387. package/src/transforms/{filter-query.js → filter-query.ts} +10 -14
  388. package/src/transforms/{line-density.js → line-density.ts} +19 -17
  389. package/src/transforms/{m4.js → m4.ts} +17 -14
  390. package/src/transforms/{scales.js → scales.ts} +57 -14
  391. package/src/transforms/util/bin-step.ts +100 -0
  392. package/src/transforms/util/{time-interval.js → time-interval.ts} +32 -21
  393. package/src/types.ts +5 -39
  394. package/src/util/ast.ts +104 -0
  395. package/src/util/{function.js → function.ts} +40 -31
  396. package/src/util/identity.ts +7 -0
  397. package/src/util/{string.js → string.ts} +4 -4
  398. package/src/util/type-check.ts +31 -0
  399. package/src/visit/{clone.js → clone.ts} +10 -10
  400. package/src/visit/{recurse.js → recurse.ts} +3 -1
  401. package/src/visit/{rewrite.js → rewrite.ts} +7 -7
  402. package/src/visit/{visitors.js → visitors.ts} +22 -30
  403. package/src/visit/walk.ts +46 -0
  404. package/src/ast/binary-op.js +0 -40
  405. package/src/ast/column-param.js +0 -40
  406. package/src/ast/fragment.js +0 -26
  407. package/src/ast/logical-op.js +0 -67
  408. package/src/ast/order-by.js +0 -48
  409. package/src/ast/sample.js +0 -53
  410. package/src/ast/verbatim.js +0 -33
  411. package/src/ast/window.js +0 -260
  412. package/src/functions/aggregate.js +0 -347
  413. package/src/functions/interval.js +0 -83
  414. package/src/functions/numeric.js +0 -143
  415. package/src/functions/operators.js +0 -301
  416. package/src/functions/order-by.js +0 -27
  417. package/src/functions/spatial.js +0 -59
  418. package/src/functions/string.js +0 -85
  419. package/src/functions/util.js +0 -14
  420. package/src/functions/window-frame.js +0 -61
  421. package/src/index-types.ts +0 -2
  422. package/src/load/extension.js +0 -3
  423. package/src/transforms/bin-date.js +0 -38
  424. package/src/transforms/bin-histogram.js +0 -52
  425. package/src/transforms/util/bin-step.js +0 -79
  426. package/src/util/type-check.js +0 -33
  427. package/src/visit/walk.js +0 -34
  428. package/tsconfig.json +0 -8
  429. package/vitest.config.ts +0 -3
@@ -0,0 +1,12 @@
1
+ import { CollateNode } from '../ast/collate.js';
2
+ import { asNode } from '../util/ast.js';
3
+ /**
4
+ * Indicate ascending sort order for an expression.
5
+ * @param expr The expression to collate.
6
+ * @param collation The collation type, such as
7
+ * 'NOCASE', 'NOACCENT', 'NFC', or locale-specific collations.
8
+ */
9
+ export function collate(expr, collation) {
10
+ return new CollateNode(asNode(expr), collation);
11
+ }
12
+ //# sourceMappingURL=collate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collate.js","sourceRoot":"","sources":["../../../src/functions/collate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAe,EAAE,SAAiB;IACxD,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ColumnRefNode } from '../ast/column-ref.js';
2
+ import type { TableRefNode } from '../ast/table-ref.js';
3
+ import type { ParamLike } from '../types.js';
4
+ /**
5
+ * Create a column reference.
6
+ * @param name The column name, as a string or as a dynamic parameter.
7
+ * @param table The table reference.
8
+ */
9
+ export declare function column(name: string | ParamLike, table?: string | string[] | TableRefNode): ColumnRefNode;
10
+ //# sourceMappingURL=column.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../../src/functions/column.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAO7C;;;;GAIG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,YAAY,GACvC,aAAa,CAKf"}
@@ -0,0 +1,17 @@
1
+ import { ColumnParamNode } from '../ast/column-param.js';
2
+ import { ColumnNameRefNode } from '../ast/column-ref.js';
3
+ import { ParamNode } from '../ast/param.js';
4
+ import { asTableRef } from '../util/ast.js';
5
+ import { isParamLike } from '../util/type-check.js';
6
+ /**
7
+ * Create a column reference.
8
+ * @param name The column name, as a string or as a dynamic parameter.
9
+ * @param table The table reference.
10
+ */
11
+ export function column(name, table) {
12
+ const tref = asTableRef(table);
13
+ return isParamLike(name)
14
+ ? new ColumnParamNode(new ParamNode(name), tref)
15
+ : new ColumnNameRefNode(name, tref);
16
+ }
17
+ //# sourceMappingURL=column.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column.js","sourceRoot":"","sources":["../../../src/functions/column.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,UAAU,MAAM,CACpB,IAAwB,EACxB,KAAwC;IAExC,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,WAAW,CAAC,IAAI,CAAC;QACtB,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;QAChD,CAAC,CAAC,IAAI,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Query } from '../ast/query.js';
2
+ import { WithClauseNode } from '../ast/with.js';
3
+ /**
4
+ * Create a common table expression (CTE) to include within a WITH clause.
5
+ * @param name The common table expression (CTE) name.
6
+ * @param query The common table expression (CTE) query.
7
+ * @param materialized The common table expression (CTE)
8
+ * materialization flag. If `true`, forces materialization of the CTE.
9
+ * If `false`, materialization is not performed. Otherwise (for example, if
10
+ * `undefined` or `null`), materialization is decided by the database.
11
+ */
12
+ export declare function cte(name: string, query: Query, materialized?: boolean | null): WithClauseNode;
13
+ //# sourceMappingURL=cte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cte.d.ts","sourceRoot":"","sources":["../../../src/functions/cte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,KAAK,EACZ,YAAY,GAAE,OAAO,GAAG,IAAW,kBAGpC"}
@@ -0,0 +1,14 @@
1
+ import { WithClauseNode } from '../ast/with.js';
2
+ /**
3
+ * Create a common table expression (CTE) to include within a WITH clause.
4
+ * @param name The common table expression (CTE) name.
5
+ * @param query The common table expression (CTE) query.
6
+ * @param materialized The common table expression (CTE)
7
+ * materialization flag. If `true`, forces materialization of the CTE.
8
+ * If `false`, materialization is not performed. Otherwise (for example, if
9
+ * `undefined` or `null`), materialization is decided by the database.
10
+ */
11
+ export function cte(name, query, materialized = null) {
12
+ return new WithClauseNode(name, query, materialized);
13
+ }
14
+ //# sourceMappingURL=cte.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cte.js","sourceRoot":"","sources":["../../../src/functions/cte.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,CACjB,IAAY,EACZ,KAAY,EACZ,eAA+B,IAAI;IAEnC,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { ExprValue } from '../types.js';
2
+ /**
3
+ * Given a date/time value, return the milliseconds since the UNIX epoch.
4
+ * @param {ExprValue} expr The date/time expression.
5
+ */
6
+ export declare function epoch_ms(expr: ExprValue): import("../index.js").FunctionNode;
7
+ /**
8
+ * Perform data binning according to the provided interval unit and steps.
9
+ * @param expr The date/time expression to bin.
10
+ * @param unit The datetime interval unit to bin by.
11
+ * @param steps The number of interval steps.
12
+ */
13
+ export declare function dateBin(expr: ExprValue, unit: string, steps?: number): import("../index.js").FunctionNode;
14
+ /**
15
+ * Map date/times to a month value, all within the same year for comparison.
16
+ * The resulting value is still date-typed.
17
+ * @param expr The date/time expression.
18
+ */
19
+ export declare function dateMonth(expr: ExprValue): import("../index.js").FunctionNode;
20
+ /**
21
+ * Map date/times to a month and day value, all within the same year for
22
+ * comparison. The resulting value is still date-typed.
23
+ * @param expr The date/time expression.
24
+ */
25
+ export declare function dateMonthDay(expr: ExprValue): import("../index.js").FunctionNode;
26
+ /**
27
+ * Map date/times to a day of the month value, all within the same year and month
28
+ * for comparison. The resulting value is still date-typed.
29
+ * @param expr The date/time expression.
30
+ */
31
+ export declare function dateDay(expr: ExprValue): import("../index.js").FunctionNode;
32
+ //# sourceMappingURL=datetime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../../src/functions/datetime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAK7C;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,sCAEvC;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,sCAEvE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,sCAExC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,sCAG3C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,sCAEtC"}
@@ -0,0 +1,45 @@
1
+ import { asNode } from '../util/ast.js';
2
+ import { fn } from '../util/function.js';
3
+ import { interval } from './interval.js';
4
+ /**
5
+ * Given a date/time value, return the milliseconds since the UNIX epoch.
6
+ * @param {ExprValue} expr The date/time expression.
7
+ */
8
+ export function epoch_ms(expr) {
9
+ return fn('epoch_ms', expr);
10
+ }
11
+ /**
12
+ * Perform data binning according to the provided interval unit and steps.
13
+ * @param expr The date/time expression to bin.
14
+ * @param unit The datetime interval unit to bin by.
15
+ * @param steps The number of interval steps.
16
+ */
17
+ export function dateBin(expr, unit, steps = 1) {
18
+ return fn('time_bucket', interval(unit, steps), expr);
19
+ }
20
+ /**
21
+ * Map date/times to a month value, all within the same year for comparison.
22
+ * The resulting value is still date-typed.
23
+ * @param expr The date/time expression.
24
+ */
25
+ export function dateMonth(expr) {
26
+ return fn('make_date', 2012, fn('month', expr), 1);
27
+ }
28
+ /**
29
+ * Map date/times to a month and day value, all within the same year for
30
+ * comparison. The resulting value is still date-typed.
31
+ * @param expr The date/time expression.
32
+ */
33
+ export function dateMonthDay(expr) {
34
+ const d = asNode(expr);
35
+ return fn('make_date', 2012, fn('month', d), fn('day', d));
36
+ }
37
+ /**
38
+ * Map date/times to a day of the month value, all within the same year and month
39
+ * for comparison. The resulting value is still date-typed.
40
+ * @param expr The date/time expression.
41
+ */
42
+ export function dateDay(expr) {
43
+ return fn('make_date', 2012, 1, fn('day', expr));
44
+ }
45
+ //# sourceMappingURL=datetime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime.js","sourceRoot":"","sources":["../../../src/functions/datetime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAe;IACtC,OAAO,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAe,EAAE,IAAY,EAAE,QAAgB,CAAC;IACtE,OAAO,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAe;IACvC,OAAO,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe;IAC1C,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAe;IACrC,OAAO,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { IntervalNode } from '../ast/interval.js';
2
+ /**
3
+ * Create a new interval.
4
+ * @param unit The interval unit, such as day or year.
5
+ * @param steps The number of interval unit steps.
6
+ */
7
+ export declare function interval(unit: string, steps: number): IntervalNode;
8
+ /**
9
+ * Create a new years interval.
10
+ * @param steps The number of years.
11
+ */
12
+ export declare function years(steps: number): IntervalNode;
13
+ /**
14
+ * Create a new months interval.
15
+ * @param steps The number of months.
16
+ */
17
+ export declare function months(steps: number): IntervalNode;
18
+ /**
19
+ * Create a new days interval.
20
+ * @param steps The number of days.
21
+ */
22
+ export declare function days(steps: number): IntervalNode;
23
+ /**
24
+ * Create a new hours interval.
25
+ * @param steps The number of hours.
26
+ */
27
+ export declare function hours(steps: number): IntervalNode;
28
+ /**
29
+ * Create a new minutes interval.
30
+ * @param steps The number of minutes.
31
+ */
32
+ export declare function minutes(steps: number): IntervalNode;
33
+ /**
34
+ * Create a new seconds interval.
35
+ * @param steps The number of seconds.
36
+ */
37
+ export declare function seconds(steps: number): IntervalNode;
38
+ /**
39
+ * Create a new milliseconds interval.
40
+ * @param steps The number of milliseconds.
41
+ */
42
+ export declare function milliseconds(steps: number): IntervalNode;
43
+ /**
44
+ * Create a new microseconds interval.
45
+ * @param steps The number of microseconds.
46
+ */
47
+ export declare function microseconds(steps: number): IntervalNode;
48
+ //# sourceMappingURL=interval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interval.d.ts","sourceRoot":"","sources":["../../../src/functions/interval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAEnD;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,gBAElC;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,gBAEnC;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,gBAEjC;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,gBAElC;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,gBAEpC;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,gBAEpC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,gBAEzC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,gBAEzC"}
@@ -0,0 +1,66 @@
1
+ import { IntervalNode } from '../ast/interval.js';
2
+ /**
3
+ * Create a new interval.
4
+ * @param unit The interval unit, such as day or year.
5
+ * @param steps The number of interval unit steps.
6
+ */
7
+ export function interval(unit, steps) {
8
+ return new IntervalNode(unit, steps);
9
+ }
10
+ /**
11
+ * Create a new years interval.
12
+ * @param steps The number of years.
13
+ */
14
+ export function years(steps) {
15
+ return interval('YEARS', steps);
16
+ }
17
+ /**
18
+ * Create a new months interval.
19
+ * @param steps The number of months.
20
+ */
21
+ export function months(steps) {
22
+ return interval('MONTHS', steps);
23
+ }
24
+ /**
25
+ * Create a new days interval.
26
+ * @param steps The number of days.
27
+ */
28
+ export function days(steps) {
29
+ return interval('DAYS', steps);
30
+ }
31
+ /**
32
+ * Create a new hours interval.
33
+ * @param steps The number of hours.
34
+ */
35
+ export function hours(steps) {
36
+ return interval('HOURS', steps);
37
+ }
38
+ /**
39
+ * Create a new minutes interval.
40
+ * @param steps The number of minutes.
41
+ */
42
+ export function minutes(steps) {
43
+ return interval('MINUTES', steps);
44
+ }
45
+ /**
46
+ * Create a new seconds interval.
47
+ * @param steps The number of seconds.
48
+ */
49
+ export function seconds(steps) {
50
+ return interval('SECONDS', steps);
51
+ }
52
+ /**
53
+ * Create a new milliseconds interval.
54
+ * @param steps The number of milliseconds.
55
+ */
56
+ export function milliseconds(steps) {
57
+ return interval('MILLISECONDS', steps);
58
+ }
59
+ /**
60
+ * Create a new microseconds interval.
61
+ * @param steps The number of microseconds.
62
+ */
63
+ export function microseconds(steps) {
64
+ return interval('MICROSECONDS', steps);
65
+ }
66
+ //# sourceMappingURL=interval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interval.js","sourceRoot":"","sources":["../../../src/functions/interval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAa;IAClD,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa;IAClC,OAAO,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,KAAa;IAChC,OAAO,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { ExprValue } from "../types.js";
2
+ import { ListNode } from "../ast/list.js";
3
+ /**
4
+ * Create a List containing the argument values.
5
+ * @param values
6
+ */
7
+ export declare function list(values: ExprValue[]): ListNode;
8
+ /**
9
+ * Function that returns true if the list contains the element,
10
+ * false otherwise. If the first argument is a string, it is
11
+ * interpreted as a column reference, otherwise it is coerced
12
+ * to a list.
13
+ * @param list1
14
+ * @param element
15
+ */
16
+ export declare function listContains(list1: ExprValue | ExprValue[], element: ExprValue): import("../index.js").FunctionNode;
17
+ /**
18
+ * Function that returns true if all elements of list2 exist in list1,
19
+ * false otherwise.
20
+ * @param list1
21
+ * @param list2
22
+ */
23
+ export declare function listHasAll(list1: ExprValue | ExprValue[], list2: ExprValue | ExprValue[]): import("../index.js").FunctionNode;
24
+ /**
25
+ * Function that returns true if any elements exist in both lists,
26
+ * false otherwise.
27
+ * @param list1
28
+ * @param list2
29
+ */
30
+ export declare function listHasAny(list1: ExprValue | ExprValue[], list2: ExprValue | ExprValue[]): import("../index.js").FunctionNode;
31
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/functions/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAEvC;AAYD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,EAC9B,OAAO,EAAE,SAAS,sCAGnB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,EAC9B,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,sCAG/B;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,EAC9B,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,sCAG/B"}
@@ -0,0 +1,49 @@
1
+ import { asLiteral, asNode } from "../util/ast.js";
2
+ import { argsList, fn } from "../util/function.js";
3
+ import { ListNode } from "../ast/list.js";
4
+ /**
5
+ * Create a List containing the argument values.
6
+ * @param values
7
+ */
8
+ export function list(values) {
9
+ return new ListNode(argsList(values).map(asLiteral));
10
+ }
11
+ /**
12
+ * Convert a single value or an array of values to either a ListNode if the input
13
+ * is an array, or a single ExprNode if it is a single value. A single string will
14
+ * be interpreted as a column reference.
15
+ * @param values
16
+ */
17
+ function asList(values) {
18
+ return Array.isArray(values) ? list(values) : asNode(values);
19
+ }
20
+ /**
21
+ * Function that returns true if the list contains the element,
22
+ * false otherwise. If the first argument is a string, it is
23
+ * interpreted as a column reference, otherwise it is coerced
24
+ * to a list.
25
+ * @param list1
26
+ * @param element
27
+ */
28
+ export function listContains(list1, element) {
29
+ return fn("list_contains", asList(list1), asLiteral(element));
30
+ }
31
+ /**
32
+ * Function that returns true if all elements of list2 exist in list1,
33
+ * false otherwise.
34
+ * @param list1
35
+ * @param list2
36
+ */
37
+ export function listHasAll(list1, list2) {
38
+ return fn("list_has_all", asList(list1), asList(list2));
39
+ }
40
+ /**
41
+ * Function that returns true if any elements exist in both lists,
42
+ * false otherwise.
43
+ * @param list1
44
+ * @param list2
45
+ */
46
+ export function listHasAny(list1, list2) {
47
+ return fn("list_has_any", asList(list1), asList(list2));
48
+ }
49
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/functions/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,MAAmB;IACtC,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,SAAS,MAAM,CAAC,MAA+B;IAC7C,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAA8B,EAC9B,OAAkB;IAElB,OAAO,EAAE,CAAC,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;AAChE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,KAA8B,EAC9B,KAA8B;IAE9B,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,KAA8B,EAC9B,KAA8B;IAE9B,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { LiteralNode } from '../ast/literal.js';
2
+ import { VerbatimNode } from '../ast/verbatim.js';
3
+ /**
4
+ * Return a SQL AST node for a literal value. The supported types are
5
+ * null, string, number, boolean, Date, and RegExp. Otherwise, the
6
+ * input value will be directly coerced to a string.
7
+ * @param value The literal value.
8
+ */
9
+ export declare function literal(value: unknown): LiteralNode;
10
+ /**
11
+ * Return a SQL AST node for verbatim string content.
12
+ * @param value The verbatim value.
13
+ * @param hint A type hint for analyzing verbatim content.
14
+ */
15
+ export declare function verbatim(value: string, hint?: string): VerbatimNode;
16
+ //# sourceMappingURL=literal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../../../src/functions/literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,eAErC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,gBAEpD"}
@@ -0,0 +1,20 @@
1
+ import { LiteralNode } from '../ast/literal.js';
2
+ import { VerbatimNode } from '../ast/verbatim.js';
3
+ /**
4
+ * Return a SQL AST node for a literal value. The supported types are
5
+ * null, string, number, boolean, Date, and RegExp. Otherwise, the
6
+ * input value will be directly coerced to a string.
7
+ * @param value The literal value.
8
+ */
9
+ export function literal(value) {
10
+ return new LiteralNode(value);
11
+ }
12
+ /**
13
+ * Return a SQL AST node for verbatim string content.
14
+ * @param value The verbatim value.
15
+ * @param hint A type hint for analyzing verbatim content.
16
+ */
17
+ export function verbatim(value, hint) {
18
+ return new VerbatimNode(value, hint);
19
+ }
20
+ //# sourceMappingURL=literal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../src/functions/literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa,EAAE,IAAa;IACnD,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,80 @@
1
+ import type { ExprValue } from '../types.js';
2
+ /**
3
+ * Return true if the floating point value is not a number, false otherwise.
4
+ * @param expr The input number.
5
+ */
6
+ export declare function isNaN(expr: ExprValue): import("../index.js").FunctionNode;
7
+ /**
8
+ * Return true if the floating point value is finite, false otherwise.
9
+ * @param expr The input number.
10
+ */
11
+ export declare function isFinite(expr: ExprValue): import("../index.js").FunctionNode;
12
+ /**
13
+ * Return true if the floating point value is infinite, false otherwise.
14
+ * @param expr The input number.
15
+ */
16
+ export declare function isInfinite(expr: ExprValue): import("../index.js").FunctionNode;
17
+ /**
18
+ * Selects the largest value.
19
+ * @param expr The input expressions.
20
+ */
21
+ export declare function greatest(...expr: ExprValue[]): import("../index.js").FunctionNode;
22
+ /**
23
+ * Selects the smallest value.
24
+ * @param expr The input expressions.
25
+ */
26
+ export declare function least(...expr: ExprValue[]): import("../index.js").FunctionNode;
27
+ /**
28
+ * Compute the exponentional function `e ** expr`.
29
+ * @param expr The input number.
30
+ */
31
+ export declare function exp(expr: ExprValue): import("../index.js").FunctionNode;
32
+ /**
33
+ * Compute a base 10 logarithm.
34
+ * @param expr The input number.
35
+ */
36
+ export declare function log(expr: ExprValue): import("../index.js").FunctionNode;
37
+ /**
38
+ * Compute a natural logarithm.
39
+ * @param expr The input number.
40
+ */
41
+ export declare function ln(expr: ExprValue): import("../index.js").FunctionNode;
42
+ /**
43
+ * Compute the sign of a number.
44
+ * @param expr The input number.
45
+ */
46
+ export declare function sign(expr: ExprValue): import("../index.js").FunctionNode;
47
+ /**
48
+ * Compute the absolute value of a number.
49
+ * @param expr The input number.
50
+ */
51
+ export declare function abs(expr: ExprValue): import("../index.js").FunctionNode;
52
+ /**
53
+ * Compute the square root of a number.
54
+ * @param expr The input number.
55
+ */
56
+ export declare function sqrt(expr: ExprValue): import("../index.js").FunctionNode;
57
+ /**
58
+ * Rounds the number up.
59
+ * @param expr The input number.
60
+ */
61
+ export declare function ceil(expr: ExprValue): import("../index.js").FunctionNode;
62
+ /**
63
+ * Rounds the number down.
64
+ * @param expr The input number.
65
+ */
66
+ export declare function floor(expr: ExprValue): import("../index.js").FunctionNode;
67
+ /**
68
+ * Round to the given decimal places.
69
+ * @param expr The input number.
70
+ * @param places The decimal places.
71
+ * Negative values are allowed, to round to tens, hundreds, etc.
72
+ * If unspecified, defaults to zero.
73
+ */
74
+ export declare function round(expr: ExprValue, places?: ExprValue): import("../index.js").FunctionNode;
75
+ /**
76
+ * Truncates the number.
77
+ * @param expr The input number.
78
+ */
79
+ export declare function trunc(expr: ExprValue): import("../index.js").FunctionNode;
80
+ //# sourceMappingURL=numeric.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../../../src/functions/numeric.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,sCAEpC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,sCAEvC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,sCAEzC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,sCAE5C;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,sCAEzC;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,sCAElC;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,sCAElC;AAED;;;GAGG;AACH,wBAAgB,EAAE,CAAC,IAAI,EAAE,SAAS,sCAEjC;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,SAAS,sCAEnC;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,sCAElC;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,SAAS,sCAEnC;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,SAAS,sCAEnC;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,sCAEpC;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,SAAS,sCAExD;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,sCAEpC"}
@@ -0,0 +1,110 @@
1
+ import { fn } from '../util/function.js';
2
+ /**
3
+ * Return true if the floating point value is not a number, false otherwise.
4
+ * @param expr The input number.
5
+ */
6
+ export function isNaN(expr) {
7
+ return fn('isnan', expr);
8
+ }
9
+ /**
10
+ * Return true if the floating point value is finite, false otherwise.
11
+ * @param expr The input number.
12
+ */
13
+ export function isFinite(expr) {
14
+ return fn('isfinite', expr);
15
+ }
16
+ /**
17
+ * Return true if the floating point value is infinite, false otherwise.
18
+ * @param expr The input number.
19
+ */
20
+ export function isInfinite(expr) {
21
+ return fn('isinf', expr);
22
+ }
23
+ /**
24
+ * Selects the largest value.
25
+ * @param expr The input expressions.
26
+ */
27
+ export function greatest(...expr) {
28
+ return fn('greatest', ...expr);
29
+ }
30
+ /**
31
+ * Selects the smallest value.
32
+ * @param expr The input expressions.
33
+ */
34
+ export function least(...expr) {
35
+ return fn('least', ...expr);
36
+ }
37
+ /**
38
+ * Compute the exponentional function `e ** expr`.
39
+ * @param expr The input number.
40
+ */
41
+ export function exp(expr) {
42
+ return fn('exp', expr);
43
+ }
44
+ /**
45
+ * Compute a base 10 logarithm.
46
+ * @param expr The input number.
47
+ */
48
+ export function log(expr) {
49
+ return fn('log', expr);
50
+ }
51
+ /**
52
+ * Compute a natural logarithm.
53
+ * @param expr The input number.
54
+ */
55
+ export function ln(expr) {
56
+ return fn('ln', expr);
57
+ }
58
+ /**
59
+ * Compute the sign of a number.
60
+ * @param expr The input number.
61
+ */
62
+ export function sign(expr) {
63
+ return fn('sign', expr);
64
+ }
65
+ /**
66
+ * Compute the absolute value of a number.
67
+ * @param expr The input number.
68
+ */
69
+ export function abs(expr) {
70
+ return fn('abs', expr);
71
+ }
72
+ /**
73
+ * Compute the square root of a number.
74
+ * @param expr The input number.
75
+ */
76
+ export function sqrt(expr) {
77
+ return fn('sqrt', expr);
78
+ }
79
+ /**
80
+ * Rounds the number up.
81
+ * @param expr The input number.
82
+ */
83
+ export function ceil(expr) {
84
+ return fn('ceil', expr);
85
+ }
86
+ /**
87
+ * Rounds the number down.
88
+ * @param expr The input number.
89
+ */
90
+ export function floor(expr) {
91
+ return fn('floor', expr);
92
+ }
93
+ /**
94
+ * Round to the given decimal places.
95
+ * @param expr The input number.
96
+ * @param places The decimal places.
97
+ * Negative values are allowed, to round to tens, hundreds, etc.
98
+ * If unspecified, defaults to zero.
99
+ */
100
+ export function round(expr, places) {
101
+ return fn('round', expr, places);
102
+ }
103
+ /**
104
+ * Truncates the number.
105
+ * @param expr The input number.
106
+ */
107
+ export function trunc(expr) {
108
+ return fn('trunc', expr);
109
+ }
110
+ //# sourceMappingURL=numeric.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric.js","sourceRoot":"","sources":["../../../src/functions/numeric.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,IAAe;IACnC,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAe;IACtC,OAAO,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAe;IACxC,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAG,IAAiB;IAC3C,OAAO,EAAE,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,GAAG,IAAiB;IACxC,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,IAAe;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,IAAe;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,EAAE,CAAC,IAAe;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,IAAe;IAClC,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,IAAe;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,IAAe;IAClC,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,IAAe;IAClC,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,IAAe;IACnC,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,IAAe,EAAE,MAAkB;IACvD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,IAAe;IACnC,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}