@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.
- package/LICENSE +47 -0
- package/README.md +0 -2
- package/dist/src/ast/aggregate.d.ts +82 -0
- package/dist/src/ast/aggregate.d.ts.map +1 -0
- package/dist/src/ast/aggregate.js +180 -0
- package/dist/src/ast/aggregate.js.map +1 -0
- package/dist/src/ast/between-op.d.ts +46 -0
- package/dist/src/ast/between-op.d.ts.map +1 -0
- package/dist/src/ast/between-op.js +60 -0
- package/dist/src/ast/between-op.js.map +1 -0
- package/dist/src/ast/binary-op.d.ts +21 -0
- package/dist/src/ast/binary-op.d.ts.map +1 -0
- package/dist/src/ast/binary-op.js +29 -0
- package/dist/src/ast/binary-op.js.map +1 -0
- package/dist/src/ast/case.d.ts +53 -0
- package/dist/src/ast/case.d.ts.map +1 -0
- package/dist/src/ast/case.js +75 -0
- package/dist/src/ast/case.js.map +1 -0
- package/dist/src/ast/cast.d.ts +18 -0
- package/dist/src/ast/cast.d.ts.map +1 -0
- package/dist/src/ast/cast.js +26 -0
- package/dist/src/ast/cast.js.map +1 -0
- package/dist/src/ast/collate.d.ts +18 -0
- package/dist/src/ast/collate.d.ts.map +1 -0
- package/dist/src/ast/collate.js +25 -0
- package/dist/src/ast/collate.js.map +1 -0
- package/dist/src/ast/column-param.d.ts +23 -0
- package/dist/src/ast/column-param.d.ts.map +1 -0
- package/dist/src/ast/column-param.js +29 -0
- package/dist/src/ast/column-param.js.map +1 -0
- package/dist/src/ast/column-ref.d.ts +40 -0
- package/dist/src/ast/column-ref.d.ts.map +1 -0
- package/dist/src/ast/column-ref.js +58 -0
- package/dist/src/ast/column-ref.js.map +1 -0
- package/dist/src/ast/fragment.d.ts +20 -0
- package/dist/src/ast/fragment.d.ts.map +1 -0
- package/dist/src/ast/fragment.js +26 -0
- package/dist/src/ast/fragment.js.map +1 -0
- package/dist/src/ast/from.d.ts +22 -0
- package/dist/src/ast/from.d.ts.map +1 -0
- package/dist/src/ast/from.js +37 -0
- package/dist/src/ast/from.js.map +1 -0
- package/dist/src/ast/function.d.ts +18 -0
- package/dist/src/ast/function.d.ts.map +1 -0
- package/dist/src/ast/function.js +26 -0
- package/dist/src/ast/function.js.map +1 -0
- package/dist/src/ast/in-op.d.ts +18 -0
- package/dist/src/ast/in-op.d.ts.map +1 -0
- package/dist/src/ast/in-op.js +25 -0
- package/dist/src/ast/in-op.js.map +1 -0
- package/dist/src/ast/interval.d.ts +18 -0
- package/dist/src/ast/interval.d.ts.map +1 -0
- package/dist/src/ast/interval.js +25 -0
- package/dist/src/ast/interval.js.map +1 -0
- package/dist/src/ast/list.d.ts +15 -0
- package/dist/src/ast/list.d.ts.map +1 -0
- package/dist/src/ast/list.js +21 -0
- package/dist/src/ast/list.js.map +1 -0
- package/dist/src/ast/literal.d.ts +16 -0
- package/dist/src/ast/literal.d.ts.map +1 -0
- package/dist/src/ast/literal.js +53 -0
- package/dist/src/ast/literal.js.map +1 -0
- package/dist/src/ast/logical-op.d.ts +32 -0
- package/dist/src/ast/logical-op.d.ts.map +1 -0
- package/dist/src/ast/logical-op.js +46 -0
- package/dist/src/ast/logical-op.js.map +1 -0
- package/dist/src/ast/node.d.ts +25 -0
- package/dist/src/ast/node.d.ts.map +1 -0
- package/dist/src/ast/node.js +36 -0
- package/dist/src/ast/node.js.map +1 -0
- package/dist/src/ast/order-by.d.ts +21 -0
- package/dist/src/ast/order-by.d.ts.map +1 -0
- package/dist/src/ast/order-by.js +36 -0
- package/dist/src/ast/order-by.js.map +1 -0
- package/dist/src/ast/param.d.ts +20 -0
- package/dist/src/ast/param.d.ts.map +1 -0
- package/dist/src/ast/param.js +28 -0
- package/dist/src/ast/param.js.map +1 -0
- package/dist/src/ast/query.d.ts +334 -0
- package/dist/src/ast/query.d.ts.map +1 -0
- package/dist/src/ast/query.js +640 -0
- package/dist/src/ast/query.js.map +1 -0
- package/dist/src/ast/sample.d.ts +27 -0
- package/dist/src/ast/sample.d.ts.map +1 -0
- package/dist/src/ast/sample.js +38 -0
- package/dist/src/ast/sample.js.map +1 -0
- package/dist/src/ast/select.d.ts +19 -0
- package/dist/src/ast/select.d.ts.map +1 -0
- package/dist/src/ast/select.js +35 -0
- package/dist/src/ast/select.js.map +1 -0
- package/dist/src/ast/subquery.d.ts +16 -0
- package/dist/src/ast/subquery.d.ts.map +1 -0
- package/dist/src/ast/subquery.js +21 -0
- package/dist/src/ast/subquery.js.map +1 -0
- package/dist/src/ast/table-ref.d.ts +24 -0
- package/dist/src/ast/table-ref.d.ts.map +1 -0
- package/dist/src/ast/table-ref.js +35 -0
- package/dist/src/ast/table-ref.js.map +1 -0
- package/dist/src/ast/unary-op.d.ts +40 -0
- package/dist/src/ast/unary-op.d.ts.map +1 -0
- package/dist/src/ast/unary-op.js +52 -0
- package/dist/src/ast/unary-op.js.map +1 -0
- package/dist/src/ast/unnest.d.ts +19 -0
- package/dist/src/ast/unnest.d.ts.map +1 -0
- package/dist/src/ast/unnest.js +29 -0
- package/dist/src/ast/unnest.js.map +1 -0
- package/dist/src/ast/verbatim.d.ts +18 -0
- package/dist/src/ast/verbatim.d.ts.map +1 -0
- package/dist/src/ast/verbatim.js +25 -0
- package/dist/src/ast/verbatim.js.map +1 -0
- package/dist/src/ast/window-frame.d.ts +54 -0
- package/dist/src/ast/window-frame.d.ts.map +1 -0
- package/dist/src/ast/window-frame.js +79 -0
- package/dist/src/ast/window-frame.js.map +1 -0
- package/dist/src/ast/window.d.ts +128 -0
- package/dist/src/ast/window.d.ts.map +1 -0
- package/dist/src/ast/window.js +194 -0
- package/dist/src/ast/window.js.map +1 -0
- package/dist/src/ast/with.d.ts +25 -0
- package/dist/src/ast/with.d.ts.map +1 -0
- package/dist/src/ast/with.js +36 -0
- package/dist/src/ast/with.js.map +1 -0
- package/dist/src/constants.d.ts +40 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +40 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/functions/aggregate.d.ts +236 -0
- package/dist/src/functions/aggregate.d.ts.map +1 -0
- package/dist/src/functions/aggregate.js +308 -0
- package/dist/src/functions/aggregate.js.map +1 -0
- package/dist/src/functions/case.d.ts +13 -0
- package/dist/src/functions/case.d.ts.map +1 -0
- package/dist/src/functions/case.js +17 -0
- package/dist/src/functions/case.js.map +1 -0
- package/dist/src/functions/cast.d.ts +23 -0
- package/dist/src/functions/cast.d.ts.map +1 -0
- package/dist/src/functions/cast.js +32 -0
- package/dist/src/functions/cast.js.map +1 -0
- package/dist/src/functions/collate.d.ts +10 -0
- package/dist/src/functions/collate.d.ts.map +1 -0
- package/dist/src/functions/collate.js +12 -0
- package/dist/src/functions/collate.js.map +1 -0
- package/dist/src/functions/column.d.ts +10 -0
- package/dist/src/functions/column.d.ts.map +1 -0
- package/dist/src/functions/column.js +17 -0
- package/dist/src/functions/column.js.map +1 -0
- package/dist/src/functions/cte.d.ts +13 -0
- package/dist/src/functions/cte.d.ts.map +1 -0
- package/dist/src/functions/cte.js +14 -0
- package/dist/src/functions/cte.js.map +1 -0
- package/dist/src/functions/datetime.d.ts +32 -0
- package/dist/src/functions/datetime.d.ts.map +1 -0
- package/dist/src/functions/datetime.js +45 -0
- package/dist/src/functions/datetime.js.map +1 -0
- package/dist/src/functions/interval.d.ts +48 -0
- package/dist/src/functions/interval.d.ts.map +1 -0
- package/dist/src/functions/interval.js +66 -0
- package/dist/src/functions/interval.js.map +1 -0
- package/dist/src/functions/list.d.ts +31 -0
- package/dist/src/functions/list.d.ts.map +1 -0
- package/dist/src/functions/list.js +49 -0
- package/dist/src/functions/list.js.map +1 -0
- package/dist/src/functions/literal.d.ts +16 -0
- package/dist/src/functions/literal.d.ts.map +1 -0
- package/dist/src/functions/literal.js +20 -0
- package/dist/src/functions/literal.js.map +1 -0
- package/dist/src/functions/numeric.d.ts +80 -0
- package/dist/src/functions/numeric.d.ts.map +1 -0
- package/dist/src/functions/numeric.js +110 -0
- package/dist/src/functions/numeric.js.map +1 -0
- package/dist/src/functions/operators.d.ts +169 -0
- package/dist/src/functions/operators.d.ts.map +1 -0
- package/dist/src/functions/operators.js +235 -0
- package/dist/src/functions/operators.js.map +1 -0
- package/dist/src/functions/order-by.d.ts +15 -0
- package/dist/src/functions/order-by.d.ts.map +1 -0
- package/dist/src/functions/order-by.js +19 -0
- package/dist/src/functions/order-by.js.map +1 -0
- package/dist/src/functions/spatial.d.ts +32 -0
- package/dist/src/functions/spatial.d.ts.map +1 -0
- package/dist/src/functions/spatial.js +44 -0
- package/dist/src/functions/spatial.js.map +1 -0
- package/dist/src/functions/sql-template-tag.d.ts +13 -0
- package/dist/src/functions/sql-template-tag.d.ts.map +1 -0
- package/dist/src/functions/sql-template-tag.js +44 -0
- package/dist/src/functions/sql-template-tag.js.map +1 -0
- package/dist/src/functions/string.d.ts +49 -0
- package/dist/src/functions/string.d.ts.map +1 -0
- package/dist/src/functions/string.js +67 -0
- package/dist/src/functions/string.js.map +1 -0
- package/dist/src/functions/table-ref.d.ts +10 -0
- package/dist/src/functions/table-ref.d.ts.map +1 -0
- package/dist/src/functions/table-ref.js +13 -0
- package/dist/src/functions/table-ref.js.map +1 -0
- package/dist/src/functions/unnest.d.ts +10 -0
- package/dist/src/functions/unnest.d.ts.map +1 -0
- package/dist/src/functions/unnest.js +12 -0
- package/dist/src/functions/unnest.js.map +1 -0
- package/dist/src/functions/util.d.ts +7 -0
- package/dist/src/functions/util.d.ts.map +1 -0
- package/dist/src/functions/util.js +9 -0
- package/dist/src/functions/util.js.map +1 -0
- package/dist/src/functions/window-frame.d.ts +41 -0
- package/dist/src/functions/window-frame.d.ts.map +1 -0
- package/dist/src/functions/window-frame.js +52 -0
- package/dist/src/functions/window-frame.js.map +1 -0
- package/dist/src/functions/window.d.ts +74 -0
- package/dist/src/functions/window.d.ts.map +1 -0
- package/dist/src/functions/window.js +96 -0
- package/dist/src/functions/window.js.map +1 -0
- package/dist/src/index.d.ts +73 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{src → dist/src}/index.js +8 -8
- package/dist/src/index.js.map +1 -0
- package/dist/src/load/create.d.ts +10 -0
- package/dist/src/load/create.d.ts.map +1 -0
- package/dist/src/load/create.js +14 -0
- package/dist/src/load/create.js.map +1 -0
- package/dist/src/load/extension.d.ts +2 -0
- package/dist/src/load/extension.d.ts.map +1 -0
- package/dist/src/load/extension.js +4 -0
- package/dist/src/load/extension.js.map +1 -0
- package/dist/src/load/load.d.ts +18 -0
- package/dist/src/load/load.d.ts.map +1 -0
- package/dist/src/load/load.js +80 -0
- package/dist/src/load/load.js.map +1 -0
- package/dist/src/load/sql-from.d.ts +14 -0
- package/dist/src/load/sql-from.d.ts.map +1 -0
- package/dist/src/load/sql-from.js +29 -0
- package/dist/src/load/sql-from.js.map +1 -0
- package/dist/src/transforms/bin-1d.d.ts +16 -0
- package/dist/src/transforms/bin-1d.d.ts.map +1 -0
- package/dist/src/transforms/bin-1d.js +21 -0
- package/dist/src/transforms/bin-1d.js.map +1 -0
- package/dist/src/transforms/bin-2d.d.ts +19 -0
- package/dist/src/transforms/bin-2d.d.ts.map +1 -0
- package/dist/src/transforms/bin-2d.js +27 -0
- package/dist/src/transforms/bin-2d.js.map +1 -0
- package/dist/src/transforms/bin-date.d.ts +31 -0
- package/dist/src/transforms/bin-date.d.ts.map +1 -0
- package/dist/src/transforms/bin-date.js +20 -0
- package/dist/src/transforms/bin-date.js.map +1 -0
- package/dist/src/transforms/bin-histogram.d.ts +37 -0
- package/dist/src/transforms/bin-histogram.d.ts.map +1 -0
- package/dist/src/transforms/bin-histogram.js +32 -0
- package/dist/src/transforms/bin-histogram.js.map +1 -0
- package/dist/src/transforms/bin-linear-1d.d.ts +11 -0
- package/dist/src/transforms/bin-linear-1d.d.ts.map +1 -0
- package/dist/src/transforms/bin-linear-1d.js +25 -0
- package/dist/src/transforms/bin-linear-1d.js.map +1 -0
- package/dist/src/transforms/bin-linear-2d.d.ts +20 -0
- package/dist/src/transforms/bin-linear-2d.d.ts.map +1 -0
- package/dist/src/transforms/bin-linear-2d.js +49 -0
- package/dist/src/transforms/bin-linear-2d.js.map +1 -0
- package/dist/src/transforms/filter-query.d.ts +12 -0
- package/dist/src/transforms/filter-query.d.ts.map +1 -0
- package/dist/src/transforms/filter-query.js +39 -0
- package/dist/src/transforms/filter-query.js.map +1 -0
- package/dist/src/transforms/line-density.d.ts +24 -0
- package/dist/src/transforms/line-density.d.ts.map +1 -0
- package/dist/src/transforms/line-density.js +98 -0
- package/dist/src/transforms/line-density.js.map +1 -0
- package/dist/src/transforms/m4.d.ts +19 -0
- package/dist/src/transforms/m4.d.ts.map +1 -0
- package/dist/src/transforms/m4.js +38 -0
- package/dist/src/transforms/m4.js.map +1 -0
- package/dist/src/transforms/scales.d.ts +30 -0
- package/dist/src/transforms/scales.d.ts.map +1 -0
- package/dist/src/transforms/scales.js +103 -0
- package/dist/src/transforms/scales.js.map +1 -0
- package/dist/src/transforms/util/bin-step.d.ts +50 -0
- package/dist/src/transforms/util/bin-step.d.ts.map +1 -0
- package/dist/src/transforms/util/bin-step.js +53 -0
- package/dist/src/transforms/util/bin-step.js.map +1 -0
- package/dist/src/transforms/util/time-interval.d.ts +14 -0
- package/dist/src/transforms/util/time-interval.d.ts.map +1 -0
- package/dist/src/transforms/util/time-interval.js +88 -0
- package/dist/src/transforms/util/time-interval.js.map +1 -0
- package/dist/src/types.d.ts +49 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/util/ast.d.ts +62 -0
- package/dist/src/util/ast.d.ts.map +1 -0
- package/{src → dist/src}/util/ast.js +36 -41
- package/dist/src/util/ast.js.map +1 -0
- package/dist/src/util/function.d.ts +56 -0
- package/dist/src/util/function.d.ts.map +1 -0
- package/dist/src/util/function.js +73 -0
- package/dist/src/util/function.js.map +1 -0
- package/dist/src/util/identity.d.ts +6 -0
- package/dist/src/util/identity.d.ts.map +1 -0
- package/dist/src/util/identity.js +8 -0
- package/dist/src/util/identity.js.map +1 -0
- package/dist/src/util/string.d.ts +4 -0
- package/dist/src/util/string.d.ts.map +1 -0
- package/dist/src/util/string.js +14 -0
- package/dist/src/util/string.js.map +1 -0
- package/dist/src/util/type-check.d.ts +17 -0
- package/dist/src/util/type-check.d.ts.map +1 -0
- package/dist/src/util/type-check.js +28 -0
- package/dist/src/util/type-check.js.map +1 -0
- package/dist/src/visit/clone.d.ts +7 -0
- package/dist/src/visit/clone.d.ts.map +1 -0
- package/dist/src/visit/clone.js +52 -0
- package/dist/src/visit/clone.js.map +1 -0
- package/dist/src/visit/recurse.d.ts +2 -0
- package/dist/src/visit/recurse.d.ts.map +1 -0
- package/dist/src/visit/recurse.js +37 -0
- package/dist/src/visit/recurse.js.map +1 -0
- package/dist/src/visit/rewrite.d.ts +9 -0
- package/dist/src/visit/rewrite.d.ts.map +1 -0
- package/dist/src/visit/rewrite.js +39 -0
- package/dist/src/visit/rewrite.js.map +1 -0
- package/dist/src/visit/visitors.d.ts +32 -0
- package/dist/src/visit/visitors.d.ts.map +1 -0
- package/dist/src/visit/visitors.js +95 -0
- package/dist/src/visit/visitors.js.map +1 -0
- package/dist/src/visit/walk.d.ts +21 -0
- package/dist/src/visit/walk.d.ts.map +1 -0
- package/dist/src/visit/walk.js +32 -0
- package/dist/src/visit/walk.js.map +1 -0
- package/package.json +13 -7
- package/src/ast/{aggregate.js → aggregate.ts} +49 -60
- package/src/ast/{between-op.js → between-op.ts} +19 -26
- package/src/ast/binary-op.ts +31 -0
- package/src/ast/{case.js → case.ts} +29 -44
- package/src/ast/{cast.js → cast.ts} +8 -14
- package/src/ast/{collate.js → collate.ts} +8 -14
- package/src/ast/column-param.ts +34 -0
- package/src/ast/{column-ref.js → column-ref.ts} +16 -25
- package/src/ast/fragment.ts +28 -0
- package/src/ast/{from.js → from.ts} +12 -21
- package/src/ast/{function.js → function.ts} +8 -14
- package/src/ast/{in-op.js → in-op.ts} +8 -14
- package/src/ast/{interval.js → interval.ts} +8 -14
- package/src/ast/list.ts +23 -0
- package/src/ast/{literal.js → literal.ts} +6 -9
- package/src/ast/logical-op.ts +50 -0
- package/src/ast/{node.js → node.ts} +10 -13
- package/src/ast/order-by.ts +38 -0
- package/src/ast/{param.js → param.ts} +6 -12
- package/src/ast/{query.js → query.ts} +224 -204
- package/src/ast/sample.ts +47 -0
- package/src/ast/{select.js → select.ts} +10 -16
- package/src/ast/{subquery.js → subquery.ts} +9 -8
- package/src/ast/{table-ref.js → table-ref.ts} +7 -12
- package/src/ast/{unary-op.js → unary-op.ts} +16 -23
- package/src/ast/unnest.ts +31 -0
- package/src/ast/verbatim.ts +27 -0
- package/src/ast/{window-frame.js → window-frame.ts} +37 -47
- package/src/ast/window.ts +246 -0
- package/src/ast/{with.js → with.ts} +19 -20
- package/src/{constants.js → constants.ts} +2 -0
- package/src/functions/aggregate.ts +344 -0
- package/src/functions/{case.js → case.ts} +5 -8
- package/src/functions/{cast.js → cast.ts} +9 -13
- package/src/functions/{collate.js → collate.ts} +4 -7
- package/src/functions/{column.js → column.ts} +9 -10
- package/src/functions/{cte.js → cte.ts} +9 -6
- package/src/functions/{datetime.js → datetime.ts} +12 -20
- package/src/functions/interval.ts +74 -0
- package/src/functions/list.ts +63 -0
- package/src/functions/{literal.js → literal.ts} +5 -7
- package/src/functions/numeric.ts +125 -0
- package/src/functions/operators.ts +272 -0
- package/src/functions/order-by.ts +21 -0
- package/src/functions/spatial.ts +50 -0
- package/src/functions/{sql-template-tag.js → sql-template-tag.ts} +16 -13
- package/src/functions/string.ts +79 -0
- package/src/functions/{table-ref.js → table-ref.ts} +4 -4
- package/src/functions/unnest.ts +13 -0
- package/src/functions/util.ts +10 -0
- package/src/functions/window-frame.ts +58 -0
- package/src/functions/{window.js → window.ts} +18 -35
- package/src/index.ts +79 -0
- package/src/load/{create.js → create.ts} +9 -3
- package/src/load/extension.ts +3 -0
- package/src/load/{load.js → load.ts} +25 -10
- package/src/load/{sql-from.js → sql-from.ts} +14 -7
- package/src/transforms/{bin-1d.js → bin-1d.ts} +13 -9
- package/src/transforms/{bin-2d.js → bin-2d.ts} +17 -13
- package/src/transforms/bin-date.ts +48 -0
- package/src/transforms/bin-histogram.ts +61 -0
- package/src/transforms/{bin-linear-1d.js → bin-linear-1d.ts} +16 -11
- package/src/transforms/{bin-linear-2d.js → bin-linear-2d.ts} +23 -35
- package/src/transforms/{filter-query.js → filter-query.ts} +10 -14
- package/src/transforms/{line-density.js → line-density.ts} +19 -17
- package/src/transforms/{m4.js → m4.ts} +17 -14
- package/src/transforms/{scales.js → scales.ts} +57 -14
- package/src/transforms/util/bin-step.ts +100 -0
- package/src/transforms/util/{time-interval.js → time-interval.ts} +32 -21
- package/src/types.ts +5 -39
- package/src/util/ast.ts +104 -0
- package/src/util/{function.js → function.ts} +40 -31
- package/src/util/identity.ts +7 -0
- package/src/util/{string.js → string.ts} +4 -4
- package/src/util/type-check.ts +31 -0
- package/src/visit/{clone.js → clone.ts} +10 -10
- package/src/visit/{recurse.js → recurse.ts} +3 -1
- package/src/visit/{rewrite.js → rewrite.ts} +7 -7
- package/src/visit/{visitors.js → visitors.ts} +22 -30
- package/src/visit/walk.ts +46 -0
- package/src/ast/binary-op.js +0 -40
- package/src/ast/column-param.js +0 -40
- package/src/ast/fragment.js +0 -26
- package/src/ast/logical-op.js +0 -67
- package/src/ast/order-by.js +0 -48
- package/src/ast/sample.js +0 -53
- package/src/ast/verbatim.js +0 -33
- package/src/ast/window.js +0 -260
- package/src/functions/aggregate.js +0 -347
- package/src/functions/interval.js +0 -83
- package/src/functions/numeric.js +0 -143
- package/src/functions/operators.js +0 -301
- package/src/functions/order-by.js +0 -27
- package/src/functions/spatial.js +0 -59
- package/src/functions/string.js +0 -85
- package/src/functions/util.js +0 -14
- package/src/functions/window-frame.js +0 -61
- package/src/index-types.ts +0 -2
- package/src/load/extension.js +0 -3
- package/src/transforms/bin-date.js +0 -38
- package/src/transforms/bin-histogram.js +0 -52
- package/src/transforms/util/bin-step.js +0 -79
- package/src/util/type-check.js +0 -33
- package/src/visit/walk.js +0 -34
- package/tsconfig.json +0 -8
- package/vitest.config.ts +0 -3
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { ExprValue } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compute an arg_max aggregate.
|
|
4
|
+
* @param y The argument to return.
|
|
5
|
+
* @param x The expression to maximize.
|
|
6
|
+
* @returns A SQL aggregate function call.
|
|
7
|
+
*/
|
|
8
|
+
export declare function argmax(y: ExprValue, x: ExprValue): import("../index.js").AggregateNode;
|
|
9
|
+
/**
|
|
10
|
+
* Compute an arg_min aggregate.
|
|
11
|
+
* @param y The argument to return.
|
|
12
|
+
* @param x The expression to minimize.
|
|
13
|
+
* @returns A SQL aggregate function call.
|
|
14
|
+
*/
|
|
15
|
+
export declare function argmin(y: ExprValue, x: ExprValue): import("../index.js").AggregateNode;
|
|
16
|
+
/**
|
|
17
|
+
* Compute an array aggregation.
|
|
18
|
+
* @param expr The expression to aggregate.
|
|
19
|
+
* @returns A SQL aggregate function call.
|
|
20
|
+
*/
|
|
21
|
+
export declare function arrayAgg(expr: ExprValue): import("../index.js").AggregateNode;
|
|
22
|
+
/**
|
|
23
|
+
* Compute an average aggregate.
|
|
24
|
+
* @param expr The expression to aggregate.
|
|
25
|
+
* @returns A SQL aggregate function call.
|
|
26
|
+
*/
|
|
27
|
+
export declare function avg(expr: ExprValue): import("../index.js").AggregateNode;
|
|
28
|
+
/**
|
|
29
|
+
* Compute a correlation aggregate.
|
|
30
|
+
* @param x The x expression to aggregate.
|
|
31
|
+
* @param y The y expression to aggregate.
|
|
32
|
+
* @returns A SQL aggregate function call.
|
|
33
|
+
*/
|
|
34
|
+
export declare function corr(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
35
|
+
/**
|
|
36
|
+
* Compute a count aggregate.
|
|
37
|
+
* @param [expr] An optional expression
|
|
38
|
+
* to count. If specified, only non-null expression values are counted.
|
|
39
|
+
* If omitted, all rows within a group are counted.
|
|
40
|
+
* @returns A SQL aggregate function call.
|
|
41
|
+
*/
|
|
42
|
+
export declare function count(expr?: ExprValue): import("../index.js").AggregateNode;
|
|
43
|
+
/**
|
|
44
|
+
* Compute a sample covariance aggregate.
|
|
45
|
+
* @param x The x expression to aggregate.
|
|
46
|
+
* @param y The y expression to aggregate.
|
|
47
|
+
* @returns A SQL aggregate function call.
|
|
48
|
+
*/
|
|
49
|
+
export declare function covariance(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
50
|
+
/**
|
|
51
|
+
* Compute a population covariance aggregate.
|
|
52
|
+
* @param x The x expression to aggregate.
|
|
53
|
+
* @param y The y expression to aggregate.
|
|
54
|
+
* @returns A SQL aggregate function call.
|
|
55
|
+
*/
|
|
56
|
+
export declare function covarPop(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
57
|
+
/**
|
|
58
|
+
* Compute an entropy aggregate.
|
|
59
|
+
* @param expr The expression to aggregate.
|
|
60
|
+
* @returns A SQL aggregate function call.
|
|
61
|
+
*/
|
|
62
|
+
export declare function entropy(expr: ExprValue): import("../index.js").AggregateNode;
|
|
63
|
+
/**
|
|
64
|
+
* Compute a first aggregate.
|
|
65
|
+
* @param expr The expression to aggregate.
|
|
66
|
+
* @returns A SQL aggregate function call.
|
|
67
|
+
*/
|
|
68
|
+
export declare function first(expr: ExprValue): import("../index.js").AggregateNode;
|
|
69
|
+
/**
|
|
70
|
+
* Compute a geomean aggregate.
|
|
71
|
+
* @param expr The expression to aggregate.
|
|
72
|
+
* @returns A SQL aggregate function call.
|
|
73
|
+
*/
|
|
74
|
+
export declare function geomean(expr: ExprValue): import("../index.js").AggregateNode;
|
|
75
|
+
/**
|
|
76
|
+
* Compute a sample kurtosis aggregate.
|
|
77
|
+
* @param expr The expression to aggregate.
|
|
78
|
+
* @returns A SQL aggregate function call.
|
|
79
|
+
*/
|
|
80
|
+
export declare function kurtosis(expr: ExprValue): import("../index.js").AggregateNode;
|
|
81
|
+
/**
|
|
82
|
+
* Compute a median absolute deviation (MAD) aggregate.
|
|
83
|
+
* @param expr The expression to aggregate.
|
|
84
|
+
* @returns A SQL aggregate function call.
|
|
85
|
+
*/
|
|
86
|
+
export declare function mad(expr: ExprValue): import("../index.js").AggregateNode;
|
|
87
|
+
/**
|
|
88
|
+
* Compute a maximum aggregate.
|
|
89
|
+
* @param expr The expression to aggregate.
|
|
90
|
+
* @returns A SQL aggregate function call.
|
|
91
|
+
*/
|
|
92
|
+
export declare function max(expr: ExprValue): import("../index.js").AggregateNode;
|
|
93
|
+
/**
|
|
94
|
+
* Compute a median aggregate.
|
|
95
|
+
* @param expr The expression to aggregate.
|
|
96
|
+
* @returns A SQL aggregate function call.
|
|
97
|
+
*/
|
|
98
|
+
export declare function median(expr: ExprValue): import("../index.js").AggregateNode;
|
|
99
|
+
/**
|
|
100
|
+
* Compute a minimum aggregate.
|
|
101
|
+
* @param expr The expression to aggregate.
|
|
102
|
+
* @returns A SQL aggregate function call.
|
|
103
|
+
*/
|
|
104
|
+
export declare function min(expr: ExprValue): import("../index.js").AggregateNode;
|
|
105
|
+
/**
|
|
106
|
+
* Compute a mode aggregate.
|
|
107
|
+
* @param expr The expression to aggregate.
|
|
108
|
+
* @returns A SQL aggregate function call.
|
|
109
|
+
*/
|
|
110
|
+
export declare function mode(expr: ExprValue): import("../index.js").AggregateNode;
|
|
111
|
+
/**
|
|
112
|
+
* Compute a last aggregate.
|
|
113
|
+
* @param expr The expression to aggregate.
|
|
114
|
+
* @returns A SQL aggregate function call.
|
|
115
|
+
*/
|
|
116
|
+
export declare function last(expr: ExprValue): import("../index.js").AggregateNode;
|
|
117
|
+
/**
|
|
118
|
+
* Compute a product aggregate.
|
|
119
|
+
* @param expr The expression to aggregate.
|
|
120
|
+
* @returns A SQL aggregate function call.
|
|
121
|
+
*/
|
|
122
|
+
export declare function product(expr: ExprValue): import("../index.js").AggregateNode;
|
|
123
|
+
/**
|
|
124
|
+
* Compute a quantile aggregate.
|
|
125
|
+
* @param expr The expression to aggregate.
|
|
126
|
+
* @param p The quantile value.
|
|
127
|
+
* @returns A SQL aggregate function call.
|
|
128
|
+
*/
|
|
129
|
+
export declare function quantile(expr: ExprValue, p: ExprValue): import("../index.js").AggregateNode;
|
|
130
|
+
/**
|
|
131
|
+
* Compute a linear regression reg_avgX aggregate.
|
|
132
|
+
* @param x The x expression to aggregate.
|
|
133
|
+
* @param y The y expression to aggregate.
|
|
134
|
+
* @returns A SQL aggregate function call.
|
|
135
|
+
*/
|
|
136
|
+
export declare function regrAvgX(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
137
|
+
/**
|
|
138
|
+
* Compute a linear regression reg_avgY aggregate.
|
|
139
|
+
* @param x The x expression to aggregate.
|
|
140
|
+
* @param y The y expression to aggregate.
|
|
141
|
+
* @returns A SQL aggregate function call.
|
|
142
|
+
*/
|
|
143
|
+
export declare function regrAvgY(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
144
|
+
/**
|
|
145
|
+
* Compute a linear regression count aggregate.
|
|
146
|
+
* This returns the count of rows where both x and y are non-null.
|
|
147
|
+
* @param x The x expression to aggregate.
|
|
148
|
+
* @param y The y expression to aggregate.
|
|
149
|
+
* @returns A SQL aggregate function call.
|
|
150
|
+
*/
|
|
151
|
+
export declare function regrCount(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
152
|
+
/**
|
|
153
|
+
* Compute a linear regression intercept aggregate.
|
|
154
|
+
* @param x The x expression to aggregate.
|
|
155
|
+
* @param y The y expression to aggregate.
|
|
156
|
+
* @returns A SQL aggregate function call.
|
|
157
|
+
*/
|
|
158
|
+
export declare function regrIntercept(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
159
|
+
/**
|
|
160
|
+
* Compute a linear regression R^2 aggregate.
|
|
161
|
+
* @param x The x expression to aggregate.
|
|
162
|
+
* @param y The y expression to aggregate.
|
|
163
|
+
* @returns A SQL aggregate function call.
|
|
164
|
+
*/
|
|
165
|
+
export declare function regrR2(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
166
|
+
/**
|
|
167
|
+
* Compute a linear regression regr_sxx aggregate.
|
|
168
|
+
* @param x The x expression to aggregate.
|
|
169
|
+
* @param y The y expression to aggregate.
|
|
170
|
+
* @returns A SQL aggregate function call.
|
|
171
|
+
*/
|
|
172
|
+
export declare function regrSXX(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
173
|
+
/**
|
|
174
|
+
* Compute a linear regression regr_sxy aggregate.
|
|
175
|
+
* @param x The x expression to aggregate.
|
|
176
|
+
* @param y The y expression to aggregate.
|
|
177
|
+
* @returns A SQL aggregate function call.
|
|
178
|
+
*/
|
|
179
|
+
export declare function regrSXY(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
180
|
+
/**
|
|
181
|
+
* Compute a linear regression regr_syy aggregate.
|
|
182
|
+
* @param x The x expression to aggregate.
|
|
183
|
+
* @param y The y expression to aggregate.
|
|
184
|
+
* @returns A SQL aggregate function call.
|
|
185
|
+
*/
|
|
186
|
+
export declare function regrSYY(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
187
|
+
/**
|
|
188
|
+
* Compute a linear regression slope aggregate.
|
|
189
|
+
* @param x The x expression to aggregate.
|
|
190
|
+
* @param y The y expression to aggregate.
|
|
191
|
+
* @returns A SQL aggregate function call.
|
|
192
|
+
*/
|
|
193
|
+
export declare function regrSlope(x: ExprValue, y: ExprValue): import("../index.js").AggregateNode;
|
|
194
|
+
/**
|
|
195
|
+
* Compute a skewness aggregate.
|
|
196
|
+
* @param expr The expression to aggregate.
|
|
197
|
+
* @returns A SQL aggregate function call.
|
|
198
|
+
*/
|
|
199
|
+
export declare function skewness(expr: ExprValue): import("../index.js").AggregateNode;
|
|
200
|
+
/**
|
|
201
|
+
* Compute a sample standard deviation aggregate.
|
|
202
|
+
* @param expr The expression to aggregate.
|
|
203
|
+
* @returns A SQL aggregate function call.
|
|
204
|
+
*/
|
|
205
|
+
export declare function stddev(expr: ExprValue): import("../index.js").AggregateNode;
|
|
206
|
+
/**
|
|
207
|
+
* Compute a population standard deviation aggregate.
|
|
208
|
+
* @param expr The expression to aggregate.
|
|
209
|
+
* @returns A SQL aggregate function call.
|
|
210
|
+
*/
|
|
211
|
+
export declare function stddevPop(expr: ExprValue): import("../index.js").AggregateNode;
|
|
212
|
+
/**
|
|
213
|
+
* Compute a string aggregation.
|
|
214
|
+
* @param expr The expression to aggregate.
|
|
215
|
+
* @returns A SQL aggregate function call.
|
|
216
|
+
*/
|
|
217
|
+
export declare function stringAgg(expr: ExprValue): import("../index.js").AggregateNode;
|
|
218
|
+
/**
|
|
219
|
+
* Compute a sum aggregate.
|
|
220
|
+
* @param expr The expression to aggregate.
|
|
221
|
+
* @returns A SQL aggregate function call.
|
|
222
|
+
*/
|
|
223
|
+
export declare function sum(expr: ExprValue): import("../index.js").AggregateNode;
|
|
224
|
+
/**
|
|
225
|
+
* Compute a sample variance aggregate.
|
|
226
|
+
* @param expr The expression to aggregate.
|
|
227
|
+
* @returns A SQL aggregate function call.
|
|
228
|
+
*/
|
|
229
|
+
export declare function variance(expr: ExprValue): import("../index.js").AggregateNode;
|
|
230
|
+
/**
|
|
231
|
+
* Compute a population variance aggregate.
|
|
232
|
+
* @param expr The expression to aggregate.
|
|
233
|
+
* @returns A SQL aggregate function call.
|
|
234
|
+
*/
|
|
235
|
+
export declare function varPop(expr: ExprValue): import("../index.js").AggregateNode;
|
|
236
|
+
//# sourceMappingURL=aggregate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../src/functions/aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,uCAEhD;AAED;;;;;GAK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;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,uCAElC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,uCAEvC;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,uCAErC"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { aggFn } from '../util/function.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compute an arg_max aggregate.
|
|
4
|
+
* @param y The argument to return.
|
|
5
|
+
* @param x The expression to maximize.
|
|
6
|
+
* @returns A SQL aggregate function call.
|
|
7
|
+
*/
|
|
8
|
+
export function argmax(y, x) {
|
|
9
|
+
return aggFn('arg_max', y, x);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Compute an arg_min aggregate.
|
|
13
|
+
* @param y The argument to return.
|
|
14
|
+
* @param x The expression to minimize.
|
|
15
|
+
* @returns A SQL aggregate function call.
|
|
16
|
+
*/
|
|
17
|
+
export function argmin(y, x) {
|
|
18
|
+
return aggFn('arg_min', y, x);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Compute an array aggregation.
|
|
22
|
+
* @param expr The expression to aggregate.
|
|
23
|
+
* @returns A SQL aggregate function call.
|
|
24
|
+
*/
|
|
25
|
+
export function arrayAgg(expr) {
|
|
26
|
+
return aggFn('array_agg', expr);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Compute an average aggregate.
|
|
30
|
+
* @param expr The expression to aggregate.
|
|
31
|
+
* @returns A SQL aggregate function call.
|
|
32
|
+
*/
|
|
33
|
+
export function avg(expr) {
|
|
34
|
+
return aggFn('avg', expr);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Compute a correlation aggregate.
|
|
38
|
+
* @param x The x expression to aggregate.
|
|
39
|
+
* @param y The y expression to aggregate.
|
|
40
|
+
* @returns A SQL aggregate function call.
|
|
41
|
+
*/
|
|
42
|
+
export function corr(x, y) {
|
|
43
|
+
return aggFn('corr', x, y);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Compute a count aggregate.
|
|
47
|
+
* @param [expr] An optional expression
|
|
48
|
+
* to count. If specified, only non-null expression values are counted.
|
|
49
|
+
* If omitted, all rows within a group are counted.
|
|
50
|
+
* @returns A SQL aggregate function call.
|
|
51
|
+
*/
|
|
52
|
+
export function count(expr) {
|
|
53
|
+
return aggFn('count', expr);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Compute a sample covariance aggregate.
|
|
57
|
+
* @param x The x expression to aggregate.
|
|
58
|
+
* @param y The y expression to aggregate.
|
|
59
|
+
* @returns A SQL aggregate function call.
|
|
60
|
+
*/
|
|
61
|
+
export function covariance(x, y) {
|
|
62
|
+
return aggFn('covar_samp', x, y);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Compute a population covariance aggregate.
|
|
66
|
+
* @param x The x expression to aggregate.
|
|
67
|
+
* @param y The y expression to aggregate.
|
|
68
|
+
* @returns A SQL aggregate function call.
|
|
69
|
+
*/
|
|
70
|
+
export function covarPop(x, y) {
|
|
71
|
+
return aggFn('covar_pop', x, y);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Compute an entropy aggregate.
|
|
75
|
+
* @param expr The expression to aggregate.
|
|
76
|
+
* @returns A SQL aggregate function call.
|
|
77
|
+
*/
|
|
78
|
+
export function entropy(expr) {
|
|
79
|
+
return aggFn('entropy', expr);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Compute a first aggregate.
|
|
83
|
+
* @param expr The expression to aggregate.
|
|
84
|
+
* @returns A SQL aggregate function call.
|
|
85
|
+
*/
|
|
86
|
+
export function first(expr) {
|
|
87
|
+
return aggFn('first', expr);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Compute a geomean aggregate.
|
|
91
|
+
* @param expr The expression to aggregate.
|
|
92
|
+
* @returns A SQL aggregate function call.
|
|
93
|
+
*/
|
|
94
|
+
export function geomean(expr) {
|
|
95
|
+
return aggFn('geomean', expr);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Compute a sample kurtosis aggregate.
|
|
99
|
+
* @param expr The expression to aggregate.
|
|
100
|
+
* @returns A SQL aggregate function call.
|
|
101
|
+
*/
|
|
102
|
+
export function kurtosis(expr) {
|
|
103
|
+
return aggFn('kurtosis', expr);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Compute a median absolute deviation (MAD) aggregate.
|
|
107
|
+
* @param expr The expression to aggregate.
|
|
108
|
+
* @returns A SQL aggregate function call.
|
|
109
|
+
*/
|
|
110
|
+
export function mad(expr) {
|
|
111
|
+
return aggFn('mad', expr);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Compute a maximum aggregate.
|
|
115
|
+
* @param expr The expression to aggregate.
|
|
116
|
+
* @returns A SQL aggregate function call.
|
|
117
|
+
*/
|
|
118
|
+
export function max(expr) {
|
|
119
|
+
return aggFn('max', expr);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Compute a median aggregate.
|
|
123
|
+
* @param expr The expression to aggregate.
|
|
124
|
+
* @returns A SQL aggregate function call.
|
|
125
|
+
*/
|
|
126
|
+
export function median(expr) {
|
|
127
|
+
return aggFn('median', expr);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Compute a minimum aggregate.
|
|
131
|
+
* @param expr The expression to aggregate.
|
|
132
|
+
* @returns A SQL aggregate function call.
|
|
133
|
+
*/
|
|
134
|
+
export function min(expr) {
|
|
135
|
+
return aggFn('min', expr);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Compute a mode aggregate.
|
|
139
|
+
* @param expr The expression to aggregate.
|
|
140
|
+
* @returns A SQL aggregate function call.
|
|
141
|
+
*/
|
|
142
|
+
export function mode(expr) {
|
|
143
|
+
return aggFn('mode', expr);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Compute a last aggregate.
|
|
147
|
+
* @param expr The expression to aggregate.
|
|
148
|
+
* @returns A SQL aggregate function call.
|
|
149
|
+
*/
|
|
150
|
+
export function last(expr) {
|
|
151
|
+
return aggFn('last', expr);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Compute a product aggregate.
|
|
155
|
+
* @param expr The expression to aggregate.
|
|
156
|
+
* @returns A SQL aggregate function call.
|
|
157
|
+
*/
|
|
158
|
+
export function product(expr) {
|
|
159
|
+
return aggFn('product', expr);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Compute a quantile aggregate.
|
|
163
|
+
* @param expr The expression to aggregate.
|
|
164
|
+
* @param p The quantile value.
|
|
165
|
+
* @returns A SQL aggregate function call.
|
|
166
|
+
*/
|
|
167
|
+
export function quantile(expr, p) {
|
|
168
|
+
return aggFn('quantile', expr, p);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Compute a linear regression reg_avgX aggregate.
|
|
172
|
+
* @param x The x expression to aggregate.
|
|
173
|
+
* @param y The y expression to aggregate.
|
|
174
|
+
* @returns A SQL aggregate function call.
|
|
175
|
+
*/
|
|
176
|
+
export function regrAvgX(x, y) {
|
|
177
|
+
return aggFn('regr_avgx', x, y);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Compute a linear regression reg_avgY aggregate.
|
|
181
|
+
* @param x The x expression to aggregate.
|
|
182
|
+
* @param y The y expression to aggregate.
|
|
183
|
+
* @returns A SQL aggregate function call.
|
|
184
|
+
*/
|
|
185
|
+
export function regrAvgY(x, y) {
|
|
186
|
+
return aggFn('regr_avgy', x, y);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Compute a linear regression count aggregate.
|
|
190
|
+
* This returns the count of rows where both x and y are non-null.
|
|
191
|
+
* @param x The x expression to aggregate.
|
|
192
|
+
* @param y The y expression to aggregate.
|
|
193
|
+
* @returns A SQL aggregate function call.
|
|
194
|
+
*/
|
|
195
|
+
export function regrCount(x, y) {
|
|
196
|
+
return aggFn('regr_count', x, y);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Compute a linear regression intercept aggregate.
|
|
200
|
+
* @param x The x expression to aggregate.
|
|
201
|
+
* @param y The y expression to aggregate.
|
|
202
|
+
* @returns A SQL aggregate function call.
|
|
203
|
+
*/
|
|
204
|
+
export function regrIntercept(x, y) {
|
|
205
|
+
return aggFn('regr_intercept', x, y);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Compute a linear regression R^2 aggregate.
|
|
209
|
+
* @param x The x expression to aggregate.
|
|
210
|
+
* @param y The y expression to aggregate.
|
|
211
|
+
* @returns A SQL aggregate function call.
|
|
212
|
+
*/
|
|
213
|
+
export function regrR2(x, y) {
|
|
214
|
+
return aggFn('regr_r2', x, y);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Compute a linear regression regr_sxx aggregate.
|
|
218
|
+
* @param x The x expression to aggregate.
|
|
219
|
+
* @param y The y expression to aggregate.
|
|
220
|
+
* @returns A SQL aggregate function call.
|
|
221
|
+
*/
|
|
222
|
+
export function regrSXX(x, y) {
|
|
223
|
+
return aggFn('regr_sxx', x, y);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Compute a linear regression regr_sxy aggregate.
|
|
227
|
+
* @param x The x expression to aggregate.
|
|
228
|
+
* @param y The y expression to aggregate.
|
|
229
|
+
* @returns A SQL aggregate function call.
|
|
230
|
+
*/
|
|
231
|
+
export function regrSXY(x, y) {
|
|
232
|
+
return aggFn('regr_sxy', x, y);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Compute a linear regression regr_syy aggregate.
|
|
236
|
+
* @param x The x expression to aggregate.
|
|
237
|
+
* @param y The y expression to aggregate.
|
|
238
|
+
* @returns A SQL aggregate function call.
|
|
239
|
+
*/
|
|
240
|
+
export function regrSYY(x, y) {
|
|
241
|
+
return aggFn('regr_syy', x, y);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Compute a linear regression slope aggregate.
|
|
245
|
+
* @param x The x expression to aggregate.
|
|
246
|
+
* @param y The y expression to aggregate.
|
|
247
|
+
* @returns A SQL aggregate function call.
|
|
248
|
+
*/
|
|
249
|
+
export function regrSlope(x, y) {
|
|
250
|
+
return aggFn('regr_slope', x, y);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Compute a skewness aggregate.
|
|
254
|
+
* @param expr The expression to aggregate.
|
|
255
|
+
* @returns A SQL aggregate function call.
|
|
256
|
+
*/
|
|
257
|
+
export function skewness(expr) {
|
|
258
|
+
return aggFn('skewness', expr);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Compute a sample standard deviation aggregate.
|
|
262
|
+
* @param expr The expression to aggregate.
|
|
263
|
+
* @returns A SQL aggregate function call.
|
|
264
|
+
*/
|
|
265
|
+
export function stddev(expr) {
|
|
266
|
+
return aggFn('stddev', expr);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Compute a population standard deviation aggregate.
|
|
270
|
+
* @param expr The expression to aggregate.
|
|
271
|
+
* @returns A SQL aggregate function call.
|
|
272
|
+
*/
|
|
273
|
+
export function stddevPop(expr) {
|
|
274
|
+
return aggFn('stddev_pop', expr);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Compute a string aggregation.
|
|
278
|
+
* @param expr The expression to aggregate.
|
|
279
|
+
* @returns A SQL aggregate function call.
|
|
280
|
+
*/
|
|
281
|
+
export function stringAgg(expr) {
|
|
282
|
+
return aggFn('string_agg', expr);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Compute a sum aggregate.
|
|
286
|
+
* @param expr The expression to aggregate.
|
|
287
|
+
* @returns A SQL aggregate function call.
|
|
288
|
+
*/
|
|
289
|
+
export function sum(expr) {
|
|
290
|
+
return aggFn('sum', expr);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Compute a sample variance aggregate.
|
|
294
|
+
* @param expr The expression to aggregate.
|
|
295
|
+
* @returns A SQL aggregate function call.
|
|
296
|
+
*/
|
|
297
|
+
export function variance(expr) {
|
|
298
|
+
return aggFn('var_samp', expr);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Compute a population variance aggregate.
|
|
302
|
+
* @param expr The expression to aggregate.
|
|
303
|
+
* @returns A SQL aggregate function call.
|
|
304
|
+
*/
|
|
305
|
+
export function varPop(expr) {
|
|
306
|
+
return aggFn('var_pop', expr);
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=aggregate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../../src/functions/aggregate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,CAAY,EAAE,CAAY;IAC/C,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,CAAY,EAAE,CAAY;IAC/C,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAe;IACtC,OAAO,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,IAAe;IACjC,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAAC,CAAY,EAAE,CAAY;IAC7C,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7B,CAAC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G;AACH,MAAM,UAAU,QAAQ,CAAC,IAAe;IACtC,OAAO,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,IAAe;IACpC,OAAO,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ExprValue } from '../types.js';
|
|
2
|
+
import { CaseNode } from '../ast/case.js';
|
|
3
|
+
/**
|
|
4
|
+
* Create a new conditional CASE statement. If three arguments are provided,
|
|
5
|
+
* acts like a ternary conditional (if, then, else). If no arguments are
|
|
6
|
+
* provided, the chained `when` and `else` methods can be used to to complete
|
|
7
|
+
* a conditional statement with WHEN/THEN and ELSE expressions.
|
|
8
|
+
* @param when A conditional WHEN expression.
|
|
9
|
+
* @param then A THEN value expression.
|
|
10
|
+
* @param other An ELSE expression.
|
|
11
|
+
*/
|
|
12
|
+
export declare function cond(when?: ExprValue, then?: ExprValue, other?: ExprValue): CaseNode;
|
|
13
|
+
//# sourceMappingURL=case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../src/functions/case.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAY,MAAM,gBAAgB,CAAC;AAGpD;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,SAAS,YAIzE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CaseNode, WhenNode } from '../ast/case.js';
|
|
2
|
+
import { asNode } from '../util/ast.js';
|
|
3
|
+
/**
|
|
4
|
+
* Create a new conditional CASE statement. If three arguments are provided,
|
|
5
|
+
* acts like a ternary conditional (if, then, else). If no arguments are
|
|
6
|
+
* provided, the chained `when` and `else` methods can be used to to complete
|
|
7
|
+
* a conditional statement with WHEN/THEN and ELSE expressions.
|
|
8
|
+
* @param when A conditional WHEN expression.
|
|
9
|
+
* @param then A THEN value expression.
|
|
10
|
+
* @param other An ELSE expression.
|
|
11
|
+
*/
|
|
12
|
+
export function cond(when, then, other) {
|
|
13
|
+
return when
|
|
14
|
+
? new CaseNode(undefined, [new WhenNode(asNode(when), asNode(then))], asNode(other))
|
|
15
|
+
: new CaseNode();
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.js","sourceRoot":"","sources":["../../../src/functions/case.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAAC,IAAgB,EAAE,IAAgB,EAAE,KAAiB;IACxE,OAAO,IAAI;QACT,CAAC,CAAC,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QACpF,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CastNode } from '../ast/cast.js';
|
|
2
|
+
/**
|
|
3
|
+
* Perform a type cast.
|
|
4
|
+
* @param expr The expression to type cast.
|
|
5
|
+
* @param type The type to cast to.
|
|
6
|
+
*/
|
|
7
|
+
export declare function cast(expr: unknown, type: string): CastNode;
|
|
8
|
+
/**
|
|
9
|
+
* Cast an expression to a 32-bit integer type.
|
|
10
|
+
* @param expr The expression to type cast.
|
|
11
|
+
*/
|
|
12
|
+
export declare function int32(expr: unknown): CastNode;
|
|
13
|
+
/**
|
|
14
|
+
* Cast an expression to a 32-bit floating point number type.
|
|
15
|
+
* @param expr The expression to type cast.
|
|
16
|
+
*/
|
|
17
|
+
export declare function float32(expr: unknown): CastNode;
|
|
18
|
+
/**
|
|
19
|
+
* Cast an expression to a 64-bit floating point number type.
|
|
20
|
+
* @param expr The expression to type cast.
|
|
21
|
+
*/
|
|
22
|
+
export declare function float64(expr: unknown): CastNode;
|
|
23
|
+
//# sourceMappingURL=cast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cast.d.ts","sourceRoot":"","sources":["../../../src/functions/cast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAE/C;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,OAAO,YAElC;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,YAEpC;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,YAEpC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CastNode } from '../ast/cast.js';
|
|
2
|
+
import { asNode } from '../util/ast.js';
|
|
3
|
+
/**
|
|
4
|
+
* Perform a type cast.
|
|
5
|
+
* @param expr The expression to type cast.
|
|
6
|
+
* @param type The type to cast to.
|
|
7
|
+
*/
|
|
8
|
+
export function cast(expr, type) {
|
|
9
|
+
return new CastNode(asNode(expr), type);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Cast an expression to a 32-bit integer type.
|
|
13
|
+
* @param expr The expression to type cast.
|
|
14
|
+
*/
|
|
15
|
+
export function int32(expr) {
|
|
16
|
+
return cast(expr, 'INTEGER');
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Cast an expression to a 32-bit floating point number type.
|
|
20
|
+
* @param expr The expression to type cast.
|
|
21
|
+
*/
|
|
22
|
+
export function float32(expr) {
|
|
23
|
+
return cast(expr, 'FLOAT');
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Cast an expression to a 64-bit floating point number type.
|
|
27
|
+
* @param expr The expression to type cast.
|
|
28
|
+
*/
|
|
29
|
+
export function float64(expr) {
|
|
30
|
+
return cast(expr, 'DOUBLE');
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=cast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cast.js","sourceRoot":"","sources":["../../../src/functions/cast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,IAAa,EAAE,IAAY;IAC9C,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,IAAa;IACjC,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,IAAa;IACnC,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,IAAa;IACnC,OAAO,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ExprValue } from '../types.js';
|
|
2
|
+
import { CollateNode } from '../ast/collate.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 declare function collate(expr: ExprValue, collation: string): CollateNode;
|
|
10
|
+
//# sourceMappingURL=collate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collate.d.ts","sourceRoot":"","sources":["../../../src/functions/collate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAEzD"}
|