@uwdata/mosaic-sql 0.16.2 → 0.18.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 +1 -1
- 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/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/{types → src}/ast/param.d.ts +11 -11
- 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 +294 -0
- package/dist/src/ast/query.d.ts.map +1 -0
- package/dist/src/ast/query.js +584 -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/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/{types → src}/ast/with.d.ts +15 -22
- 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 +38 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +38 -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/{types → src}/functions/case.d.ts +7 -7
- 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/{types → src}/functions/cte.d.ts +7 -7
- 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/{types → src}/functions/literal.d.ts +8 -8
- 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/{types → src}/functions/sql-template-tag.d.ts +8 -10
- 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/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/{types → src}/functions/window.d.ts +24 -39
- 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 +69 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{src → dist/src}/index.js +16 -12
- 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/{types → src}/types.d.ts +6 -19
- 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/{types → src}/util/ast.d.ts +26 -25
- 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 +36 -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/{types → src}/visit/visitors.d.ts +14 -16
- 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 +12 -10
- package/src/ast/aggregate.ts +198 -0
- 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.ts +27 -0
- 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.ts +40 -0
- 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/{literal.js → literal.ts} +6 -9
- package/src/ast/logical-op.ts +50 -0
- package/src/ast/node.ts +39 -0
- package/src/ast/order-by.ts +38 -0
- package/src/ast/{param.js → param.ts} +6 -12
- package/src/ast/{query.js → query.ts} +193 -205
- package/src/ast/sample.ts +47 -0
- package/src/ast/{select.js → select.ts} +10 -16
- package/src/ast/subquery.ts +24 -0
- 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/{verbatim.js → verbatim.ts} +9 -8
- package/src/ast/window-frame.ts +97 -0
- package/src/ast/window.ts +246 -0
- package/src/ast/{with.js → with.ts} +19 -20
- package/src/{constants.js → constants.ts} +5 -6
- 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.ts +13 -0
- package/src/functions/{column.js → column.ts} +9 -10
- package/src/functions/{cte.js → cte.ts} +9 -6
- package/src/functions/datetime.ts +50 -0
- package/src/functions/interval.ts +74 -0
- package/src/functions/{literal.js → literal.ts} +6 -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/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 +75 -0
- package/src/load/{create.js → create.ts} +9 -3
- package/src/load/extension.ts +3 -0
- package/src/load/{load.js → load.ts} +26 -11
- 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.ts +40 -0
- 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 -30
- 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.ts +53 -0
- package/src/visit/{recurse.js → recurse.ts} +18 -6
- package/src/visit/{rewrite.js → rewrite.ts} +10 -18
- package/src/visit/{visitors.js → visitors.ts} +22 -30
- package/src/visit/walk.ts +46 -0
- package/dist/types/ast/aggregate.d.ts +0 -71
- package/dist/types/ast/between-op.d.ts +0 -46
- package/dist/types/ast/binary-op.d.ts +0 -28
- package/dist/types/ast/case.d.ts +0 -67
- package/dist/types/ast/cast.d.ts +0 -21
- package/dist/types/ast/column-param.d.ts +0 -23
- package/dist/types/ast/column-ref.d.ts +0 -40
- package/dist/types/ast/fragment.d.ts +0 -14
- package/dist/types/ast/from.d.ts +0 -21
- package/dist/types/ast/function.d.ts +0 -21
- package/dist/types/ast/in-op.d.ts +0 -21
- package/dist/types/ast/interval.d.ts +0 -21
- package/dist/types/ast/literal.d.ts +0 -15
- package/dist/types/ast/logical-op.d.ts +0 -46
- package/dist/types/ast/node.d.ts +0 -24
- package/dist/types/ast/order-by.d.ts +0 -29
- package/dist/types/ast/query.d.ts +0 -320
- package/dist/types/ast/sample.d.ts +0 -42
- package/dist/types/ast/select.d.ts +0 -22
- package/dist/types/ast/table-ref.d.ts +0 -25
- package/dist/types/ast/unary-op.d.ts +0 -39
- package/dist/types/ast/verbatim.d.ts +0 -9
- package/dist/types/ast/window.d.ts +0 -180
- package/dist/types/constants.d.ts +0 -38
- package/dist/types/functions/aggregate.d.ts +0 -236
- package/dist/types/functions/cast.d.ts +0 -26
- package/dist/types/functions/column.d.ts +0 -11
- package/dist/types/functions/datetime.d.ts +0 -45
- package/dist/types/functions/numeric.d.ts +0 -95
- package/dist/types/functions/operators.d.ts +0 -200
- package/dist/types/functions/order-by.d.ts +0 -18
- package/dist/types/functions/spatial.d.ts +0 -38
- package/dist/types/functions/string.d.ts +0 -57
- package/dist/types/functions/table-ref.d.ts +0 -9
- package/dist/types/functions/util.d.ts +0 -8
- package/dist/types/index-types.d.ts +0 -2
- package/dist/types/index.d.ts +0 -59
- package/dist/types/load/create.d.ts +0 -8
- package/dist/types/load/extension.d.ts +0 -1
- package/dist/types/load/load.d.ts +0 -12
- package/dist/types/load/sql-from.d.ts +0 -11
- package/dist/types/transforms/bin-1d.d.ts +0 -15
- package/dist/types/transforms/bin-2d.d.ts +0 -19
- package/dist/types/transforms/bin-date.d.ts +0 -44
- package/dist/types/transforms/bin-histogram.d.ts +0 -51
- package/dist/types/transforms/bin-linear-1d.d.ts +0 -12
- package/dist/types/transforms/bin-linear-2d.d.ts +0 -19
- package/dist/types/transforms/line-density.d.ts +0 -24
- package/dist/types/transforms/m4.d.ts +0 -21
- package/dist/types/transforms/scales.d.ts +0 -1
- package/dist/types/transforms/util/bin-step.d.ts +0 -61
- package/dist/types/transforms/util/time-interval.d.ts +0 -13
- package/dist/types/util/function.d.ts +0 -56
- package/dist/types/util/string.d.ts +0 -3
- package/dist/types/util/type-check.d.ts +0 -22
- package/dist/types/visit/recurse.d.ts +0 -28
- package/dist/types/visit/rewrite.d.ts +0 -10
- package/dist/types/visit/walk.d.ts +0 -10
- package/jsconfig.json +0 -11
- package/src/ast/aggregate.js +0 -167
- 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/from.js +0 -40
- package/src/ast/logical-op.js +0 -67
- package/src/ast/node.js +0 -29
- package/src/ast/order-by.js +0 -48
- package/src/ast/sample.js +0 -53
- package/src/ast/window.js +0 -294
- package/src/functions/aggregate.js +0 -347
- package/src/functions/datetime.js +0 -68
- 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/index-types.ts +0 -2
- package/src/load/extension.js +0 -3
- package/src/transforms/bin-date.js +0 -37
- 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 -35
- package/tsconfig.json +0 -12
- package/vitest.config.ts +0 -3
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Function that returns true if a string contains a regexp pattern,
|
|
3
|
-
* false otherwise.
|
|
4
|
-
* @param {ExprValue} string The string match against.
|
|
5
|
-
* @param {StringValue} pattern The regular expression pattern to match.
|
|
6
|
-
* @param {StringValue} [options] Regular expression options:
|
|
7
|
-
* 'c': case-sensitive matching
|
|
8
|
-
* 'i': case-insensitive matching
|
|
9
|
-
* 'l': match literals instead of regular expression tokens
|
|
10
|
-
* 'm', 'n', 'p': newline sensitive matching
|
|
11
|
-
* 'g': global replace, only available for regexp_replace
|
|
12
|
-
* 's': non-newline sensitive matching
|
|
13
|
-
* @returns {FunctionNode}
|
|
14
|
-
*/
|
|
15
|
-
export function regexp_matches(string: ExprValue, pattern: StringValue, options?: StringValue): FunctionNode;
|
|
16
|
-
/**
|
|
17
|
-
* Function that returns true if search_string is found within string.
|
|
18
|
-
* @param {ExprValue} string The string to match against.
|
|
19
|
-
* @param {StringValue} search_string The substring to search for.
|
|
20
|
-
* @returns {FunctionNode}
|
|
21
|
-
*/
|
|
22
|
-
export function contains(string: ExprValue, search_string: StringValue): FunctionNode;
|
|
23
|
-
/**
|
|
24
|
-
* Function that returns true if string begins with search_string.
|
|
25
|
-
* @param {ExprValue} string The string to match against.
|
|
26
|
-
* @param {StringValue} search_string The substring to search for.
|
|
27
|
-
* @returns {FunctionNode}
|
|
28
|
-
*/
|
|
29
|
-
export function prefix(string: ExprValue, search_string: StringValue): FunctionNode;
|
|
30
|
-
/**
|
|
31
|
-
* Function that returns true if string ends with search_string.
|
|
32
|
-
* @param {ExprValue} string The string to match against.
|
|
33
|
-
* @param {StringValue} search_string The substring to search for.
|
|
34
|
-
* @returns {FunctionNode}
|
|
35
|
-
*/
|
|
36
|
-
export function suffix(string: ExprValue, search_string: StringValue): FunctionNode;
|
|
37
|
-
/**
|
|
38
|
-
* Function that converts string to lower case.
|
|
39
|
-
* @param {ExprValue} string The string to convert.
|
|
40
|
-
* @returns {FunctionNode}
|
|
41
|
-
*/
|
|
42
|
-
export function lower(string: ExprValue): FunctionNode;
|
|
43
|
-
/**
|
|
44
|
-
* Function that converts string to upper case.
|
|
45
|
-
* @param {ExprValue} string The string to convert.
|
|
46
|
-
* @returns {FunctionNode}
|
|
47
|
-
*/
|
|
48
|
-
export function upper(string: ExprValue): FunctionNode;
|
|
49
|
-
/**
|
|
50
|
-
* Function that returns the number of characters in string.
|
|
51
|
-
* @param {ExprValue} value The string to measure.
|
|
52
|
-
* @returns {FunctionNode}
|
|
53
|
-
*/
|
|
54
|
-
export function length(value: ExprValue): FunctionNode;
|
|
55
|
-
import type { ExprValue } from '../types.js';
|
|
56
|
-
import type { StringValue } from '../types.js';
|
|
57
|
-
import type { FunctionNode } from '../ast/function.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a named table or view reference.
|
|
3
|
-
* @param {...(string | string[])} ids Table and namespace identifiers.
|
|
4
|
-
* For example 'name' or ['schema', 'name'].
|
|
5
|
-
* @returns {TableRefNode | undefined} A table reference, or undefined
|
|
6
|
-
* if the input identifier list is empty.
|
|
7
|
-
*/
|
|
8
|
-
export function tableRef(...ids: (string | string[])[]): TableRefNode | undefined;
|
|
9
|
-
import { TableRefNode } from '../ast/table-ref.js';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the first non-null argument.
|
|
3
|
-
* @param {...ExprValue} expr The input expressions.
|
|
4
|
-
* @returns {FunctionNode}
|
|
5
|
-
*/
|
|
6
|
-
export function coalesce(...expr: ExprValue[]): FunctionNode;
|
|
7
|
-
import type { ExprValue } from '../types.js';
|
|
8
|
-
import type { FunctionNode } from '../ast/function.js';
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export { AggregateNode } from "./ast/aggregate.js";
|
|
2
|
-
export { BinaryOpNode } from "./ast/binary-op.js";
|
|
3
|
-
export { CastNode } from "./ast/cast.js";
|
|
4
|
-
export { FragmentNode } from "./ast/fragment.js";
|
|
5
|
-
export { FromClauseNode } from "./ast/from.js";
|
|
6
|
-
export { FunctionNode } from "./ast/function.js";
|
|
7
|
-
export { InOpNode } from "./ast/in-op.js";
|
|
8
|
-
export { IntervalNode } from "./ast/interval.js";
|
|
9
|
-
export { LiteralNode } from "./ast/literal.js";
|
|
10
|
-
export { OrderByNode } from "./ast/order-by.js";
|
|
11
|
-
export { ParamNode } from "./ast/param.js";
|
|
12
|
-
export { SampleClauseNode } from "./ast/sample.js";
|
|
13
|
-
export { SelectClauseNode } from "./ast/select.js";
|
|
14
|
-
export { VerbatimNode } from "./ast/verbatim.js";
|
|
15
|
-
export { WithClauseNode } from "./ast/with.js";
|
|
16
|
-
export { cond } from "./functions/case.js";
|
|
17
|
-
export { column } from "./functions/column.js";
|
|
18
|
-
export { cte } from "./functions/cte.js";
|
|
19
|
-
export { literal } from "./functions/literal.js";
|
|
20
|
-
export { sql } from "./functions/sql-template-tag.js";
|
|
21
|
-
export { coalesce } from "./functions/util.js";
|
|
22
|
-
export { rewrite } from "./visit/rewrite.js";
|
|
23
|
-
export { walk } from "./visit/walk.js";
|
|
24
|
-
export { loadExtension } from "./load/extension.js";
|
|
25
|
-
export { bin1d } from "./transforms/bin-1d.js";
|
|
26
|
-
export { bin2d } from "./transforms/bin-2d.js";
|
|
27
|
-
export { binDate } from "./transforms/bin-date.js";
|
|
28
|
-
export { binHistogram } from "./transforms/bin-histogram.js";
|
|
29
|
-
export { binLinear1d } from "./transforms/bin-linear-1d.js";
|
|
30
|
-
export { binLinear2d } from "./transforms/bin-linear-2d.js";
|
|
31
|
-
export { lineDensity } from "./transforms/line-density.js";
|
|
32
|
-
export { m4 } from "./transforms/m4.js";
|
|
33
|
-
export { scaleTransform } from "./transforms/scales.js";
|
|
34
|
-
export { isParamLike } from "./util/type-check.js";
|
|
35
|
-
export { timeInterval } from "./transforms/util/time-interval.js";
|
|
36
|
-
export { BetweenOpNode, NotBetweenOpNode } from "./ast/between-op.js";
|
|
37
|
-
export { CaseNode, WhenNode } from "./ast/case.js";
|
|
38
|
-
export { ColumnParamNode, isColumnParam } from "./ast/column-param.js";
|
|
39
|
-
export { ColumnRefNode, ColumnNameRefNode, isColumnRef } from "./ast/column-ref.js";
|
|
40
|
-
export { AndNode, OrNode } from "./ast/logical-op.js";
|
|
41
|
-
export { SQLNode, ExprNode, isNode } from "./ast/node.js";
|
|
42
|
-
export { DescribeQuery, Query, SelectQuery, SetOperation, isDescribeQuery, isQuery, isSelectQuery } from "./ast/query.js";
|
|
43
|
-
export { TableRefNode, isTableRef } from "./ast/table-ref.js";
|
|
44
|
-
export { UnaryOpNode, UnaryPosftixOpNode } from "./ast/unary-op.js";
|
|
45
|
-
export { WindowClauseNode, WindowDefNode, WindowFrameNode, WindowFunctionNode, WindowNode } from "./ast/window.js";
|
|
46
|
-
export { argmax, argmin, arrayAgg, avg, corr, count, covariance, covarPop, entropy, first, geomean, kurtosis, mad, max, median, min, mode, last, product, quantile, regrAvgX, regrAvgY, regrCount, regrIntercept, regrR2, regrSXX, regrSXY, regrSYY, regrSlope, skewness, stddev, stddevPop, stringAgg, sum, variance, varPop } from "./functions/aggregate.js";
|
|
47
|
-
export { cast, float32, float64, int32 } from "./functions/cast.js";
|
|
48
|
-
export { dateBin, dateMonth, dateMonthDay, dateDay, epoch_ms, interval } from "./functions/datetime.js";
|
|
49
|
-
export { abs, ceil, exp, floor, greatest, isFinite, isInfinite, isNaN, least, ln, log, round, sign, sqrt, trunc } from "./functions/numeric.js";
|
|
50
|
-
export { and, or, not, isNull, isNotNull, bitNot, bitAnd, bitOr, bitLeft, bitRight, add, sub, mul, div, idiv, mod, pow, eq, neq, lt, gt, lte, gte, isDistinct, isNotDistinct, isBetween, isNotBetween, isIn } from "./functions/operators.js";
|
|
51
|
-
export { asc, desc } from "./functions/order-by.js";
|
|
52
|
-
export { geojson, x, y, centroid, centroidX, centroidY } from "./functions/spatial.js";
|
|
53
|
-
export { regexp_matches, contains, prefix, suffix, lower, upper, length } from "./functions/string.js";
|
|
54
|
-
export { cume_dist, dense_rank, first_value, lag, last_value, lead, nth_value, ntile, percent_rank, rank, row_number } from "./functions/window.js";
|
|
55
|
-
export { collectAggregates, collectColumns, collectParams, isAggregateExpression } from "./visit/visitors.js";
|
|
56
|
-
export { createTable, createSchema } from "./load/create.js";
|
|
57
|
-
export { loadCSV, loadJSON, loadObjects, loadParquet, loadSpatial } from "./load/load.js";
|
|
58
|
-
export { asLiteral, asNode, asTableRef, asVerbatim, over } from "./util/ast.js";
|
|
59
|
-
export { binSpec, binStep } from "./transforms/util/bin-step.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function loadExtension(name: any): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function load(method: any, tableName: any, fileName: any, options?: {}, defaults?: {}): string;
|
|
2
|
-
export function loadCSV(tableName: any, fileName: any, options: any): string;
|
|
3
|
-
export function loadJSON(tableName: any, fileName: any, options: any): string;
|
|
4
|
-
export function loadParquet(tableName: any, fileName: any, options: any): string;
|
|
5
|
-
/**
|
|
6
|
-
* Load geometry data within a spatial file format.
|
|
7
|
-
* This method requires that the DuckDB spatial extension is loaded.
|
|
8
|
-
* Supports GeoJSON, TopoJSON, and other comomn spatial formats.
|
|
9
|
-
* For TopoJSON, wet the layer option to indicate the feature to extract.
|
|
10
|
-
*/
|
|
11
|
-
export function loadSpatial(tableName: any, fileName: any, options?: {}): string;
|
|
12
|
-
export function loadObjects(tableName: any, data: any, options?: {}): string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a SQL query that embeds the given data for loading.
|
|
3
|
-
* @param {*} data The dataset as an array of objects.
|
|
4
|
-
* @param {object} [options] Loading options.
|
|
5
|
-
* @param {string[]|object} [options.columns] The columns to include.
|
|
6
|
-
* If not specified, the keys of the first data object are used.
|
|
7
|
-
* @returns {string} SQL query string to load data.
|
|
8
|
-
*/
|
|
9
|
-
export function sqlFrom(data: any, { columns }?: {
|
|
10
|
-
columns?: string[] | object;
|
|
11
|
-
}): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compute binned values over a one-dimensional extent.
|
|
3
|
-
* @param {ExprValue} x The expression to bin.
|
|
4
|
-
* The expression must return numeric values. For example, to bin
|
|
5
|
-
* datetime values, the input expression might map them to numeric
|
|
6
|
-
* values such as milliseconds since the epoch.
|
|
7
|
-
* @param {number} lo The low value of the bin extent.
|
|
8
|
-
* @param {number} hi The high value of the bin extent.
|
|
9
|
-
* @param {number} bins The integer number of bins to use within the
|
|
10
|
-
* defined binning extent.
|
|
11
|
-
* @param {boolean} [reverse] Flag indicating if bins should be
|
|
12
|
-
* produced in reverse order from *hi* to *lo* (default `false`).
|
|
13
|
-
*/
|
|
14
|
-
export function bin1d(x: ExprValue, lo: number, hi: number, bins: number, reverse?: boolean): import("../index.js").BinaryOpNode;
|
|
15
|
-
import type { ExprValue } from '../types.js';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Perform aggregation over a binned 2D domain. This method takes expressions
|
|
3
|
-
* for the (non-truncated) x and y bin values; these expressions should be
|
|
4
|
-
* in units of grid indices, but can contain fractional components. The
|
|
5
|
-
* resulting query performs grouping and aggregation over the binned domain,
|
|
6
|
-
* and uses a 2D integer bin index of the form (xbin + num_xbins * ybin).
|
|
7
|
-
* @param {SelectQuery} q The input query. The FROM and WHERE clauses should
|
|
8
|
-
* be added to the query separately, either before or after this method.
|
|
9
|
-
* @param {ExprValue} xp The x bin expression.
|
|
10
|
-
* @param {ExprValue} yp The y bin expression.
|
|
11
|
-
* @param {Record<string, ExprValue>} aggs Named
|
|
12
|
-
* aggregate expressions over bins.
|
|
13
|
-
* @param {number} xn The number of bins along the x dimension
|
|
14
|
-
* @param {string[]} groupby Group by expressions.
|
|
15
|
-
* @returns {SelectQuery} The input query, with binning expressions added.
|
|
16
|
-
*/
|
|
17
|
-
export function bin2d(q: SelectQuery, xp: ExprValue, yp: ExprValue, aggs: Record<string, ExprValue>, xn: number, groupby: string[]): SelectQuery;
|
|
18
|
-
import type { SelectQuery } from '../ast/query.js';
|
|
19
|
-
import type { ExprValue } from '../types.js';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {object} BinDateOptions
|
|
3
|
-
* @property {TimeUnit} [interval] A string indicating a time interval
|
|
4
|
-
* unit, such as 'year', 'day', or 'hour'.
|
|
5
|
-
* @property {number} [step] The number of time interval steps to
|
|
6
|
-
* take, such as 2 years or 3 months.
|
|
7
|
-
* @property {number} [offset] The number of bin steps (default 0) by
|
|
8
|
-
* which to offset the result.
|
|
9
|
-
* @property {number} [steps] The desired number of binning steps.
|
|
10
|
-
* This value is a hint, it does not guarantee an exact number of steps.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Return a SQL expression for date/time bins.
|
|
14
|
-
* @param {ExprValue} field The column or expression to bin.
|
|
15
|
-
* @param {[Date|number, Date|number]} extent The min/max extent over which to bin.
|
|
16
|
-
* @param {BinDateOptions} [options] Datetime binning options.
|
|
17
|
-
* @returns {ExprNode}
|
|
18
|
-
*/
|
|
19
|
-
export function binDate(field: ExprValue, extent: [Date | number, Date | number], options?: BinDateOptions): ExprNode;
|
|
20
|
-
export type BinDateOptions = {
|
|
21
|
-
/**
|
|
22
|
-
* A string indicating a time interval
|
|
23
|
-
* unit, such as 'year', 'day', or 'hour'.
|
|
24
|
-
*/
|
|
25
|
-
interval?: TimeUnit;
|
|
26
|
-
/**
|
|
27
|
-
* The number of time interval steps to
|
|
28
|
-
* take, such as 2 years or 3 months.
|
|
29
|
-
*/
|
|
30
|
-
step?: number;
|
|
31
|
-
/**
|
|
32
|
-
* The number of bin steps (default 0) by
|
|
33
|
-
* which to offset the result.
|
|
34
|
-
*/
|
|
35
|
-
offset?: number;
|
|
36
|
-
/**
|
|
37
|
-
* The desired number of binning steps.
|
|
38
|
-
* This value is a hint, it does not guarantee an exact number of steps.
|
|
39
|
-
*/
|
|
40
|
-
steps?: number;
|
|
41
|
-
};
|
|
42
|
-
import type { ExprValue } from '../types.js';
|
|
43
|
-
import type { ExprNode } from '../ast/node.js';
|
|
44
|
-
import type { TimeUnit } from '../types.js';
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {object} BinHistogramOptions
|
|
3
|
-
* @property {number} [step] An exact binning step to use.
|
|
4
|
-
* @property {number} [steps] The desired number of binning steps.
|
|
5
|
-
* This value is a hint, it does not guarantee an exact number of steps.
|
|
6
|
-
* @property {number} [minstep] A minimum binning step value. No generated
|
|
7
|
-
* step can be less than this value.
|
|
8
|
-
* @property {boolean} [nice] A boolean flag (default true) indicating if bin
|
|
9
|
-
* extents should be snapped to "nice" numbers such as multiples of 5 or 10.
|
|
10
|
-
* @property {number} [offset] The number of bin steps (default 0) by
|
|
11
|
-
* which to offset the result.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Return a SQL expression for histogram bins.
|
|
15
|
-
* @param {ExprValue} field The column or expression to bin.
|
|
16
|
-
* @param {[number, number]} extent The min/max extent over which to bin.
|
|
17
|
-
* @param {BinHistogramOptions} [options] Binning options.
|
|
18
|
-
* @param {ReturnType<typeof scaleTransform>} [transform] Scale transforms to
|
|
19
|
-
* apply to create (potentially non-linear) binning intervals.
|
|
20
|
-
* @returns {ExprNode} The resulting SQL expression
|
|
21
|
-
*/
|
|
22
|
-
export function binHistogram(field: ExprValue, extent: [number, number], options?: BinHistogramOptions, transform?: ReturnType<typeof scaleTransform>): ExprNode;
|
|
23
|
-
export type BinHistogramOptions = {
|
|
24
|
-
/**
|
|
25
|
-
* An exact binning step to use.
|
|
26
|
-
*/
|
|
27
|
-
step?: number;
|
|
28
|
-
/**
|
|
29
|
-
* The desired number of binning steps.
|
|
30
|
-
* This value is a hint, it does not guarantee an exact number of steps.
|
|
31
|
-
*/
|
|
32
|
-
steps?: number;
|
|
33
|
-
/**
|
|
34
|
-
* A minimum binning step value. No generated
|
|
35
|
-
* step can be less than this value.
|
|
36
|
-
*/
|
|
37
|
-
minstep?: number;
|
|
38
|
-
/**
|
|
39
|
-
* A boolean flag (default true) indicating if bin
|
|
40
|
-
* extents should be snapped to "nice" numbers such as multiples of 5 or 10.
|
|
41
|
-
*/
|
|
42
|
-
nice?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* The number of bin steps (default 0) by
|
|
45
|
-
* which to offset the result.
|
|
46
|
-
*/
|
|
47
|
-
offset?: number;
|
|
48
|
-
};
|
|
49
|
-
import type { ExprValue } from '../types.js';
|
|
50
|
-
import { scaleTransform } from './scales.js';
|
|
51
|
-
import type { ExprNode } from '../ast/node.js';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Perform linear binning in one dimension.
|
|
3
|
-
* @param {SelectQuery} query The base query to bin.
|
|
4
|
-
* @param {ExprValue} x The expression to bin.
|
|
5
|
-
* @param {ExprValue} [weight] The expression to weight by.
|
|
6
|
-
* @param {string[]} [groupby] Group by expressions.
|
|
7
|
-
* @returns {Query}
|
|
8
|
-
*/
|
|
9
|
-
export function binLinear1d(query: SelectQuery, x: ExprValue, weight?: ExprValue, groupby?: string[]): Query;
|
|
10
|
-
import type { SelectQuery } from '../ast/query.js';
|
|
11
|
-
import type { ExprValue } from '../types.js';
|
|
12
|
-
import { Query } from '../ast/query.js';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compute densities over a 2D domain using linear binning. The weight of
|
|
3
|
-
* each data point is linearly distributed over adjacent bins, providing
|
|
4
|
-
* a better base for subsequent kernel density estimation. This method takes
|
|
5
|
-
* expressions for the (non-truncated) x and y bin values; these expressions
|
|
6
|
-
* should be in units of grid indices, but can contain fractional components.
|
|
7
|
-
* @param {SelectQuery} q The input query. The FROM and WHERE clauses should
|
|
8
|
-
* be added to the query separately, before this method is invoked.
|
|
9
|
-
* @param {ExprValue} xp The x grid bin expression
|
|
10
|
-
* @param {ExprValue} yp The y grid bin expression
|
|
11
|
-
* @param {ExprValue | undefined} weight Point weights.
|
|
12
|
-
* @param {number} xn The number of x grid bins.
|
|
13
|
-
* @param {string[]} [groupby] Group by expressions.
|
|
14
|
-
* @returns {SelectQuery} A linear binning query for bin `index` and
|
|
15
|
-
* aggregate `density` columns, in addition to any group by expressions.
|
|
16
|
-
*/
|
|
17
|
-
export function binLinear2d(q: SelectQuery, xp: ExprValue, yp: ExprValue, weight: ExprValue | undefined, xn: number, groupby?: string[]): SelectQuery;
|
|
18
|
-
import type { SelectQuery } from '../ast/query.js';
|
|
19
|
-
import type { ExprValue } from '../types.js';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compute line segment densities over a gridded 2D domain. The returned
|
|
3
|
-
* query uses multiple subqueries (CTEs) to identify line segment end point
|
|
4
|
-
* pairs, perform line rasterization in-database, normalize arc lengths,
|
|
5
|
-
* and then sum results for all line series to produce a density map.
|
|
6
|
-
* Based on Moritz and Fisher's work: https://arxiv.org/abs/1808.06019
|
|
7
|
-
* @param {SelectQuery} q The base query over the data.
|
|
8
|
-
* @param {ExprValue} x Bin expression for x dimension.
|
|
9
|
-
* Provides gridded x coordinates, potentially with a fractional component.
|
|
10
|
-
* @param {ExprValue} y Bin expression for x dimension.
|
|
11
|
-
* Provides gridded y coordinates, potentially with a fractional component.
|
|
12
|
-
* @param {string[]} z Group by columns that segment data into individual line
|
|
13
|
-
* series. An empty array indicates there is only a single line series.
|
|
14
|
-
* @param {number} xn The number of grid bins for the x dimension.
|
|
15
|
-
* @param {number} yn The number of grid bins for the y dimension.
|
|
16
|
-
* @param {string[]} [groupby] Additional group by expressions. Separate
|
|
17
|
-
* line density maps are created for each of these groups.
|
|
18
|
-
* @param {boolean} [normalize=true] Flag toggling approximate arc-length
|
|
19
|
-
* normalization to improve accuracy and reduce artifacts (default `true`).
|
|
20
|
-
* @returns {SelectQuery}
|
|
21
|
-
*/
|
|
22
|
-
export function lineDensity(q: SelectQuery, x: ExprValue, y: ExprValue, z: string[], xn: number, yn: number, groupby?: string[], normalize?: boolean): SelectQuery;
|
|
23
|
-
import type { SelectQuery } from '../ast/query.js';
|
|
24
|
-
import type { ExprValue } from '../types.js';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* M4 is an optimization for value-preserving time-series aggregation
|
|
3
|
-
* (https://www.vldb.org/pvldb/vol7/p797-jugel.pdf). This implementation uses
|
|
4
|
-
* an efficient version with a single scan and the aggregate functions
|
|
5
|
-
* argmin and argmax, following https://arxiv.org/pdf/2306.03714.pdf.
|
|
6
|
-
* This method can bin along either the *x* or *y* dimension, as determined
|
|
7
|
-
* by the caller-provided *bin* expression.
|
|
8
|
-
* @param {FromExpr} input The base query or table.
|
|
9
|
-
* @param {ExprValue} bin An expression that maps
|
|
10
|
-
* time-series values to fractional pixel positions.
|
|
11
|
-
* @param {string} x The x dimension column name.
|
|
12
|
-
* @param {string} y The y dimension column name.
|
|
13
|
-
* @param {ExprNode[]} [groups] Additional
|
|
14
|
-
* groupby columns, for example for faceted charts.
|
|
15
|
-
* @returns {Query} The resulting M4 query.
|
|
16
|
-
*/
|
|
17
|
-
export function m4(input: FromExpr, bin: ExprValue, x: string, y: string, groups?: ExprNode[]): Query;
|
|
18
|
-
import type { FromExpr } from '../types.js';
|
|
19
|
-
import type { ExprValue } from '../types.js';
|
|
20
|
-
import type { ExprNode } from '../ast/node.js';
|
|
21
|
-
import { Query } from '../ast/query.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function scaleTransform(options: any): any;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {object} BinOptions
|
|
3
|
-
* @property {number} [step] An exact binning step to use.
|
|
4
|
-
* @property {number} [steps] The desired number of binning steps.
|
|
5
|
-
* This value is a hint, it does not guarantee an exact number of steps.
|
|
6
|
-
* @property {number} [minstep] A minimum binning step value. No generated
|
|
7
|
-
* step can be less than this value.
|
|
8
|
-
* @property {boolean} [nice] A boolean flag (default true) indicating if bin
|
|
9
|
-
* extents should be snapped to "nice" numbers such as multiples of 5 or 10.
|
|
10
|
-
* @property {number} [base] A number indicating the the logarithm base to
|
|
11
|
-
* use for automatic step size determination. Defaults to base 10.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Generate a numeric binning scheme suitable for a histogram.
|
|
15
|
-
* @param {number} min The minimum value of the extent to bin.
|
|
16
|
-
* @param {number} max The maximum value of the extent to bin.
|
|
17
|
-
* @param {BinOptions} options Binning scheme options.
|
|
18
|
-
*/
|
|
19
|
-
export function binSpec(min: number, max: number, options: BinOptions): {
|
|
20
|
-
min: number;
|
|
21
|
-
max: number;
|
|
22
|
-
steps: number;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Determine a bin step interval.
|
|
26
|
-
* @param {number} span The span from maximum to minimum value.
|
|
27
|
-
* @param {number} steps The approximate number of desired bins.
|
|
28
|
-
* @param {number} [minstep=0] The minimum acceptable bin step size.
|
|
29
|
-
* @param {number} [logb=Math.LN10] The log base for determining
|
|
30
|
-
* orders of magnitude for step sizes. Defaults to log base 10
|
|
31
|
-
* (`Math.LN10`). For example to use log base 2, provide the
|
|
32
|
-
* argument `Math.LN2` instead.
|
|
33
|
-
* @returns {number} The bin step interval (bin size).
|
|
34
|
-
*/
|
|
35
|
-
export function binStep(span: number, steps: number, minstep?: number, logb?: number): number;
|
|
36
|
-
export type BinOptions = {
|
|
37
|
-
/**
|
|
38
|
-
* An exact binning step to use.
|
|
39
|
-
*/
|
|
40
|
-
step?: number;
|
|
41
|
-
/**
|
|
42
|
-
* The desired number of binning steps.
|
|
43
|
-
* This value is a hint, it does not guarantee an exact number of steps.
|
|
44
|
-
*/
|
|
45
|
-
steps?: number;
|
|
46
|
-
/**
|
|
47
|
-
* A minimum binning step value. No generated
|
|
48
|
-
* step can be less than this value.
|
|
49
|
-
*/
|
|
50
|
-
minstep?: number;
|
|
51
|
-
/**
|
|
52
|
-
* A boolean flag (default true) indicating if bin
|
|
53
|
-
* extents should be snapped to "nice" numbers such as multiples of 5 or 10.
|
|
54
|
-
*/
|
|
55
|
-
nice?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* A number indicating the the logarithm base to
|
|
58
|
-
* use for automatic step size determination. Defaults to base 10.
|
|
59
|
-
*/
|
|
60
|
-
base?: number;
|
|
61
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determine a time interval for binning based on provided min
|
|
3
|
-
* and max timestamps and approximate step count.
|
|
4
|
-
* @param {Date|number} min The minimum timestamp value.
|
|
5
|
-
* @param {Date|number} max The maximum timestamp value.
|
|
6
|
-
* @param {number} steps The approximate number of bins desired.
|
|
7
|
-
* @returns {{ unit: TimeUnit, step: number }}
|
|
8
|
-
*/
|
|
9
|
-
export function timeInterval(min: Date | number, max: Date | number, steps: number): {
|
|
10
|
-
unit: TimeUnit;
|
|
11
|
-
step: number;
|
|
12
|
-
};
|
|
13
|
-
import type { TimeUnit } from '../../types.js';
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test if an AST node is a specific function call.
|
|
3
|
-
* @param {SQLNode} node The SQL AST node to test.
|
|
4
|
-
* @param {string} name The function name.
|
|
5
|
-
* @returns {node is FunctionNode}
|
|
6
|
-
*/
|
|
7
|
-
export function isFunctionCall(node: SQLNode, name: string): node is FunctionNode;
|
|
8
|
-
/**
|
|
9
|
-
* Create a new function call AST node.
|
|
10
|
-
* @param {string} name The function name.
|
|
11
|
-
* @param {...any} args The function arguments.
|
|
12
|
-
* @returns {FunctionNode}
|
|
13
|
-
*/
|
|
14
|
-
export function fn(name: string, ...args: any[]): FunctionNode;
|
|
15
|
-
/**
|
|
16
|
-
* Create a new aggregate function AST node.
|
|
17
|
-
* @param {string} name The function name.
|
|
18
|
-
* @param {...any} args The function arguments.
|
|
19
|
-
* @returns {AggregateNode}
|
|
20
|
-
*/
|
|
21
|
-
export function aggFn(name: string, ...args: any[]): AggregateNode;
|
|
22
|
-
/**
|
|
23
|
-
* Create a new window AST node. The output node has an empty window
|
|
24
|
-
* definition. Use chained calls such as `partitionby` and `orderby`
|
|
25
|
-
* to specify the window settings.
|
|
26
|
-
* @param {WindowFunctionName} name The function name.
|
|
27
|
-
* @param {...any} args The function arguments.
|
|
28
|
-
* @returns {WindowNode}
|
|
29
|
-
*/
|
|
30
|
-
export function winFn(name: WindowFunctionName, ...args: any[]): WindowNode;
|
|
31
|
-
/**
|
|
32
|
-
* Process a list of expression inputs. Nested arrays are flattened,
|
|
33
|
-
* null results are removed, and each input is cast (as needed) to
|
|
34
|
-
* be a proper SQL AST node. By default, strings are assumed to be
|
|
35
|
-
* column names, while other primitive values map to SQL literals.
|
|
36
|
-
* Use an alternative *cast* function to change this behavior.
|
|
37
|
-
* @param {any[]} list The list of expression inputs.
|
|
38
|
-
* @param {function} [cast] A function that casts an input value
|
|
39
|
-
* to a desired type. By default, `asNode` is used to coerce
|
|
40
|
-
* inputs to AST nodes as needed.
|
|
41
|
-
* @returns {ReturnType<cast>[]}
|
|
42
|
-
*/
|
|
43
|
-
export function exprList(list: any[], cast?: Function): ReturnType<Function>[];
|
|
44
|
-
/**
|
|
45
|
-
* Process a list of function arguments, stripping any undefined
|
|
46
|
-
* values from the end of the list.
|
|
47
|
-
* @template T
|
|
48
|
-
* @param {T[]} list The input function arguments.
|
|
49
|
-
* @returns {T[]} The prepared argument list.
|
|
50
|
-
*/
|
|
51
|
-
export function argsList<T>(list: T[]): T[];
|
|
52
|
-
import type { SQLNode } from '../ast/node.js';
|
|
53
|
-
import { FunctionNode } from '../ast/function.js';
|
|
54
|
-
import { AggregateNode } from '../ast/aggregate.js';
|
|
55
|
-
import type { WindowFunctionName } from '../types.js';
|
|
56
|
-
import { WindowNode } from '../ast/window.js';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import { ParamLike } from '../types.js'
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Check if a value is a string.
|
|
6
|
-
* @param {*} value The value to check.
|
|
7
|
-
* @returns {value is string}
|
|
8
|
-
*/
|
|
9
|
-
export function isString(value: any): value is string;
|
|
10
|
-
/**
|
|
11
|
-
* Check if a value is an array.
|
|
12
|
-
* @param {*} value The value to check.
|
|
13
|
-
* @returns {value is Array}
|
|
14
|
-
*/
|
|
15
|
-
export function isArray(value: any): value is any[];
|
|
16
|
-
/**
|
|
17
|
-
* Check if a value is a dynamic parameter.
|
|
18
|
-
* @param {*} value The value to check.
|
|
19
|
-
* @returns {value is ParamLike}
|
|
20
|
-
*/
|
|
21
|
-
export function isParamLike(value: any): value is ParamLike;
|
|
22
|
-
import type { ParamLike } from '../types.js';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export namespace recurse {
|
|
2
|
-
let AGGREGATE: string[];
|
|
3
|
-
let BETWEEN: string[];
|
|
4
|
-
let BINARY: string[];
|
|
5
|
-
let CASE: string[];
|
|
6
|
-
let CAST: string[];
|
|
7
|
-
let COLUMN_PARAM: string[];
|
|
8
|
-
let COLUMN_REF: string[];
|
|
9
|
-
let DESCRIBE_QUERY: string[];
|
|
10
|
-
let EXPRESSION: string[];
|
|
11
|
-
let FRAGMENT: string[];
|
|
12
|
-
let FROM_CLAUSE: string[];
|
|
13
|
-
let FUNCTION: string[];
|
|
14
|
-
let IN: string[];
|
|
15
|
-
let LOGICAL_OPERATOR: string[];
|
|
16
|
-
let NOT_BETWEEN: string[];
|
|
17
|
-
let ORDER_BY: string[];
|
|
18
|
-
let PARAM: string[];
|
|
19
|
-
let SELECT_CLAUSE: string[];
|
|
20
|
-
let SELECT_QUERY: string[];
|
|
21
|
-
let SET_OPERATION: string[];
|
|
22
|
-
let UNARY: string[];
|
|
23
|
-
let WHEN: string[];
|
|
24
|
-
let WINDOW: string[];
|
|
25
|
-
let WINDOW_CLAUSE: string[];
|
|
26
|
-
let WINDOW_DEF: string[];
|
|
27
|
-
let WINDOW_FRAME: string[];
|
|
28
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rewrite a SQL expression, based on a map of nodes to replace.
|
|
3
|
-
* This method copies nodes as needed; it does not modify the input node.
|
|
4
|
-
* @param {ExprNode} node The root AST node of the expression.
|
|
5
|
-
* @param {Map<ExprNode, ExprNode>} map The rewrite map.
|
|
6
|
-
* When encountered, key nodes are replaced by value nodes.
|
|
7
|
-
* @returns {ExprNode}
|
|
8
|
-
*/
|
|
9
|
-
export function rewrite(node: ExprNode, map: Map<ExprNode, ExprNode>): ExprNode;
|
|
10
|
-
import type { ExprNode } from '../ast/node.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Perform a traversal of a SQL expression AST.
|
|
3
|
-
* @param {SQLNode} node Root node for AST traversal.
|
|
4
|
-
* @param {VisitorCallback} visit Visitor callback function.
|
|
5
|
-
* @return {VisitorResult}
|
|
6
|
-
*/
|
|
7
|
-
export function walk(node: SQLNode, visit: VisitorCallback): VisitorResult;
|
|
8
|
-
import type { SQLNode } from '../ast/node.js';
|
|
9
|
-
import type { VisitorCallback } from '../types.js';
|
|
10
|
-
import type { VisitorResult } from '../types.js';
|