@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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { FrameExclude, FrameExtent, FrameValue } from '../ast/window-frame.js';
|
|
2
|
+
import { WindowFrameExprNode, WindowFrameNode } from '../ast/window-frame.js';
|
|
3
|
+
/**
|
|
4
|
+
* Return an updated window definition with the given rows frame.
|
|
5
|
+
* @param extent The row-based window frame extent.
|
|
6
|
+
* @param exclude The window frame exclusion criteria.
|
|
7
|
+
* @returns A window frame node.
|
|
8
|
+
*/
|
|
9
|
+
export declare function frameRows(extent: FrameExtent, exclude?: FrameExclude): WindowFrameNode;
|
|
10
|
+
/**
|
|
11
|
+
* Return an updated window definition with the given range frame.
|
|
12
|
+
* @param extent The range-based window frame extent.
|
|
13
|
+
* @param exclude The window frame exclusion criteria.
|
|
14
|
+
* @returns A window frame node.
|
|
15
|
+
*/
|
|
16
|
+
export declare function frameRange(extent: FrameExtent, exclude?: FrameExclude): WindowFrameNode;
|
|
17
|
+
/**
|
|
18
|
+
* Return an updated window definition with the given groups frame.
|
|
19
|
+
* @param extent The group-based window frame extent.
|
|
20
|
+
* @param exclude The window frame exclusion criteria.
|
|
21
|
+
* @returns A window frame node.
|
|
22
|
+
*/
|
|
23
|
+
export declare function frameGroups(extent: FrameExtent, exclude?: FrameExclude): WindowFrameNode;
|
|
24
|
+
/**
|
|
25
|
+
* A `PRECEDING` frame value expression.
|
|
26
|
+
* @param value The frame value.
|
|
27
|
+
* @returns A preceding value.
|
|
28
|
+
*/
|
|
29
|
+
export declare function preceding(value: FrameValue): WindowFrameExprNode;
|
|
30
|
+
/**
|
|
31
|
+
* A `FOLLOWING` frame value expression.
|
|
32
|
+
* @param value The frame value.
|
|
33
|
+
* @returns A following value.
|
|
34
|
+
*/
|
|
35
|
+
export declare function following(value: FrameValue): WindowFrameExprNode;
|
|
36
|
+
/**
|
|
37
|
+
* A `CURRENT ROW` frame value expression.
|
|
38
|
+
* @returns A current row value.
|
|
39
|
+
*/
|
|
40
|
+
export declare function currentRow(): WindowFrameExprNode;
|
|
41
|
+
//# sourceMappingURL=window-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-frame.d.ts","sourceRoot":"","sources":["../../../src/functions/window-frame.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAA0D,mBAAmB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEtI;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,mBAEpE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,mBAErE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,mBAEtE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,uBAE1C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,uBAE1C;AAED;;;GAGG;AACH,wBAAgB,UAAU,wBAEzB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CURRENT_ROW, FOLLOWING, GROUPS, PRECEDING, RANGE, ROWS, WindowFrameExprNode, WindowFrameNode } from '../ast/window-frame.js';
|
|
2
|
+
/**
|
|
3
|
+
* Return an updated window definition with the given rows frame.
|
|
4
|
+
* @param extent The row-based window frame extent.
|
|
5
|
+
* @param exclude The window frame exclusion criteria.
|
|
6
|
+
* @returns A window frame node.
|
|
7
|
+
*/
|
|
8
|
+
export function frameRows(extent, exclude) {
|
|
9
|
+
return new WindowFrameNode(ROWS, extent, exclude);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Return an updated window definition with the given range frame.
|
|
13
|
+
* @param extent The range-based window frame extent.
|
|
14
|
+
* @param exclude The window frame exclusion criteria.
|
|
15
|
+
* @returns A window frame node.
|
|
16
|
+
*/
|
|
17
|
+
export function frameRange(extent, exclude) {
|
|
18
|
+
return new WindowFrameNode(RANGE, extent, exclude);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Return an updated window definition with the given groups frame.
|
|
22
|
+
* @param extent The group-based window frame extent.
|
|
23
|
+
* @param exclude The window frame exclusion criteria.
|
|
24
|
+
* @returns A window frame node.
|
|
25
|
+
*/
|
|
26
|
+
export function frameGroups(extent, exclude) {
|
|
27
|
+
return new WindowFrameNode(GROUPS, extent, exclude);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A `PRECEDING` frame value expression.
|
|
31
|
+
* @param value The frame value.
|
|
32
|
+
* @returns A preceding value.
|
|
33
|
+
*/
|
|
34
|
+
export function preceding(value) {
|
|
35
|
+
return new WindowFrameExprNode(PRECEDING, value);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A `FOLLOWING` frame value expression.
|
|
39
|
+
* @param value The frame value.
|
|
40
|
+
* @returns A following value.
|
|
41
|
+
*/
|
|
42
|
+
export function following(value) {
|
|
43
|
+
return new WindowFrameExprNode(FOLLOWING, value);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A `CURRENT ROW` frame value expression.
|
|
47
|
+
* @returns A current row value.
|
|
48
|
+
*/
|
|
49
|
+
export function currentRow() {
|
|
50
|
+
return new WindowFrameExprNode(CURRENT_ROW);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=window-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-frame.js","sourceRoot":"","sources":["../../../src/functions/window-frame.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEtI;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,MAAmB,EAAE,OAAsB;IACnE,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,MAAmB,EAAE,OAAsB;IACpE,OAAO,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,MAAmB,EAAE,OAAsB;IACrE,OAAO,IAAI,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAiB;IACzC,OAAO,IAAI,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAiB;IACzC,OAAO,IAAI,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1,89 +1,74 @@
|
|
|
1
|
+
import type { ExprValue, NumberValue } from '../types.js';
|
|
1
2
|
/**
|
|
2
3
|
* Create a window function that returns the number of the current row
|
|
3
4
|
* within the partition, counting from 1.
|
|
4
|
-
* @returns {WindowNode}
|
|
5
5
|
*/
|
|
6
|
-
export function row_number(): WindowNode;
|
|
6
|
+
export declare function row_number(): import("../index.js").WindowNode;
|
|
7
7
|
/**
|
|
8
8
|
* Create a window function that returns the rank of the current row with gaps.
|
|
9
9
|
* This is the same as the row_number of its first peer.
|
|
10
|
-
* @returns {WindowNode}
|
|
11
10
|
*/
|
|
12
|
-
export function rank(): WindowNode;
|
|
11
|
+
export declare function rank(): import("../index.js").WindowNode;
|
|
13
12
|
/**
|
|
14
13
|
* Create a window function that returns the rank of the current row without
|
|
15
14
|
* gaps. The function counts peer groups.
|
|
16
|
-
* @returns {WindowNode}
|
|
17
15
|
*/
|
|
18
|
-
export function dense_rank(): WindowNode;
|
|
16
|
+
export declare function dense_rank(): import("../index.js").WindowNode;
|
|
19
17
|
/**
|
|
20
18
|
* Create a window function that returns the relative rank of the current row.
|
|
21
19
|
* Computed as (rank() - 1) / (total partition rows - 1).
|
|
22
|
-
* @returns {WindowNode}
|
|
23
20
|
*/
|
|
24
|
-
export function percent_rank(): WindowNode;
|
|
21
|
+
export declare function percent_rank(): import("../index.js").WindowNode;
|
|
25
22
|
/**
|
|
26
23
|
* Create a window function that returns the cumulative distribution. Computed
|
|
27
24
|
* as (number of preceding or peer partition rows) / total partition rows.
|
|
28
|
-
* @returns {WindowNode}
|
|
29
25
|
*/
|
|
30
|
-
export function cume_dist(): WindowNode;
|
|
26
|
+
export declare function cume_dist(): import("../index.js").WindowNode;
|
|
31
27
|
/**
|
|
32
28
|
* Create a window function that returns an integer ranging from 1 to the
|
|
33
29
|
* argument value, dividing the partition as equally as possible.
|
|
34
|
-
* @param
|
|
35
|
-
* quantile buckets.
|
|
36
|
-
* @returns {WindowNode}
|
|
30
|
+
* @param num_buckets The number of quantile buckets.
|
|
37
31
|
*/
|
|
38
|
-
export function ntile(num_buckets: NumberValue): WindowNode;
|
|
32
|
+
export declare function ntile(num_buckets: NumberValue): import("../index.js").WindowNode;
|
|
39
33
|
/**
|
|
40
34
|
* Create a window function that returns the expression evaluated at the row
|
|
41
35
|
* that is offset rows before the current row within the partition.
|
|
42
36
|
* If there is no such row, instead return default (which must be of the same
|
|
43
37
|
* type as the expression). Both offset and default are evaluated with respect
|
|
44
38
|
* to the current row. If omitted, offset defaults to 1 and default to null.
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
*
|
|
48
|
-
* @param {*} [defaultValue] The default value (default `null`).
|
|
49
|
-
* @returns {WindowNode}
|
|
39
|
+
* @param expr The expression to evaluate.
|
|
40
|
+
* @param offset The row offset (default `1`).
|
|
41
|
+
* @param defaultValue The default value (default `null`).
|
|
50
42
|
*/
|
|
51
|
-
export function lag(expr: ExprValue, offset?: NumberValue, defaultValue?:
|
|
43
|
+
export declare function lag(expr: ExprValue, offset?: NumberValue, defaultValue?: unknown): import("../index.js").WindowNode;
|
|
52
44
|
/**
|
|
53
45
|
* Create a window function that returns the expression evaluated at the row
|
|
54
46
|
* that is offset rows after the current row within the partition.
|
|
55
47
|
* If there is no such row, instead return default (which must be of the same
|
|
56
48
|
* type as the expression). Both offset and default are evaluated with respect
|
|
57
49
|
* to the current row. If omitted, offset defaults to 1 and default to null.
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
60
|
-
*
|
|
61
|
-
* @param {*} [defaultValue] The default value (default `null`).
|
|
62
|
-
* @returns {WindowNode}
|
|
50
|
+
* @param expr The expression to evaluate.
|
|
51
|
+
* @param offset The row offset (default `1`).
|
|
52
|
+
* @param defaultValue The default value (default `null`).
|
|
63
53
|
*/
|
|
64
|
-
export function lead(expr: ExprValue, offset?: NumberValue, defaultValue?:
|
|
54
|
+
export declare function lead(expr: ExprValue, offset?: NumberValue, defaultValue?: unknown): import("../index.js").WindowNode;
|
|
65
55
|
/**
|
|
66
56
|
* Create a window function that returns the expression evaluated at the row
|
|
67
57
|
* that is the first row of the window frame.
|
|
68
|
-
* @param
|
|
69
|
-
* @returns {WindowNode}
|
|
58
|
+
* @param expr The expression to evaluate.
|
|
70
59
|
*/
|
|
71
|
-
export function first_value(expr: ExprValue): WindowNode;
|
|
60
|
+
export declare function first_value(expr: ExprValue): import("../index.js").WindowNode;
|
|
72
61
|
/**
|
|
73
62
|
* Create a window function that returns the expression evaluated at the row
|
|
74
63
|
* that is the last row of the window frame.
|
|
75
|
-
* @param
|
|
76
|
-
* @returns {WindowNode}
|
|
64
|
+
* @param expr The expression to evaluate.
|
|
77
65
|
*/
|
|
78
|
-
export function last_value(expr: ExprValue): WindowNode;
|
|
66
|
+
export declare function last_value(expr: ExprValue): import("../index.js").WindowNode;
|
|
79
67
|
/**
|
|
80
68
|
* Create a window function that returns the expression evaluated at the
|
|
81
69
|
* nth row of the window frame (counting from 1), or null if no such row.
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @returns {WindowNode}
|
|
70
|
+
* @param expr The expression to evaluate.
|
|
71
|
+
* @param nth The 1-based window frame index.
|
|
85
72
|
*/
|
|
86
|
-
export function nth_value(expr: ExprValue, nth: NumberValue): WindowNode;
|
|
87
|
-
|
|
88
|
-
import type { NumberValue } from '../types.js';
|
|
89
|
-
import type { ExprValue } from '../types.js';
|
|
73
|
+
export declare function nth_value(expr: ExprValue, nth: NumberValue): import("../index.js").WindowNode;
|
|
74
|
+
//# sourceMappingURL=window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/functions/window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1D;;;GAGG;AACH,wBAAgB,UAAU,qCAEzB;AAED;;;GAGG;AACH,wBAAgB,IAAI,qCAEnB;AAED;;;GAGG;AACH,wBAAgB,UAAU,qCAEzB;AAED;;;GAGG;AACH,wBAAgB,YAAY,qCAE3B;AAED;;;GAGG;AACH,wBAAgB,SAAS,qCAExB;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,WAAW,EAAE,WAAW,oCAE7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,OAAO,oCAEhF;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,OAAO,oCAEjF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,oCAE1C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,oCAEzC;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,oCAE1D"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { winFn } from '../util/function.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a window function that returns the number of the current row
|
|
4
|
+
* within the partition, counting from 1.
|
|
5
|
+
*/
|
|
6
|
+
export function row_number() {
|
|
7
|
+
return winFn('row_number');
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create a window function that returns the rank of the current row with gaps.
|
|
11
|
+
* This is the same as the row_number of its first peer.
|
|
12
|
+
*/
|
|
13
|
+
export function rank() {
|
|
14
|
+
return winFn('rank');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a window function that returns the rank of the current row without
|
|
18
|
+
* gaps. The function counts peer groups.
|
|
19
|
+
*/
|
|
20
|
+
export function dense_rank() {
|
|
21
|
+
return winFn('dense_rank');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create a window function that returns the relative rank of the current row.
|
|
25
|
+
* Computed as (rank() - 1) / (total partition rows - 1).
|
|
26
|
+
*/
|
|
27
|
+
export function percent_rank() {
|
|
28
|
+
return winFn('percent_rank');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a window function that returns the cumulative distribution. Computed
|
|
32
|
+
* as (number of preceding or peer partition rows) / total partition rows.
|
|
33
|
+
*/
|
|
34
|
+
export function cume_dist() {
|
|
35
|
+
return winFn('cume_dist');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create a window function that returns an integer ranging from 1 to the
|
|
39
|
+
* argument value, dividing the partition as equally as possible.
|
|
40
|
+
* @param num_buckets The number of quantile buckets.
|
|
41
|
+
*/
|
|
42
|
+
export function ntile(num_buckets) {
|
|
43
|
+
return winFn('ntile', num_buckets);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create a window function that returns the expression evaluated at the row
|
|
47
|
+
* that is offset rows before the current row within the partition.
|
|
48
|
+
* If there is no such row, instead return default (which must be of the same
|
|
49
|
+
* type as the expression). Both offset and default are evaluated with respect
|
|
50
|
+
* to the current row. If omitted, offset defaults to 1 and default to null.
|
|
51
|
+
* @param expr The expression to evaluate.
|
|
52
|
+
* @param offset The row offset (default `1`).
|
|
53
|
+
* @param defaultValue The default value (default `null`).
|
|
54
|
+
*/
|
|
55
|
+
export function lag(expr, offset, defaultValue) {
|
|
56
|
+
return winFn('lag', expr, offset, defaultValue);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a window function that returns the expression evaluated at the row
|
|
60
|
+
* that is offset rows after the current row within the partition.
|
|
61
|
+
* If there is no such row, instead return default (which must be of the same
|
|
62
|
+
* type as the expression). Both offset and default are evaluated with respect
|
|
63
|
+
* to the current row. If omitted, offset defaults to 1 and default to null.
|
|
64
|
+
* @param expr The expression to evaluate.
|
|
65
|
+
* @param offset The row offset (default `1`).
|
|
66
|
+
* @param defaultValue The default value (default `null`).
|
|
67
|
+
*/
|
|
68
|
+
export function lead(expr, offset, defaultValue) {
|
|
69
|
+
return winFn('lead', expr, offset, defaultValue);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create a window function that returns the expression evaluated at the row
|
|
73
|
+
* that is the first row of the window frame.
|
|
74
|
+
* @param expr The expression to evaluate.
|
|
75
|
+
*/
|
|
76
|
+
export function first_value(expr) {
|
|
77
|
+
return winFn('first_value', expr);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create a window function that returns the expression evaluated at the row
|
|
81
|
+
* that is the last row of the window frame.
|
|
82
|
+
* @param expr The expression to evaluate.
|
|
83
|
+
*/
|
|
84
|
+
export function last_value(expr) {
|
|
85
|
+
return winFn('last_value', expr);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Create a window function that returns the expression evaluated at the
|
|
89
|
+
* nth row of the window frame (counting from 1), or null if no such row.
|
|
90
|
+
* @param expr The expression to evaluate.
|
|
91
|
+
* @param nth The 1-based window frame index.
|
|
92
|
+
*/
|
|
93
|
+
export function nth_value(expr, nth) {
|
|
94
|
+
return winFn('nth_value', expr, nth);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window.js","sourceRoot":"","sources":["../../../src/functions/window.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,KAAK,CAAC,YAAY,CAAC,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC;AACvB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,KAAK,CAAC,YAAY,CAAC,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,WAAwB;IAC5C,OAAO,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,GAAG,CAAC,IAAe,EAAE,MAAoB,EAAE,YAAsB;IAC/E,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,IAAI,CAAC,IAAe,EAAE,MAAoB,EAAE,YAAsB;IAChF,OAAO,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAe;IACzC,OAAO,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAe;IACxC,OAAO,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAe,EAAE,GAAgB;IACzD,OAAO,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export { AggregateNode, aggregateNames, isAggregateFunction } from './ast/aggregate.js';
|
|
2
|
+
export { BetweenOpNode, NotBetweenOpNode } from './ast/between-op.js';
|
|
3
|
+
export { BinaryOpNode } from './ast/binary-op.js';
|
|
4
|
+
export { CaseNode, WhenNode } from './ast/case.js';
|
|
5
|
+
export { CastNode } from './ast/cast.js';
|
|
6
|
+
export { CollateNode } from './ast/collate.js';
|
|
7
|
+
export { ColumnParamNode, isColumnParam } from './ast/column-param.js';
|
|
8
|
+
export { ColumnRefNode, ColumnNameRefNode, isColumnRef } from './ast/column-ref.js';
|
|
9
|
+
export { FragmentNode } from './ast/fragment.js';
|
|
10
|
+
export { FromClauseNode } from './ast/from.js';
|
|
11
|
+
export { FunctionNode } from './ast/function.js';
|
|
12
|
+
export { InOpNode } from './ast/in-op.js';
|
|
13
|
+
export { IntervalNode } from './ast/interval.js';
|
|
14
|
+
export { LiteralNode } from './ast/literal.js';
|
|
15
|
+
export { AndNode, OrNode } from './ast/logical-op.js';
|
|
16
|
+
export { SQLNode, ExprNode, isNode } from './ast/node.js';
|
|
17
|
+
export { OrderByNode } from './ast/order-by.js';
|
|
18
|
+
export { ParamNode } from './ast/param.js';
|
|
19
|
+
export { DescribeQuery, Query, SelectQuery, SetOperation, isDescribeQuery, isQuery, isSelectQuery } from './ast/query.js';
|
|
20
|
+
export { SampleClauseNode } from './ast/sample.js';
|
|
21
|
+
export { ScalarSubqueryNode } from './ast/subquery.js';
|
|
22
|
+
export { SelectClauseNode } from './ast/select.js';
|
|
23
|
+
export { TableRefNode, isTableRef } from './ast/table-ref.js';
|
|
24
|
+
export { UnaryOpNode, UnaryPostfixOpNode } from './ast/unary-op.js';
|
|
25
|
+
export { VerbatimNode } from './ast/verbatim.js';
|
|
26
|
+
export { WindowClauseNode, WindowDefNode, WindowFunctionNode, WindowNode } from './ast/window.js';
|
|
27
|
+
export { WindowFrameNode, WindowFrameExprNode, type FrameExclude, type FrameExtent, type FrameScope, type FrameType, type FrameValue } from './ast/window-frame.js';
|
|
28
|
+
export { WithClauseNode } from './ast/with.js';
|
|
29
|
+
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';
|
|
30
|
+
export { cond } from './functions/case.js';
|
|
31
|
+
export { cast, float32, float64, int32 } from './functions/cast.js';
|
|
32
|
+
export { collate } from './functions/collate.js';
|
|
33
|
+
export { column } from './functions/column.js';
|
|
34
|
+
export { cte } from './functions/cte.js';
|
|
35
|
+
export { dateBin, dateMonth, dateMonthDay, dateDay, epoch_ms } from './functions/datetime.js';
|
|
36
|
+
export { days, hours, interval, microseconds, minutes, milliseconds, months, seconds, years } from './functions/interval.js';
|
|
37
|
+
export { literal, verbatim } from './functions/literal.js';
|
|
38
|
+
export { abs, ceil, exp, floor, greatest, isFinite, isInfinite, isNaN, least, ln, log, round, sign, sqrt, trunc } from './functions/numeric.js';
|
|
39
|
+
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';
|
|
40
|
+
export { asc, desc } from './functions/order-by.js';
|
|
41
|
+
export { geojson, x, y, centroid, centroidX, centroidY } from './functions/spatial.js';
|
|
42
|
+
export { sql } from './functions/sql-template-tag.js';
|
|
43
|
+
export { regexp_matches, contains, prefix, suffix, lower, upper, length } from './functions/string.js';
|
|
44
|
+
export { coalesce } from './functions/util.js';
|
|
45
|
+
export { cume_dist, dense_rank, first_value, lag, last_value, lead, nth_value, ntile, percent_rank, rank, row_number } from './functions/window.js';
|
|
46
|
+
export { currentRow, following, frameGroups, frameRange, frameRows, preceding } from './functions/window-frame.js';
|
|
47
|
+
export { deepClone } from './visit/clone.js';
|
|
48
|
+
export { rewrite } from './visit/rewrite.js';
|
|
49
|
+
export { collectAggregates, collectColumns, collectParams, isAggregateExpression } from './visit/visitors.js';
|
|
50
|
+
export { walk, type VisitorCallback, type VisitorResult } from './visit/walk.js';
|
|
51
|
+
export { createTable, createSchema } from './load/create.js';
|
|
52
|
+
export { loadExtension } from './load/extension.js';
|
|
53
|
+
export { loadCSV, loadJSON, loadObjects, loadParquet, loadSpatial } from './load/load.js';
|
|
54
|
+
export { bin1d } from './transforms/bin-1d.js';
|
|
55
|
+
export { bin2d } from './transforms/bin-2d.js';
|
|
56
|
+
export { binDate } from './transforms/bin-date.js';
|
|
57
|
+
export { binHistogram } from './transforms/bin-histogram.js';
|
|
58
|
+
export { binLinear1d } from './transforms/bin-linear-1d.js';
|
|
59
|
+
export { binLinear2d } from './transforms/bin-linear-2d.js';
|
|
60
|
+
export { filterQuery } from './transforms/filter-query.js';
|
|
61
|
+
export { lineDensity } from './transforms/line-density.js';
|
|
62
|
+
export { m4 } from './transforms/m4.js';
|
|
63
|
+
export { scaleTransform, type Scale, type ScaleDomain, type ScaleOptions, type ScaleTransform, type ScaleType } from './transforms/scales.js';
|
|
64
|
+
export { asLiteral, asNode, asTableRef, asVerbatim, over } from './util/ast.js';
|
|
65
|
+
export { isParamLike } from './util/type-check.js';
|
|
66
|
+
export { binSpec, binStep, type BinOptions } from './transforms/util/bin-step.js';
|
|
67
|
+
export { timeInterval, type TimeUnit } from './transforms/util/time-interval.js';
|
|
68
|
+
export * from './types.js';
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAA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NotBetweenOpNode } from './ast/between-op.js'
|
|
1
|
+
export { AggregateNode, aggregateNames, isAggregateFunction } from './ast/aggregate.js';
|
|
2
|
+
export { BetweenOpNode, NotBetweenOpNode } from './ast/between-op.js';
|
|
3
3
|
export { BinaryOpNode } from './ast/binary-op.js';
|
|
4
4
|
export { CaseNode, WhenNode } from './ast/case.js';
|
|
5
5
|
export { CastNode } from './ast/cast.js';
|
|
6
|
+
export { CollateNode } from './ast/collate.js';
|
|
6
7
|
export { ColumnParamNode, isColumnParam } from './ast/column-param.js';
|
|
7
8
|
export { ColumnRefNode, ColumnNameRefNode, isColumnRef } from './ast/column-ref.js';
|
|
8
9
|
export { FragmentNode } from './ast/fragment.js';
|
|
@@ -17,20 +18,23 @@ export { OrderByNode } from './ast/order-by.js';
|
|
|
17
18
|
export { ParamNode } from './ast/param.js';
|
|
18
19
|
export { DescribeQuery, Query, SelectQuery, SetOperation, isDescribeQuery, isQuery, isSelectQuery } from './ast/query.js';
|
|
19
20
|
export { SampleClauseNode } from './ast/sample.js';
|
|
21
|
+
export { ScalarSubqueryNode } from './ast/subquery.js';
|
|
20
22
|
export { SelectClauseNode } from './ast/select.js';
|
|
21
23
|
export { TableRefNode, isTableRef } from './ast/table-ref.js';
|
|
22
|
-
export { UnaryOpNode,
|
|
24
|
+
export { UnaryOpNode, UnaryPostfixOpNode } from './ast/unary-op.js';
|
|
23
25
|
export { VerbatimNode } from './ast/verbatim.js';
|
|
24
|
-
export { WindowClauseNode, WindowDefNode,
|
|
26
|
+
export { WindowClauseNode, WindowDefNode, WindowFunctionNode, WindowNode } from './ast/window.js';
|
|
27
|
+
export { WindowFrameNode, WindowFrameExprNode } from './ast/window-frame.js';
|
|
25
28
|
export { WithClauseNode } from './ast/with.js';
|
|
26
|
-
|
|
27
29
|
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';
|
|
28
30
|
export { cond } from './functions/case.js';
|
|
29
31
|
export { cast, float32, float64, int32 } from './functions/cast.js';
|
|
32
|
+
export { collate } from './functions/collate.js';
|
|
30
33
|
export { column } from './functions/column.js';
|
|
31
34
|
export { cte } from './functions/cte.js';
|
|
32
|
-
export { dateBin, dateMonth, dateMonthDay, dateDay, epoch_ms
|
|
33
|
-
export {
|
|
35
|
+
export { dateBin, dateMonth, dateMonthDay, dateDay, epoch_ms } from './functions/datetime.js';
|
|
36
|
+
export { days, hours, interval, microseconds, minutes, milliseconds, months, seconds, years } from './functions/interval.js';
|
|
37
|
+
export { literal, verbatim } from './functions/literal.js';
|
|
34
38
|
export { abs, ceil, exp, floor, greatest, isFinite, isInfinite, isNaN, least, ln, log, round, sign, sqrt, trunc } from './functions/numeric.js';
|
|
35
39
|
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';
|
|
36
40
|
export { asc, desc } from './functions/order-by.js';
|
|
@@ -39,27 +43,27 @@ export { sql } from './functions/sql-template-tag.js';
|
|
|
39
43
|
export { regexp_matches, contains, prefix, suffix, lower, upper, length } from './functions/string.js';
|
|
40
44
|
export { coalesce } from './functions/util.js';
|
|
41
45
|
export { cume_dist, dense_rank, first_value, lag, last_value, lead, nth_value, ntile, percent_rank, rank, row_number } from './functions/window.js';
|
|
42
|
-
|
|
46
|
+
export { currentRow, following, frameGroups, frameRange, frameRows, preceding } from './functions/window-frame.js';
|
|
47
|
+
export { deepClone } from './visit/clone.js';
|
|
43
48
|
export { rewrite } from './visit/rewrite.js';
|
|
44
49
|
export { collectAggregates, collectColumns, collectParams, isAggregateExpression } from './visit/visitors.js';
|
|
45
50
|
export { walk } from './visit/walk.js';
|
|
46
|
-
|
|
47
51
|
export { createTable, createSchema } from './load/create.js';
|
|
48
52
|
export { loadExtension } from './load/extension.js';
|
|
49
53
|
export { loadCSV, loadJSON, loadObjects, loadParquet, loadSpatial } from './load/load.js';
|
|
50
|
-
|
|
51
54
|
export { bin1d } from './transforms/bin-1d.js';
|
|
52
55
|
export { bin2d } from './transforms/bin-2d.js';
|
|
53
56
|
export { binDate } from './transforms/bin-date.js';
|
|
54
57
|
export { binHistogram } from './transforms/bin-histogram.js';
|
|
55
58
|
export { binLinear1d } from './transforms/bin-linear-1d.js';
|
|
56
59
|
export { binLinear2d } from './transforms/bin-linear-2d.js';
|
|
60
|
+
export { filterQuery } from './transforms/filter-query.js';
|
|
57
61
|
export { lineDensity } from './transforms/line-density.js';
|
|
58
62
|
export { m4 } from './transforms/m4.js';
|
|
59
63
|
export { scaleTransform } from './transforms/scales.js';
|
|
60
|
-
|
|
61
64
|
export { asLiteral, asNode, asTableRef, asVerbatim, over } from './util/ast.js';
|
|
62
65
|
export { isParamLike } from './util/type-check.js';
|
|
63
|
-
|
|
64
66
|
export { binSpec, binStep } from './transforms/util/bin-step.js';
|
|
65
67
|
export { timeInterval } from './transforms/util/time-interval.js';
|
|
68
|
+
export * from './types.js';
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,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BAA+B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAiB,MAAM,oCAAoC,CAAC;AAEjF,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface CreateTableOptions {
|
|
2
|
+
replace?: boolean;
|
|
3
|
+
temp?: boolean;
|
|
4
|
+
view?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function createTable(name: string, query: string, { replace, temp, view }?: CreateTableOptions): string;
|
|
7
|
+
export declare function createSchema(name: string, { strict }?: {
|
|
8
|
+
strict?: boolean | undefined;
|
|
9
|
+
}): string;
|
|
10
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/load/create.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EACvD,OAAe,EACf,IAAY,EACZ,IAAY,EACb,GAAE,kBAAuB,UAOzB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EACzC,MAAc,EACf;;CAAK,UAIL"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function createTable(name, query, { replace = false, temp = false, view = false } = {}) {
|
|
2
|
+
return 'CREATE'
|
|
3
|
+
+ (replace ? ' OR REPLACE ' : ' ')
|
|
4
|
+
+ (temp ? 'TEMP ' : '')
|
|
5
|
+
+ (view ? 'VIEW' : 'TABLE')
|
|
6
|
+
+ (replace ? ' ' : ' IF NOT EXISTS ')
|
|
7
|
+
+ name + ' AS ' + query;
|
|
8
|
+
}
|
|
9
|
+
export function createSchema(name, { strict = false } = {}) {
|
|
10
|
+
return 'CREATE SCHEMA '
|
|
11
|
+
+ (strict ? '' : 'IF NOT EXISTS ')
|
|
12
|
+
+ name;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/load/create.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,KAAa,EAAE,EACvD,OAAO,GAAG,KAAK,EACf,IAAI,GAAG,KAAK,EACZ,IAAI,GAAG,KAAK,KACU,EAAE;IACxB,OAAO,QAAQ;UACX,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC;UAChC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;UACrB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;UACzB,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;UACnC,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,EACzC,MAAM,GAAG,KAAK,EACf,GAAG,EAAE;IACJ,OAAO,gBAAgB;UACnB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;UAChC,IAAI,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../src/load/extension.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,UAEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../src/load/extension.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,WAAW,IAAI,UAAU,IAAI,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CreateTableOptions } from './create.js';
|
|
2
|
+
type Options = {
|
|
3
|
+
select?: string[];
|
|
4
|
+
} & CreateTableOptions & Record<string, unknown>;
|
|
5
|
+
export declare function load(method: string, tableName: string, fileName: string, options?: Options, defaults?: Record<string, unknown>): string;
|
|
6
|
+
export declare function loadCSV(tableName: string, fileName: string, options?: Options): string;
|
|
7
|
+
export declare function loadJSON(tableName: string, fileName: string, options?: Options): string;
|
|
8
|
+
export declare function loadParquet(tableName: string, fileName: string, options?: Options): string;
|
|
9
|
+
/**
|
|
10
|
+
* Load geometry data within a spatial file format.
|
|
11
|
+
* This method requires that the DuckDB spatial extension is loaded.
|
|
12
|
+
* Supports GeoJSON, TopoJSON, and other common spatial formats.
|
|
13
|
+
* For TopoJSON, wet the layer option to indicate the feature to extract.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadSpatial(tableName: string, fileName: string, options?: Options): string;
|
|
16
|
+
export declare function loadObjects(tableName: string, data: (Record<string, unknown>)[], options?: Options): string;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/load/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAG9D,KAAK,OAAO,GACR;IAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAAE,GACtB,kBAAkB,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,OAAY,EACrB,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,UAQvC;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,UAE7E;AAED,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,UAE9E;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,UAEjF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,UAerF;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,CAAC,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC,EAAE,EAChC,OAAO,GAAE,OAAY,UAQtB"}
|