@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,19 @@
|
|
|
1
|
+
import type { ExprNode } from './node.js';
|
|
2
|
+
import { SQLNode } from './node.js';
|
|
3
|
+
export declare class SelectClauseNode extends SQLNode {
|
|
4
|
+
/** The select expression. */
|
|
5
|
+
readonly expr: ExprNode;
|
|
6
|
+
/** The output name. */
|
|
7
|
+
readonly alias: string;
|
|
8
|
+
/**
|
|
9
|
+
* Instantiate a select node.
|
|
10
|
+
* @param expr The select expression.
|
|
11
|
+
* @param alias The output name.
|
|
12
|
+
*/
|
|
13
|
+
constructor(expr: ExprNode, alias: string);
|
|
14
|
+
/**
|
|
15
|
+
* Generate a SQL query string for this node.
|
|
16
|
+
*/
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/ast/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAI1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,gBAAiB,SAAQ,OAAO;IAC3C,6BAA6B;IAC7B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,uBAAuB;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;gBACS,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM;IAMzC;;OAEG;IACH,QAAQ;CAMT"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SELECT_CLAUSE } from '../constants.js';
|
|
2
|
+
import { quoteIdentifier } from '../util/string.js';
|
|
3
|
+
import { ColumnRefNode } from './column-ref.js';
|
|
4
|
+
import { SQLNode } from './node.js';
|
|
5
|
+
export class SelectClauseNode extends SQLNode {
|
|
6
|
+
/** The select expression. */
|
|
7
|
+
expr;
|
|
8
|
+
/** The output name. */
|
|
9
|
+
alias;
|
|
10
|
+
/**
|
|
11
|
+
* Instantiate a select node.
|
|
12
|
+
* @param expr The select expression.
|
|
13
|
+
* @param alias The output name.
|
|
14
|
+
*/
|
|
15
|
+
constructor(expr, alias) {
|
|
16
|
+
super(SELECT_CLAUSE);
|
|
17
|
+
this.expr = expr;
|
|
18
|
+
this.alias = alias;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Generate a SQL query string for this node.
|
|
22
|
+
*/
|
|
23
|
+
toString() {
|
|
24
|
+
const { expr, alias } = this;
|
|
25
|
+
return !alias || isColumnRefFor(expr, alias)
|
|
26
|
+
? `${expr}`
|
|
27
|
+
: `${expr} AS ${quoteIdentifier(alias)}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function isColumnRefFor(expr, name) {
|
|
31
|
+
return expr instanceof ColumnRefNode
|
|
32
|
+
&& expr.table == null
|
|
33
|
+
&& expr.column === name;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/ast/select.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,gBAAiB,SAAQ,OAAO;IAC3C,6BAA6B;IACpB,IAAI,CAAW;IACxB,uBAAuB;IACd,KAAK,CAAS;IAEvB;;;;OAIG;IACH,YAAY,IAAc,EAAE,KAAa;QACvC,KAAK,CAAC,aAAa,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAC7B,OAAO,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC;YAC1C,CAAC,CAAC,GAAG,IAAI,EAAE;YACX,CAAC,CAAC,GAAG,IAAI,OAAO,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;IAC7C,CAAC;CACF;AAED,SAAS,cAAc,CAAC,IAAa,EAAE,IAAY;IACjD,OAAO,IAAI,YAAY,aAAa;WAC/B,IAAI,CAAC,KAAK,IAAI,IAAI;WAClB,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Query } from './query.js';
|
|
2
|
+
import { ExprNode } from './node.js';
|
|
3
|
+
export declare class ScalarSubqueryNode extends ExprNode {
|
|
4
|
+
/** The scalar subquery. */
|
|
5
|
+
readonly subquery: Query;
|
|
6
|
+
/**
|
|
7
|
+
* Instantiate a scalar subquery node.
|
|
8
|
+
* @param subquery The scalar subquery.
|
|
9
|
+
*/
|
|
10
|
+
constructor(subquery: Query);
|
|
11
|
+
/**
|
|
12
|
+
* Generate a SQL query string for this node.
|
|
13
|
+
*/
|
|
14
|
+
toString(): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=subquery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subquery.d.ts","sourceRoot":"","sources":["../../../src/ast/subquery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,2BAA2B;IAC3B,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IAEzB;;;OAGG;gBACS,QAAQ,EAAE,KAAK;IAK3B;;OAEG;IACH,QAAQ;CAGT"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SCALAR_SUBQUERY } from '../constants.js';
|
|
2
|
+
import { ExprNode } from './node.js';
|
|
3
|
+
export class ScalarSubqueryNode extends ExprNode {
|
|
4
|
+
/** The scalar subquery. */
|
|
5
|
+
subquery;
|
|
6
|
+
/**
|
|
7
|
+
* Instantiate a scalar subquery node.
|
|
8
|
+
* @param subquery The scalar subquery.
|
|
9
|
+
*/
|
|
10
|
+
constructor(subquery) {
|
|
11
|
+
super(SCALAR_SUBQUERY);
|
|
12
|
+
this.subquery = subquery;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generate a SQL query string for this node.
|
|
16
|
+
*/
|
|
17
|
+
toString() {
|
|
18
|
+
return `(${this.subquery})`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=subquery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subquery.js","sourceRoot":"","sources":["../../../src/ast/subquery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IAC9C,2BAA2B;IAClB,QAAQ,CAAQ;IAEzB;;;OAGG;IACH,YAAY,QAAe;QACzB,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ExprNode } from './node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Check if a value is a table reference node.
|
|
4
|
+
* @param value The value to check.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isTableRef(value: unknown): value is TableRefNode;
|
|
7
|
+
export declare class TableRefNode extends ExprNode {
|
|
8
|
+
/** The table name, including namespaces. */
|
|
9
|
+
readonly table: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Instantiate a table reference node.
|
|
12
|
+
* @param table The table name.
|
|
13
|
+
*/
|
|
14
|
+
constructor(table: string | string[]);
|
|
15
|
+
/**
|
|
16
|
+
* The table name without database or schema namespaces.
|
|
17
|
+
*/
|
|
18
|
+
get name(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Generate a SQL query string for this node.
|
|
21
|
+
*/
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=table-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-ref.d.ts","sourceRoot":"","sources":["../../../src/ast/table-ref.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEhE;AAED,qBAAa,YAAa,SAAQ,QAAQ;IACxC,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAEzB;;;OAGG;gBACS,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAKpC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,QAAQ;CAGT"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TABLE_REF } from '../constants.js';
|
|
2
|
+
import { quoteIdentifier } from '../util/string.js';
|
|
3
|
+
import { ExprNode } from './node.js';
|
|
4
|
+
/**
|
|
5
|
+
* Check if a value is a table reference node.
|
|
6
|
+
* @param value The value to check.
|
|
7
|
+
*/
|
|
8
|
+
export function isTableRef(value) {
|
|
9
|
+
return value instanceof TableRefNode;
|
|
10
|
+
}
|
|
11
|
+
export class TableRefNode extends ExprNode {
|
|
12
|
+
/** The table name, including namespaces. */
|
|
13
|
+
table;
|
|
14
|
+
/**
|
|
15
|
+
* Instantiate a table reference node.
|
|
16
|
+
* @param table The table name.
|
|
17
|
+
*/
|
|
18
|
+
constructor(table) {
|
|
19
|
+
super(TABLE_REF);
|
|
20
|
+
this.table = [table].flat();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The table name without database or schema namespaces.
|
|
24
|
+
*/
|
|
25
|
+
get name() {
|
|
26
|
+
return this.table[this.table.length - 1];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Generate a SQL query string for this node.
|
|
30
|
+
*/
|
|
31
|
+
toString() {
|
|
32
|
+
return this.table.map(t => quoteIdentifier(t)).join('.');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=table-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-ref.js","sourceRoot":"","sources":["../../../src/ast/table-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,KAAK,YAAY,YAAY,CAAC;AACvC,CAAC;AAED,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxC,4CAA4C;IACnC,KAAK,CAAW;IAEzB;;;OAGG;IACH,YAAY,KAAwB;QAClC,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ExprNode } from './node.js';
|
|
2
|
+
declare class AbstractUnaryOpNode extends ExprNode {
|
|
3
|
+
/** The operator type. */
|
|
4
|
+
readonly op: string;
|
|
5
|
+
/** The input expression. */
|
|
6
|
+
readonly expr: ExprNode;
|
|
7
|
+
/**
|
|
8
|
+
* Instantiate an abstract unary operator node.
|
|
9
|
+
* @param type The node type.
|
|
10
|
+
* @param op The operator type.
|
|
11
|
+
* @param expr The input expression.
|
|
12
|
+
*/
|
|
13
|
+
constructor(type: string, op: string, expr: ExprNode);
|
|
14
|
+
}
|
|
15
|
+
export declare class UnaryOpNode extends AbstractUnaryOpNode {
|
|
16
|
+
/**
|
|
17
|
+
* Instantiate a unary operator node.
|
|
18
|
+
* @param op The operator type.
|
|
19
|
+
* @param expr The input expression.
|
|
20
|
+
*/
|
|
21
|
+
constructor(op: string, expr: ExprNode);
|
|
22
|
+
/**
|
|
23
|
+
* Generate a SQL query string for this node.
|
|
24
|
+
*/
|
|
25
|
+
toString(): string;
|
|
26
|
+
}
|
|
27
|
+
export declare class UnaryPostfixOpNode extends AbstractUnaryOpNode {
|
|
28
|
+
/**
|
|
29
|
+
* Instantiate a unary operator node.
|
|
30
|
+
* @param op The operator type.
|
|
31
|
+
* @param expr The input expression.
|
|
32
|
+
*/
|
|
33
|
+
constructor(op: string, expr: ExprNode);
|
|
34
|
+
/**
|
|
35
|
+
* Generate a SQL query string for this node.
|
|
36
|
+
*/
|
|
37
|
+
toString(): string;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=unary-op.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unary-op.d.ts","sourceRoot":"","sources":["../../../src/ast/unary-op.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,cAAM,mBAAoB,SAAQ,QAAQ;IACxC,yBAAyB;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAExB;;;;;OAKG;gBACS,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;CAKrD;AAED,qBAAa,WAAY,SAAQ,mBAAmB;IAClD;;;;OAIG;gBACS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;IAItC;;OAEG;IACH,QAAQ;CAGT;AAED,qBAAa,kBAAmB,SAAQ,mBAAmB;IACzD;;;;OAIG;gBACS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;IAItC;;OAEG;IACH,QAAQ;CAGT"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { UNARY_OPERATOR, UNARY_POSTFIX_OPERATOR } from '../constants.js';
|
|
2
|
+
import { ExprNode } from './node.js';
|
|
3
|
+
class AbstractUnaryOpNode extends ExprNode {
|
|
4
|
+
/** The operator type. */
|
|
5
|
+
op;
|
|
6
|
+
/** The input expression. */
|
|
7
|
+
expr;
|
|
8
|
+
/**
|
|
9
|
+
* Instantiate an abstract unary operator node.
|
|
10
|
+
* @param type The node type.
|
|
11
|
+
* @param op The operator type.
|
|
12
|
+
* @param expr The input expression.
|
|
13
|
+
*/
|
|
14
|
+
constructor(type, op, expr) {
|
|
15
|
+
super(type);
|
|
16
|
+
this.op = op;
|
|
17
|
+
this.expr = expr;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class UnaryOpNode extends AbstractUnaryOpNode {
|
|
21
|
+
/**
|
|
22
|
+
* Instantiate a unary operator node.
|
|
23
|
+
* @param op The operator type.
|
|
24
|
+
* @param expr The input expression.
|
|
25
|
+
*/
|
|
26
|
+
constructor(op, expr) {
|
|
27
|
+
super(UNARY_OPERATOR, op, expr);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Generate a SQL query string for this node.
|
|
31
|
+
*/
|
|
32
|
+
toString() {
|
|
33
|
+
return `(${this.op} ${this.expr})`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class UnaryPostfixOpNode extends AbstractUnaryOpNode {
|
|
37
|
+
/**
|
|
38
|
+
* Instantiate a unary operator node.
|
|
39
|
+
* @param op The operator type.
|
|
40
|
+
* @param expr The input expression.
|
|
41
|
+
*/
|
|
42
|
+
constructor(op, expr) {
|
|
43
|
+
super(UNARY_POSTFIX_OPERATOR, op, expr);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Generate a SQL query string for this node.
|
|
47
|
+
*/
|
|
48
|
+
toString() {
|
|
49
|
+
return `(${this.expr} ${this.op})`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=unary-op.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unary-op.js","sourceRoot":"","sources":["../../../src/ast/unary-op.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,mBAAoB,SAAQ,QAAQ;IACxC,yBAAyB;IAChB,EAAE,CAAS;IACpB,4BAA4B;IACnB,IAAI,CAAW;IAExB;;;;;OAKG;IACH,YAAY,IAAY,EAAE,EAAU,EAAE,IAAc;QAClD,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,mBAAmB;IAClD;;;;OAIG;IACH,YAAY,EAAU,EAAE,IAAc;QACpC,KAAK,CAAC,cAAc,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC;IACrC,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,mBAAmB;IACzD;;;;OAIG;IACH,YAAY,EAAU,EAAE,IAAc;QACpC,KAAK,CAAC,sBAAsB,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExprNode } from './node.js';
|
|
2
|
+
export declare class VerbatimNode extends ExprNode {
|
|
3
|
+
/** The verbatim content to include. */
|
|
4
|
+
readonly value: string;
|
|
5
|
+
/** A type hint for analyzing verbatim content. */
|
|
6
|
+
readonly hint?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Instantiate a raw node with verbatim content.
|
|
9
|
+
* @param value The verbatim content to include.
|
|
10
|
+
* @param hint A type hint for analyzing verbatim content.
|
|
11
|
+
*/
|
|
12
|
+
constructor(value: string, hint?: string);
|
|
13
|
+
/**
|
|
14
|
+
* Generate a SQL query string for this node.
|
|
15
|
+
*/
|
|
16
|
+
toString(): string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=verbatim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verbatim.d.ts","sourceRoot":"","sources":["../../../src/ast/verbatim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,qBAAa,YAAa,SAAQ,QAAQ;IACxC,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;gBACS,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IAMxC;;OAEG;IACH,QAAQ;CAGT"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VERBATIM } from '../constants.js';
|
|
2
|
+
import { ExprNode } from './node.js';
|
|
3
|
+
export class VerbatimNode extends ExprNode {
|
|
4
|
+
/** The verbatim content to include. */
|
|
5
|
+
value;
|
|
6
|
+
/** A type hint for analyzing verbatim content. */
|
|
7
|
+
hint;
|
|
8
|
+
/**
|
|
9
|
+
* Instantiate a raw node with verbatim content.
|
|
10
|
+
* @param value The verbatim content to include.
|
|
11
|
+
* @param hint A type hint for analyzing verbatim content.
|
|
12
|
+
*/
|
|
13
|
+
constructor(value, hint) {
|
|
14
|
+
super(VERBATIM);
|
|
15
|
+
this.value = value;
|
|
16
|
+
this.hint = hint;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Generate a SQL query string for this node.
|
|
20
|
+
*/
|
|
21
|
+
toString() {
|
|
22
|
+
return this.value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=verbatim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verbatim.js","sourceRoot":"","sources":["../../../src/ast/verbatim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxC,uCAAuC;IAC9B,KAAK,CAAS;IACvB,kDAAkD;IACzC,IAAI,CAAU;IAEvB;;;;OAIG;IACH,YAAY,KAAa,EAAE,IAAa;QACtC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ParamLike } from '../types.js';
|
|
2
|
+
import { type ExprNode, SQLNode } from './node.js';
|
|
3
|
+
import { ParamNode } from './param.js';
|
|
4
|
+
export type FrameValue = ExprNode | number | null;
|
|
5
|
+
export type FrameExtent = [FrameValue, FrameValue] | ParamLike;
|
|
6
|
+
export type FrameScope = 'PRECEDING' | 'FOLLOWING' | 'CURRENT ROW';
|
|
7
|
+
export type FrameType = 'ROWS' | 'RANGE' | 'GROUPS';
|
|
8
|
+
export type FrameExclude = 'NO OTHERS' | 'CURRENT ROW' | 'TIES' | 'GROUP';
|
|
9
|
+
export declare const ROWS = "ROWS";
|
|
10
|
+
export declare const RANGE = "RANGE";
|
|
11
|
+
export declare const GROUPS = "GROUPS";
|
|
12
|
+
export declare const PRECEDING = "PRECEDING";
|
|
13
|
+
export declare const FOLLOWING = "FOLLOWING";
|
|
14
|
+
export declare const CURRENT_ROW = "CURRENT ROW";
|
|
15
|
+
export declare const UNBOUNDED = "UNBOUNDED";
|
|
16
|
+
export declare class WindowFrameNode extends SQLNode {
|
|
17
|
+
/** The frame type, one of ROWS, RANGE, or GROUPS. */
|
|
18
|
+
readonly frameType: FrameType;
|
|
19
|
+
/** The window frame extent. */
|
|
20
|
+
readonly extent: [unknown, unknown] | ParamNode;
|
|
21
|
+
/** The window frame exclusion criteria. */
|
|
22
|
+
readonly exclude?: FrameExclude;
|
|
23
|
+
/**
|
|
24
|
+
* Instantiate a window frame definition node.
|
|
25
|
+
* @param frameType The frame type, one of ROWS, RANGE, or GROUPS.
|
|
26
|
+
* @param extent The window frame extent.
|
|
27
|
+
* @param exclude The window frame exclusion criteria.
|
|
28
|
+
*/
|
|
29
|
+
constructor(frameType: FrameType, extent: FrameExtent, exclude?: FrameExclude);
|
|
30
|
+
/**
|
|
31
|
+
* Generate a SQL query string for this node.
|
|
32
|
+
*/
|
|
33
|
+
toString(): string;
|
|
34
|
+
}
|
|
35
|
+
export declare class WindowFrameExprNode extends SQLNode {
|
|
36
|
+
/** The window frame extent. */
|
|
37
|
+
readonly scope: FrameScope;
|
|
38
|
+
/**
|
|
39
|
+
* The window frame extent expression. This value should be null
|
|
40
|
+
* in the case of current row or unbounded extent values.
|
|
41
|
+
*/
|
|
42
|
+
readonly expr: FrameValue | null;
|
|
43
|
+
/**
|
|
44
|
+
* Instantiate a window frame definition node.
|
|
45
|
+
* @param scope The frame scope, one of PRECEDING, FOLLOWING, or CURRENT ROW.
|
|
46
|
+
* @param expr The window frame extent expression.
|
|
47
|
+
*/
|
|
48
|
+
constructor(scope: FrameScope, expr?: FrameValue | null);
|
|
49
|
+
/**
|
|
50
|
+
* Generate a SQL query string for this node.
|
|
51
|
+
*/
|
|
52
|
+
toString(): string;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=window-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-frame.d.ts","sourceRoot":"","sources":["../../../src/ast/window-frame.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,KAAK,QAAQ,EAAU,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAI,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;AACnD,MAAM,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC;AAC/D,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,CAAC;AACnE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1E,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,SAAS,cAAc,CAAC;AACrC,eAAO,MAAM,SAAS,cAAc,CAAC;AACrC,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,qBAAa,eAAgB,SAAQ,OAAO;IAC1C,qDAAqD;IACrD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAChD,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAEhC;;;;;OAKG;gBAED,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,YAAY;IAQxB;;OAEG;IACH,QAAQ;CAST;AAUD,qBAAa,mBAAoB,SAAQ,OAAO;IAC9C,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IAEjC;;;;OAIG;gBACS,KAAK,EAAE,UAAU,EAAE,IAAI,GAAE,UAAU,GAAG,IAAW;IAM7D;;OAEG;IACH,QAAQ;CAMT"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { WINDOW_EXTENT_EXPR, WINDOW_FRAME } from '../constants.js';
|
|
2
|
+
import { isParamLike } from '../util/type-check.js';
|
|
3
|
+
import { isNode, SQLNode } from './node.js';
|
|
4
|
+
import { ParamNode } from './param.js';
|
|
5
|
+
export const ROWS = 'ROWS';
|
|
6
|
+
export const RANGE = 'RANGE';
|
|
7
|
+
export const GROUPS = 'GROUPS';
|
|
8
|
+
export const PRECEDING = 'PRECEDING';
|
|
9
|
+
export const FOLLOWING = 'FOLLOWING';
|
|
10
|
+
export const CURRENT_ROW = 'CURRENT ROW';
|
|
11
|
+
export const UNBOUNDED = 'UNBOUNDED';
|
|
12
|
+
export class WindowFrameNode extends SQLNode {
|
|
13
|
+
/** The frame type, one of ROWS, RANGE, or GROUPS. */
|
|
14
|
+
frameType;
|
|
15
|
+
/** The window frame extent. */
|
|
16
|
+
extent;
|
|
17
|
+
/** The window frame exclusion criteria. */
|
|
18
|
+
exclude;
|
|
19
|
+
/**
|
|
20
|
+
* Instantiate a window frame definition node.
|
|
21
|
+
* @param frameType The frame type, one of ROWS, RANGE, or GROUPS.
|
|
22
|
+
* @param extent The window frame extent.
|
|
23
|
+
* @param exclude The window frame exclusion criteria.
|
|
24
|
+
*/
|
|
25
|
+
constructor(frameType, extent, exclude) {
|
|
26
|
+
super(WINDOW_FRAME);
|
|
27
|
+
this.frameType = frameType;
|
|
28
|
+
this.extent = isParamLike(extent) ? new ParamNode(extent) : extent;
|
|
29
|
+
this.exclude = exclude;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate a SQL query string for this node.
|
|
33
|
+
*/
|
|
34
|
+
toString() {
|
|
35
|
+
const { frameType, exclude, extent } = this;
|
|
36
|
+
const [prev, next] = isNode(extent)
|
|
37
|
+
? extent.value
|
|
38
|
+
: extent;
|
|
39
|
+
const a = asFrameExpr(prev, PRECEDING);
|
|
40
|
+
const b = asFrameExpr(next, FOLLOWING);
|
|
41
|
+
return `${frameType} BETWEEN ${a} AND ${b}${exclude ? ` ${exclude}` : ''}`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function asFrameExpr(value, scope) {
|
|
45
|
+
return value instanceof WindowFrameExprNode ? value
|
|
46
|
+
: value != null && typeof value !== 'number' ? `${value} ${scope}`
|
|
47
|
+
: value === 0 ? CURRENT_ROW
|
|
48
|
+
: !(value && Number.isFinite(value)) ? `${UNBOUNDED} ${scope}`
|
|
49
|
+
: `${Math.abs(value)} ${scope}`;
|
|
50
|
+
}
|
|
51
|
+
export class WindowFrameExprNode extends SQLNode {
|
|
52
|
+
/** The window frame extent. */
|
|
53
|
+
scope;
|
|
54
|
+
/**
|
|
55
|
+
* The window frame extent expression. This value should be null
|
|
56
|
+
* in the case of current row or unbounded extent values.
|
|
57
|
+
*/
|
|
58
|
+
expr;
|
|
59
|
+
/**
|
|
60
|
+
* Instantiate a window frame definition node.
|
|
61
|
+
* @param scope The frame scope, one of PRECEDING, FOLLOWING, or CURRENT ROW.
|
|
62
|
+
* @param expr The window frame extent expression.
|
|
63
|
+
*/
|
|
64
|
+
constructor(scope, expr = null) {
|
|
65
|
+
super(WINDOW_EXTENT_EXPR);
|
|
66
|
+
this.scope = scope;
|
|
67
|
+
this.expr = expr;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generate a SQL query string for this node.
|
|
71
|
+
*/
|
|
72
|
+
toString() {
|
|
73
|
+
const { scope, expr } = this;
|
|
74
|
+
return scope === CURRENT_ROW
|
|
75
|
+
? scope
|
|
76
|
+
: `${expr ?? UNBOUNDED} ${scope}`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=window-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-frame.js","sourceRoot":"","sources":["../../../src/ast/window-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAiB,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQvC,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAC3B,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAC7B,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AAErC,MAAM,OAAO,eAAgB,SAAQ,OAAO;IAC1C,qDAAqD;IAC5C,SAAS,CAAY;IAC9B,+BAA+B;IACtB,MAAM,CAAiC;IAChD,2CAA2C;IAClC,OAAO,CAAgB;IAEhC;;;;;OAKG;IACH,YACE,SAAoB,EACpB,MAAmB,EACnB,OAAsB;QAEtB,KAAK,CAAC,YAAY,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACnE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAC5C,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;YACjC,CAAC,CAAC,MAAM,CAAC,KAA2B;YACpC,CAAC,CAAC,MAAM,CAAC;QACX,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACvC,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACvC,OAAO,GAAG,SAAS,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC7E,CAAC;CACF;AAED,SAAS,WAAW,CAAC,KAAc,EAAE,KAAa;IAChD,OAAO,KAAK,YAAY,mBAAmB,CAAC,CAAC,CAAC,KAAK;QACjD,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,EAAE;YAClE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW;gBAC3B,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,KAAK,EAAE;oBAC9D,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,OAAO,mBAAoB,SAAQ,OAAO;IAC9C,+BAA+B;IACtB,KAAK,CAAa;IAC3B;;;OAGG;IACM,IAAI,CAAoB;IAEjC;;;;OAIG;IACH,YAAY,KAAiB,EAAE,OAA0B,IAAI;QAC3D,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QAC7B,OAAO,KAAK,KAAK,WAAW;YAC1B,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,GAAG,IAAI,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { ExprVarArgs, OrderByExpr, WindowFunctionName } from '../types.js';
|
|
2
|
+
import type { AggregateNode } from './aggregate.js';
|
|
3
|
+
import type { WindowFrameNode } from './window-frame.js';
|
|
4
|
+
import { ExprNode, SQLNode } from './node.js';
|
|
5
|
+
export declare class WindowClauseNode extends SQLNode {
|
|
6
|
+
/** The window name. */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** The window definition. */
|
|
9
|
+
readonly def: WindowDefNode;
|
|
10
|
+
/**
|
|
11
|
+
* Instantiate a window clause node.
|
|
12
|
+
* @param name The window name.
|
|
13
|
+
* @param def The window definition.
|
|
14
|
+
*/
|
|
15
|
+
constructor(name: string, def: WindowDefNode);
|
|
16
|
+
/**
|
|
17
|
+
* Generate a SQL query string for this node.
|
|
18
|
+
*/
|
|
19
|
+
toString(): string;
|
|
20
|
+
}
|
|
21
|
+
export declare class WindowNode extends ExprNode {
|
|
22
|
+
readonly func: WindowFunctionNode | AggregateNode;
|
|
23
|
+
readonly def: WindowDefNode;
|
|
24
|
+
/**
|
|
25
|
+
* Instantiate a window node.
|
|
26
|
+
* @param func The window function call.
|
|
27
|
+
* @param over The window definition or name.
|
|
28
|
+
*/
|
|
29
|
+
constructor(func: WindowFunctionNode | AggregateNode, over?: WindowDefNode);
|
|
30
|
+
/**
|
|
31
|
+
* Return an updated window over a named window definition.
|
|
32
|
+
* @param name The window definition name.
|
|
33
|
+
* @returns A new window node.
|
|
34
|
+
*/
|
|
35
|
+
over(name: string): WindowNode;
|
|
36
|
+
/**
|
|
37
|
+
* Return an updated window with the given partitions.
|
|
38
|
+
* @param expr The partition by criteria.
|
|
39
|
+
* @returns A new window node.
|
|
40
|
+
*/
|
|
41
|
+
partitionby(...expr: ExprVarArgs[]): WindowNode;
|
|
42
|
+
/**
|
|
43
|
+
* Return an updated window with the given ordering.
|
|
44
|
+
* @param expr The order by criteria.
|
|
45
|
+
* @returns A new window node.
|
|
46
|
+
*/
|
|
47
|
+
orderby(...expr: ExprVarArgs[]): WindowNode;
|
|
48
|
+
/**
|
|
49
|
+
* Return an updated window with the given frame definition.
|
|
50
|
+
* @param framedef The frame definition.
|
|
51
|
+
* @returns A new window node.
|
|
52
|
+
*/
|
|
53
|
+
frame(framedef: WindowFrameNode): WindowNode;
|
|
54
|
+
/**
|
|
55
|
+
* Generate a SQL query string for this node.
|
|
56
|
+
*/
|
|
57
|
+
toString(): string;
|
|
58
|
+
}
|
|
59
|
+
export declare class WindowFunctionNode extends ExprNode {
|
|
60
|
+
/** The window function name. */
|
|
61
|
+
readonly name: string;
|
|
62
|
+
/** The window function arguments. */
|
|
63
|
+
readonly args: ExprNode[];
|
|
64
|
+
/** Flag to ignore null values. */
|
|
65
|
+
readonly ignoreNulls: boolean;
|
|
66
|
+
/** Order by expression for window arguments. */
|
|
67
|
+
readonly order: ExprNode[];
|
|
68
|
+
/**
|
|
69
|
+
* Instantiate a window function call node.
|
|
70
|
+
* @param name The window function name.
|
|
71
|
+
* @param args The window function arguments.
|
|
72
|
+
* @param ignoreNulls Flag to ignore null values.
|
|
73
|
+
* @param argOrder Order expressions for window arguments.
|
|
74
|
+
* Note that this argument ordering is distinct from the window ordering.
|
|
75
|
+
*/
|
|
76
|
+
constructor(name: WindowFunctionName, args?: ExprNode[], ignoreNulls?: boolean, argOrder?: OrderByExpr);
|
|
77
|
+
/**
|
|
78
|
+
* Generate a SQL query string for this node.
|
|
79
|
+
*/
|
|
80
|
+
toString(): string;
|
|
81
|
+
}
|
|
82
|
+
export declare class WindowDefNode extends SQLNode {
|
|
83
|
+
/** The base window definition name. */
|
|
84
|
+
readonly name?: string;
|
|
85
|
+
/** The partition by criteria. */
|
|
86
|
+
readonly partition?: ExprNode[];
|
|
87
|
+
/** The order by criteria. */
|
|
88
|
+
readonly order?: ExprNode[];
|
|
89
|
+
/** The window frame definition. */
|
|
90
|
+
readonly framedef?: WindowFrameNode;
|
|
91
|
+
/**
|
|
92
|
+
* Instantiate a window definition node.
|
|
93
|
+
* @param name The base window definition name.
|
|
94
|
+
* @param partition The partition by criteria.
|
|
95
|
+
* @param order The order by criteria.
|
|
96
|
+
* @param framedef The window frame definition.
|
|
97
|
+
*/
|
|
98
|
+
constructor(name?: string, partition?: ExprNode[], order?: ExprNode[], framedef?: WindowFrameNode);
|
|
99
|
+
/**
|
|
100
|
+
* Return an updated window definition with the given base name.
|
|
101
|
+
* @param name The base window definition name.
|
|
102
|
+
* @returns A new window definition node.
|
|
103
|
+
*/
|
|
104
|
+
over(name: string): WindowDefNode;
|
|
105
|
+
/**
|
|
106
|
+
* Return an updated window definition with the given partitions.
|
|
107
|
+
* @param expr The partition by criteria.
|
|
108
|
+
* @returns A new window definition node.
|
|
109
|
+
*/
|
|
110
|
+
partitionby(...expr: ExprVarArgs[]): WindowDefNode;
|
|
111
|
+
/**
|
|
112
|
+
* Return an updated window definition with the given ordering.
|
|
113
|
+
* @param expr The order by criteria.
|
|
114
|
+
* @returns A new window definition node.
|
|
115
|
+
*/
|
|
116
|
+
orderby(...expr: ExprVarArgs[]): WindowDefNode;
|
|
117
|
+
/**
|
|
118
|
+
* Return an updated window definition with the given frame definition.
|
|
119
|
+
* @param framedef The frame definition.
|
|
120
|
+
* @return A new window definition node.
|
|
121
|
+
*/
|
|
122
|
+
frame(framedef: WindowFrameNode): WindowDefNode;
|
|
123
|
+
/**
|
|
124
|
+
* Generate a SQL query string for this node.
|
|
125
|
+
*/
|
|
126
|
+
toString(): string;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/ast/window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,qBAAa,gBAAiB,SAAQ,OAAO;IAC1C,uBAAuB;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAE7B;;;;OAIG;gBACS,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa;IAM5C;;OAEG;IACH,QAAQ;CAGT;AAED,qBAAa,UAAW,SAAQ,QAAQ;IACtC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,aAAa,CAAC;IAClD,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAA;IAE3B;;;;OAIG;gBAED,IAAI,EAAE,kBAAkB,GAAG,aAAa,EACxC,IAAI,GAAE,aAAmC;IAO3C;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM;IAIjB;;;;OAIG;IACH,WAAW,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE;IAIlC;;;;OAIG;IACH,OAAO,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE;IAI9B;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,eAAe;IAI/B;;OAEG;IACH,QAAQ;CAGT;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC1B,kCAAkC;IAClC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAE3B;;;;;;;OAOG;gBAED,IAAI,EAAE,kBAAkB,EACxB,IAAI,GAAE,QAAQ,EAAO,EACrB,WAAW,GAAE,OAAe,EAC5B,QAAQ,GAAE,WAAgB;IAS5B;;OAEG;IACH,QAAQ;CAST;AAED,qBAAa,aAAc,SAAQ,OAAO;IACxC,uCAAuC;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IAChC,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAEpC;;;;;;OAMG;gBAED,IAAI,CAAC,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,QAAQ,EAAE,EACtB,KAAK,CAAC,EAAE,QAAQ,EAAE,EAClB,QAAQ,CAAC,EAAE,eAAe;IAS5B;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM;IAIjB;;;;OAIG;IACH,WAAW,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE;IAIlC;;;;OAIG;IACH,OAAO,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE;IAI9B;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,eAAe;IAI/B;;OAEG;IACH,QAAQ;CAWT"}
|