@devrev/meerkat-core 0.0.77
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/README.md +11 -0
- package/package.json +30 -0
- package/src/ast-builder/ast-builder.d.ts +6 -0
- package/src/ast-builder/ast-builder.js +89 -0
- package/src/ast-builder/ast-builder.js.map +1 -0
- package/src/ast-deserializer/ast-deserializer.d.ts +5 -0
- package/src/ast-deserializer/ast-deserializer.js +30 -0
- package/src/ast-deserializer/ast-deserializer.js.map +1 -0
- package/src/context-params/context-params-ast.d.ts +11 -0
- package/src/context-params/context-params-ast.js +55 -0
- package/src/context-params/context-params-ast.js.map +1 -0
- package/src/cube-filter-transformer/and/and.d.ts +2 -0
- package/src/cube-filter-transformer/and/and.js +18 -0
- package/src/cube-filter-transformer/and/and.js.map +1 -0
- package/src/cube-filter-transformer/base-condition-builder/base-condition-builder.d.ts +154 -0
- package/src/cube-filter-transformer/base-condition-builder/base-condition-builder.js +159 -0
- package/src/cube-filter-transformer/base-condition-builder/base-condition-builder.js.map +1 -0
- package/src/cube-filter-transformer/contains/contains.d.ts +65 -0
- package/src/cube-filter-transformer/contains/contains.js +70 -0
- package/src/cube-filter-transformer/contains/contains.js.map +1 -0
- package/src/cube-filter-transformer/equals/equals-array.d.ts +2 -0
- package/src/cube-filter-transformer/equals/equals-array.js +30 -0
- package/src/cube-filter-transformer/equals/equals-array.js.map +1 -0
- package/src/cube-filter-transformer/equals/equals.d.ts +2 -0
- package/src/cube-filter-transformer/equals/equals.js +37 -0
- package/src/cube-filter-transformer/equals/equals.js.map +1 -0
- package/src/cube-filter-transformer/factory.d.ts +5 -0
- package/src/cube-filter-transformer/factory.js +124 -0
- package/src/cube-filter-transformer/factory.js.map +1 -0
- package/src/cube-filter-transformer/gt/gt.d.ts +2 -0
- package/src/cube-filter-transformer/gt/gt.js +30 -0
- package/src/cube-filter-transformer/gt/gt.js.map +1 -0
- package/src/cube-filter-transformer/gte/gte.d.ts +2 -0
- package/src/cube-filter-transformer/gte/gte.js +30 -0
- package/src/cube-filter-transformer/gte/gte.js.map +1 -0
- package/src/cube-filter-transformer/in/in.d.ts +2 -0
- package/src/cube-filter-transformer/in/in.js +77 -0
- package/src/cube-filter-transformer/in/in.js.map +1 -0
- package/src/cube-filter-transformer/in-date-range/in-date-range.d.ts +2 -0
- package/src/cube-filter-transformer/in-date-range/in-date-range.js +24 -0
- package/src/cube-filter-transformer/in-date-range/in-date-range.js.map +1 -0
- package/src/cube-filter-transformer/lt/lt.d.ts +2 -0
- package/src/cube-filter-transformer/lt/lt.js +30 -0
- package/src/cube-filter-transformer/lt/lt.js.map +1 -0
- package/src/cube-filter-transformer/lte/lte.d.ts +2 -0
- package/src/cube-filter-transformer/lte/lte.js +30 -0
- package/src/cube-filter-transformer/lte/lte.js.map +1 -0
- package/src/cube-filter-transformer/not/not.d.ts +2 -0
- package/src/cube-filter-transformer/not/not.js +18 -0
- package/src/cube-filter-transformer/not/not.js.map +1 -0
- package/src/cube-filter-transformer/not-In-date-range/not-In-date-range.d.ts +2 -0
- package/src/cube-filter-transformer/not-In-date-range/not-In-date-range.js +24 -0
- package/src/cube-filter-transformer/not-In-date-range/not-In-date-range.js.map +1 -0
- package/src/cube-filter-transformer/not-contains/not-contains.d.ts +65 -0
- package/src/cube-filter-transformer/not-contains/not-contains.js +70 -0
- package/src/cube-filter-transformer/not-contains/not-contains.js.map +1 -0
- package/src/cube-filter-transformer/not-equals/not-equals-array.d.ts +2 -0
- package/src/cube-filter-transformer/not-equals/not-equals-array.js +26 -0
- package/src/cube-filter-transformer/not-equals/not-equals-array.js.map +1 -0
- package/src/cube-filter-transformer/not-equals/not-equals.d.ts +8 -0
- package/src/cube-filter-transformer/not-equals/not-equals.js +37 -0
- package/src/cube-filter-transformer/not-equals/not-equals.js.map +1 -0
- package/src/cube-filter-transformer/not-in/not-in.d.ts +2 -0
- package/src/cube-filter-transformer/not-in/not-in.js +84 -0
- package/src/cube-filter-transformer/not-in/not-in.js.map +1 -0
- package/src/cube-filter-transformer/not-set/not-set.d.ts +2 -0
- package/src/cube-filter-transformer/not-set/not-set.js +26 -0
- package/src/cube-filter-transformer/not-set/not-set.js.map +1 -0
- package/src/cube-filter-transformer/or/or.d.ts +2 -0
- package/src/cube-filter-transformer/or/or.js +18 -0
- package/src/cube-filter-transformer/or/or.js.map +1 -0
- package/src/cube-filter-transformer/set/set.d.ts +2 -0
- package/src/cube-filter-transformer/set/set.js +26 -0
- package/src/cube-filter-transformer/set/set.js.map +1 -0
- package/src/cube-group-by-transformer/cube-group-by-transformer.d.ts +8 -0
- package/src/cube-group-by-transformer/cube-group-by-transformer.js +25 -0
- package/src/cube-group-by-transformer/cube-group-by-transformer.js.map +1 -0
- package/src/cube-limit-offset-transformer/cube-limit-offset-transformer.d.ts +31 -0
- package/src/cube-limit-offset-transformer/cube-limit-offset-transformer.js +42 -0
- package/src/cube-limit-offset-transformer/cube-limit-offset-transformer.js.map +1 -0
- package/src/cube-measure-transformer/cube-measure-transformer.d.ts +21 -0
- package/src/cube-measure-transformer/cube-measure-transformer.js +126 -0
- package/src/cube-measure-transformer/cube-measure-transformer.js.map +1 -0
- package/src/cube-order-by-transformer/cube-order-by-transformer.d.ts +21 -0
- package/src/cube-order-by-transformer/cube-order-by-transformer.js +39 -0
- package/src/cube-order-by-transformer/cube-order-by-transformer.js.map +1 -0
- package/src/cube-to-duckdb/cube-filter-to-duckdb.d.ts +16 -0
- package/src/cube-to-duckdb/cube-filter-to-duckdb.js +3 -0
- package/src/cube-to-duckdb/cube-filter-to-duckdb.js.map +1 -0
- package/src/filter-params/filter-params-ast.d.ts +33 -0
- package/src/filter-params/filter-params-ast.js +115 -0
- package/src/filter-params/filter-params-ast.js.map +1 -0
- package/src/get-projection-clause/get-projection-clause.d.ts +27 -0
- package/src/get-projection-clause/get-projection-clause.js +135 -0
- package/src/get-projection-clause/get-projection-clause.js.map +1 -0
- package/src/get-wrapped-base-query-with-projections/get-wrapped-base-query-with-projections.d.ts +8 -0
- package/src/get-wrapped-base-query-with-projections/get-wrapped-base-query-with-projections.js +99 -0
- package/src/get-wrapped-base-query-with-projections/get-wrapped-base-query-with-projections.js.map +1 -0
- package/src/index.d.ts +16 -0
- package/src/index.js +55 -0
- package/src/index.js.map +1 -0
- package/src/joins/joins.d.ts +22 -0
- package/src/joins/joins.js +170 -0
- package/src/joins/joins.js.map +1 -0
- package/src/types/cube-types/index.d.js +6 -0
- package/src/types/cube-types/index.d.js.map +1 -0
- package/src/types/cube-types/index.d.ts +2 -0
- package/src/types/cube-types/index.js +6 -0
- package/src/types/cube-types/index.js.map +1 -0
- package/src/types/cube-types/query.d.js +5 -0
- package/src/types/cube-types/query.d.js.map +1 -0
- package/src/types/cube-types/query.d.ts +141 -0
- package/src/types/cube-types/query.js +14 -0
- package/src/types/cube-types/query.js.map +1 -0
- package/src/types/cube-types/table.d.js +3 -0
- package/src/types/cube-types/table.d.js.map +1 -0
- package/src/types/cube-types/table.d.ts +25 -0
- package/src/types/cube-types/table.js +3 -0
- package/src/types/cube-types/table.js.map +1 -0
- package/src/types/duckdb-serialization-types/index.d.js +11 -0
- package/src/types/duckdb-serialization-types/index.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/index.d.ts +7 -0
- package/src/types/duckdb-serialization-types/index.js +11 -0
- package/src/types/duckdb-serialization-types/index.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Constraint.d.ts +47 -0
- package/src/types/duckdb-serialization-types/serialization/Constraint.js +31 -0
- package/src/types/duckdb-serialization-types/serialization/Constraint.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/CreateInfo.d.ts +95 -0
- package/src/types/duckdb-serialization-types/serialization/CreateInfo.js +67 -0
- package/src/types/duckdb-serialization-types/serialization/CreateInfo.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Expression.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/Expression.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Expression.d.ts +186 -0
- package/src/types/duckdb-serialization-types/serialization/Expression.js +130 -0
- package/src/types/duckdb-serialization-types/serialization/Expression.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/LogicalOperator.d.ts +231 -0
- package/src/types/duckdb-serialization-types/serialization/LogicalOperator.js +47 -0
- package/src/types/duckdb-serialization-types/serialization/LogicalOperator.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/MacroFunction.d.ts +20 -0
- package/src/types/duckdb-serialization-types/serialization/MacroFunction.js +15 -0
- package/src/types/duckdb-serialization-types/serialization/MacroFunction.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Misc.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/Misc.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Misc.d.ts +3 -0
- package/src/types/duckdb-serialization-types/serialization/Misc.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/Misc.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Nodes.d.js +10 -0
- package/src/types/duckdb-serialization-types/serialization/Nodes.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Nodes.d.ts +212 -0
- package/src/types/duckdb-serialization-types/serialization/Nodes.js +92 -0
- package/src/types/duckdb-serialization-types/serialization/Nodes.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/ParseInfo.d.ts +192 -0
- package/src/types/duckdb-serialization-types/serialization/ParseInfo.js +128 -0
- package/src/types/duckdb-serialization-types/serialization/ParseInfo.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/ParsedExpression.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/ParsedExpression.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/ParsedExpression.d.ts +114 -0
- package/src/types/duckdb-serialization-types/serialization/ParsedExpression.js +37 -0
- package/src/types/duckdb-serialization-types/serialization/ParsedExpression.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/QueryNode.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/QueryNode.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/QueryNode.d.ts +62 -0
- package/src/types/duckdb-serialization-types/serialization/QueryNode.js +42 -0
- package/src/types/duckdb-serialization-types/serialization/QueryNode.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/ResultModifier.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/ResultModifier.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/ResultModifier.d.ts +29 -0
- package/src/types/duckdb-serialization-types/serialization/ResultModifier.js +16 -0
- package/src/types/duckdb-serialization-types/serialization/ResultModifier.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Statement.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/Statement.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Statement.d.ts +4 -0
- package/src/types/duckdb-serialization-types/serialization/Statement.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/Statement.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/TableFilter.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/TableFilter.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/TableFilter.d.ts +32 -0
- package/src/types/duckdb-serialization-types/serialization/TableFilter.js +17 -0
- package/src/types/duckdb-serialization-types/serialization/TableFilter.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/TableRef.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/TableRef.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/TableRef.d.ts +84 -0
- package/src/types/duckdb-serialization-types/serialization/TableRef.js +53 -0
- package/src/types/duckdb-serialization-types/serialization/TableRef.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Types.d.js +3 -0
- package/src/types/duckdb-serialization-types/serialization/Types.d.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/Types.d.ts +53 -0
- package/src/types/duckdb-serialization-types/serialization/Types.js +21 -0
- package/src/types/duckdb-serialization-types/serialization/Types.js.map +1 -0
- package/src/types/duckdb-serialization-types/serialization/example.d.ts +1 -0
- package/src/types/duckdb-serialization-types/serialization/example.js +131 -0
- package/src/types/duckdb-serialization-types/serialization/example.js.map +1 -0
- package/src/utils/__fixtures__/joins.fixtures.d.ts +211 -0
- package/src/utils/__fixtures__/joins.fixtures.js +922 -0
- package/src/utils/__fixtures__/joins.fixtures.js.map +1 -0
- package/src/utils/base-ast.d.ts +3 -0
- package/src/utils/base-ast.js +64 -0
- package/src/utils/base-ast.js.map +1 -0
- package/src/utils/constants.d.ts +2 -0
- package/src/utils/constants.js +19 -0
- package/src/utils/constants.js.map +1 -0
- package/src/utils/cube-filter-enrichment.d.ts +4 -0
- package/src/utils/cube-filter-enrichment.js +63 -0
- package/src/utils/cube-filter-enrichment.js.map +1 -0
- package/src/utils/cube-to-table-schema.d.ts +3 -0
- package/src/utils/cube-to-table-schema.js +104 -0
- package/src/utils/cube-to-table-schema.js.map +1 -0
- package/src/utils/cube-type-to-duckdb-type.d.ts +6 -0
- package/src/utils/cube-type-to-duckdb-type.js +17 -0
- package/src/utils/cube-type-to-duckdb-type.js.map +1 -0
- package/src/utils/find-in-table-schema.d.ts +4 -0
- package/src/utils/find-in-table-schema.js +40 -0
- package/src/utils/find-in-table-schema.js.map +1 -0
- package/src/utils/get-possible-nodes.d.ts +15 -0
- package/src/utils/get-possible-nodes.js +152 -0
- package/src/utils/get-possible-nodes.js.map +1 -0
- package/src/utils/get-type-info.d.ts +7 -0
- package/src/utils/get-type-info.js +44 -0
- package/src/utils/get-type-info.js.map +1 -0
- package/src/utils/is-array-member-type.d.ts +4 -0
- package/src/utils/is-array-member-type.js +12 -0
- package/src/utils/is-array-member-type.js.map +1 -0
- package/src/utils/key-from-measures-dimension.d.ts +2 -0
- package/src/utils/key-from-measures-dimension.js +34 -0
- package/src/utils/key-from-measures-dimension.js.map +1 -0
- package/src/utils/meerkat-placeholder-replacer.d.ts +1 -0
- package/src/utils/meerkat-placeholder-replacer.js +14 -0
- package/src/utils/meerkat-placeholder-replacer.js.map +1 -0
- package/src/utils/member-key-to-safe-key.d.ts +1 -0
- package/src/utils/member-key-to-safe-key.js +13 -0
- package/src/utils/member-key-to-safe-key.js.map +1 -0
- package/src/utils/modify-meerkat-filter.d.ts +3 -0
- package/src/utils/modify-meerkat-filter.js +30 -0
- package/src/utils/modify-meerkat-filter.js.map +1 -0
- package/src/utils/type-guards.d.ts +8 -0
- package/src/utils/type-guards.js +83 -0
- package/src/utils/type-guards.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../meerkat-core/src/types/cube-types/query.ts"],"sourcesContent":["/**\n * Request type data type.\n */\ntype RequestType = 'multi';\n\n/**\n * Result type data type.\n */\ntype ResultType = 'default' | 'compact';\n\n/**\n * API type data type.\n */\ntype ApiType = 'sql' | 'graphql' | 'rest' | 'ws' | 'stream';\n\n/**\n * Parsed query type data type.\n */\ntype QueryType = 'regularQuery' | 'compareDateRangeQuery' | 'blendingQuery';\n\n/**\n * String that represent query member type.\n */\ntype MemberType = 'measures' | 'dimensions' | 'segments';\n\n/**\n * Member identifier. Should satisfy to the following regexp: /^[a-zA-Z0-9_]+\\.[a-zA-Z0-9_]+$/\n */\ntype Member = string;\n\n/**\n * Datetime member identifier. Should satisfy to the following\n * regexp: /^[a-zA-Z0-9_]+\\.[a-zA-Z0-9_]+(\\.(second|minute|hour|day|week|month|year))?$/\n */\ntype TimeMember = string;\n\n/**\n * Filter operator string.\n */\ntype FilterOperator =\n | 'equals'\n | 'notEquals'\n | 'contains'\n | 'notContains'\n | 'in'\n | 'notIn'\n | 'gt'\n | 'gte'\n | 'lt'\n | 'lte'\n | 'set'\n | 'notSet'\n | 'inDateRange'\n | 'notInDateRange'\n | 'onTheDate'\n | 'beforeDate'\n | 'afterDate'\n | 'measureFilter';\n\n/**\n * Time dimension granularity data type.\n */\ntype QueryTimeDimensionGranularity =\n | 'quarter'\n | 'day'\n | 'month'\n | 'year'\n | 'week'\n | 'hour'\n | 'minute'\n | 'second';\n\n/**\n * Query order data type.\n */\ntype QueryOrderType = 'asc' | 'desc';\n\n/**\n * ApiScopes data type.\n */\ntype ApiScopes = 'graphql' | 'meta' | 'data' | 'jobs';\n\nexport type FilterType = 'BASE_FILTER' | 'PROJECTION_FILTER';\n\ninterface QueryFilter {\n member: Member;\n operator: FilterOperator;\n values?: string[];\n}\n\n/**\n * Query 'and'-filters type definition.\n */\ntype LogicalAndFilter = {\n and: (QueryFilter | { or: (QueryFilter | LogicalAndFilter)[] })[];\n};\n\n/**\n * Query 'or'-filters type definition.\n */\ntype LogicalOrFilter = {\n or: (QueryFilter | LogicalAndFilter)[];\n};\n\n/**\n * Query datetime dimention interface.\n */\ninterface QueryTimeDimension {\n dimension: Member;\n dateRange?: string[] | string;\n granularity?: QueryTimeDimensionGranularity;\n}\n\n/**\n * Join Edge data type.\n */\n\ninterface JoinNode {\n /**\n * Left node.\n */\n left: Member;\n\n /**\n * Right node.\n */\n right: Member;\n\n /**\n * On condition.\n */\n on: string;\n\n /**\n * Example\n * [\n * [\n * {\n * left: dim_ticket,\n * right: dim_user\n * on: 'created_by_id'\n * },\n * {\n * left : dim_user,\n * right: dim_user_role,\n * on: 'role_id'\n * }\n * ]\n * ]\n *\n *\n */\n}\n\n/**\n * Single node data type.\n * This is the case when there is no join. Just a single node.\n */\ninterface SingleNode {\n /**\n * Left node.\n */\n left: Member;\n}\n\ntype JoinPath = [JoinNode | SingleNode, ...JoinNode[]];\n\nexport const isJoinNode = (node: JoinNode | SingleNode): node is JoinNode => {\n return 'right' in node;\n};\n\n/**\n * Incoming network query data type.\n */\n\ntype MeerkatQueryFilter = QueryFilter | LogicalAndFilter | LogicalOrFilter;\n\ninterface Query {\n measures: Member[];\n dimensions?: (Member | TimeMember)[];\n filters?: MeerkatQueryFilter[];\n timeDimensions?: QueryTimeDimension[];\n joinPaths?: JoinPath[];\n segments?: Member[];\n limit?: null | number;\n offset?: number;\n total?: boolean;\n totalQuery?: boolean;\n order?: any;\n timezone?: string;\n renewQuery?: boolean;\n ungrouped?: boolean;\n responseFormat?: ResultType;\n}\n\n/**\n * Normalized filter interface.\n */\ninterface NormalizedQueryFilter extends QueryFilter {\n dimension?: Member;\n}\n\n/**\n * Normalized query interface.\n */\ninterface NormalizedQuery extends Query {\n filters?: NormalizedQueryFilter[];\n rowLimit?: null | number;\n order?: [{ id: string; desc: boolean }];\n}\n\nexport {\n ApiScopes,\n ApiType,\n FilterOperator,\n JoinPath,\n LogicalAndFilter,\n LogicalOrFilter,\n MeerkatQueryFilter,\n Member,\n MemberType,\n NormalizedQuery,\n NormalizedQueryFilter,\n Query,\n QueryFilter,\n QueryOrderType,\n QueryTimeDimension,\n QueryTimeDimensionGranularity,\n QueryType,\n RequestType,\n ResultType,\n TimeMember,\n};\n"],"names":["isJoinNode","node"],"mappings":"AAAA;;CAEC;+BAqKYA;;;eAAAA;;;AAAN,MAAMA,aAAa,CAACC;IACzB,OAAO,WAAWA;AACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../meerkat-core/src/types/cube-types/table.d.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type MeasureType = 'string' | 'string_array' | 'time' | 'number' | 'number_array' | 'boolean';
|
|
2
|
+
export type DimensionType = 'string' | 'string_array' | 'time' | 'number' | 'number_array' | 'boolean';
|
|
3
|
+
export type Measure = {
|
|
4
|
+
name: string;
|
|
5
|
+
sql: string;
|
|
6
|
+
type: MeasureType;
|
|
7
|
+
};
|
|
8
|
+
export type Dimension = {
|
|
9
|
+
name: string;
|
|
10
|
+
sql: string;
|
|
11
|
+
type: DimensionType;
|
|
12
|
+
};
|
|
13
|
+
export type Join = {
|
|
14
|
+
sql: string;
|
|
15
|
+
};
|
|
16
|
+
export type TableSchema = {
|
|
17
|
+
name: string;
|
|
18
|
+
sql: string;
|
|
19
|
+
measures: Measure[];
|
|
20
|
+
dimensions: Dimension[];
|
|
21
|
+
joins?: Join[];
|
|
22
|
+
};
|
|
23
|
+
export interface ContextParams {
|
|
24
|
+
[key: string]: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../meerkat-core/src/types/cube-types/table.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
3
|
+
_export_star._(require("./serialization/Expression"), exports);
|
|
4
|
+
_export_star._(require("./serialization/Nodes"), exports);
|
|
5
|
+
_export_star._(require("./serialization/ParsedExpression"), exports);
|
|
6
|
+
_export_star._(require("./serialization/QueryNode"), exports);
|
|
7
|
+
_export_star._(require("./serialization/ResultModifier"), exports);
|
|
8
|
+
_export_star._(require("./serialization/Statement"), exports);
|
|
9
|
+
_export_star._(require("./serialization/TableRef"), exports);
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../meerkat-core/src/types/duckdb-serialization-types/index.d.ts"],"sourcesContent":["export * from './serialization/Expression';\nexport * from './serialization/Nodes';\nexport * from './serialization/ParsedExpression';\nexport * from './serialization/QueryNode';\nexport * from './serialization/ResultModifier';\nexport * from './serialization/Statement';\nexport * from './serialization/TableRef';\n"],"names":[],"mappings":";;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './serialization/Expression';
|
|
2
|
+
export * from './serialization/Nodes';
|
|
3
|
+
export * from './serialization/ParsedExpression';
|
|
4
|
+
export * from './serialization/QueryNode';
|
|
5
|
+
export * from './serialization/ResultModifier';
|
|
6
|
+
export * from './serialization/Statement';
|
|
7
|
+
export * from './serialization/TableRef';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
3
|
+
_export_star._(require("./serialization/Expression"), exports);
|
|
4
|
+
_export_star._(require("./serialization/Nodes"), exports);
|
|
5
|
+
_export_star._(require("./serialization/ParsedExpression"), exports);
|
|
6
|
+
_export_star._(require("./serialization/QueryNode"), exports);
|
|
7
|
+
_export_star._(require("./serialization/ResultModifier"), exports);
|
|
8
|
+
_export_star._(require("./serialization/Statement"), exports);
|
|
9
|
+
_export_star._(require("./serialization/TableRef"), exports);
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../meerkat-core/src/types/duckdb-serialization-types/index.ts"],"sourcesContent":["export * from './serialization/Expression';\nexport * from './serialization/Nodes';\nexport * from './serialization/ParsedExpression';\nexport * from './serialization/QueryNode';\nexport * from './serialization/ResultModifier';\nexport * from './serialization/Statement';\nexport * from './serialization/TableRef';\n"],"names":[],"mappings":";;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ParsedExpression } from './ParsedExpression';
|
|
2
|
+
export declare enum ConstraintType {
|
|
3
|
+
INVALID = "INVALID",
|
|
4
|
+
NOT_NULL = "NOT_NULL",
|
|
5
|
+
CHECK = "CHECK",
|
|
6
|
+
UNIQUE = "UNIQUE",
|
|
7
|
+
FOREIGN_KEY = "FOREIGN_KEY"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ForeignKeyType {
|
|
10
|
+
FK_TYPE_PRIMARY_KEY_TABLE = "FK_TYPE_PRIMARY_KEY_TABLE",
|
|
11
|
+
FK_TYPE_FOREIGN_KEY_TABLE = "FK_TYPE_FOREIGN_KEY_TABLE",
|
|
12
|
+
FK_TYPE_SELF_REFERENCE_TABLE = "FK_TYPE_SELF_REFERENCE_TABLE"
|
|
13
|
+
}
|
|
14
|
+
export interface BaseConstraint {
|
|
15
|
+
type: ConstraintType;
|
|
16
|
+
}
|
|
17
|
+
export type Constraint = NotNullConstraint | CheckConstraint | ForeignKeyConstraint | UniqueConstraint;
|
|
18
|
+
export interface LogicalIndex {
|
|
19
|
+
index: number;
|
|
20
|
+
}
|
|
21
|
+
export interface PhysicalIndex {
|
|
22
|
+
index: number;
|
|
23
|
+
}
|
|
24
|
+
export interface NotNullConstraint extends BaseConstraint {
|
|
25
|
+
enum: 'NOT_NULL';
|
|
26
|
+
index: LogicalIndex;
|
|
27
|
+
}
|
|
28
|
+
export interface CheckConstraint extends BaseConstraint {
|
|
29
|
+
enum: 'CHECK';
|
|
30
|
+
expression: ParsedExpression;
|
|
31
|
+
}
|
|
32
|
+
export interface ForeignKeyConstraint extends BaseConstraint {
|
|
33
|
+
enum: 'FOREIGN_KEY';
|
|
34
|
+
pk_columns: string[];
|
|
35
|
+
fk_columns: string[];
|
|
36
|
+
fk_type: ForeignKeyType;
|
|
37
|
+
schema: string;
|
|
38
|
+
table: string;
|
|
39
|
+
pk_keys: PhysicalIndex[];
|
|
40
|
+
fk_keys: PhysicalIndex[];
|
|
41
|
+
}
|
|
42
|
+
export interface UniqueConstraint extends BaseConstraint {
|
|
43
|
+
enum: 'UNIQUE';
|
|
44
|
+
is_primary_key: boolean;
|
|
45
|
+
index: LogicalIndex;
|
|
46
|
+
columns: string[];
|
|
47
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _export(target, all) {
|
|
3
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: all[name]
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
_export(exports, {
|
|
9
|
+
ConstraintType: function() {
|
|
10
|
+
return ConstraintType;
|
|
11
|
+
},
|
|
12
|
+
ForeignKeyType: function() {
|
|
13
|
+
return ForeignKeyType;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
var ConstraintType;
|
|
17
|
+
(function(ConstraintType) {
|
|
18
|
+
ConstraintType["INVALID"] = "INVALID";
|
|
19
|
+
ConstraintType["NOT_NULL"] = "NOT_NULL";
|
|
20
|
+
ConstraintType["CHECK"] = "CHECK";
|
|
21
|
+
ConstraintType["UNIQUE"] = "UNIQUE";
|
|
22
|
+
ConstraintType["FOREIGN_KEY"] = "FOREIGN_KEY";
|
|
23
|
+
})(ConstraintType || (ConstraintType = {}));
|
|
24
|
+
var ForeignKeyType;
|
|
25
|
+
(function(ForeignKeyType) {
|
|
26
|
+
ForeignKeyType["FK_TYPE_PRIMARY_KEY_TABLE"] = "FK_TYPE_PRIMARY_KEY_TABLE";
|
|
27
|
+
ForeignKeyType["FK_TYPE_FOREIGN_KEY_TABLE"] = "FK_TYPE_FOREIGN_KEY_TABLE";
|
|
28
|
+
ForeignKeyType["FK_TYPE_SELF_REFERENCE_TABLE"] = "FK_TYPE_SELF_REFERENCE_TABLE";
|
|
29
|
+
})(ForeignKeyType || (ForeignKeyType = {}));
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=Constraint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../meerkat-core/src/types/duckdb-serialization-types/serialization/Constraint.ts"],"sourcesContent":["import { ParsedExpression } from './ParsedExpression';\n\nexport enum ConstraintType {\n INVALID = 'INVALID',\n NOT_NULL = 'NOT_NULL',\n CHECK = 'CHECK',\n UNIQUE = 'UNIQUE',\n FOREIGN_KEY = 'FOREIGN_KEY',\n}\n\nexport enum ForeignKeyType {\n FK_TYPE_PRIMARY_KEY_TABLE = 'FK_TYPE_PRIMARY_KEY_TABLE',\n FK_TYPE_FOREIGN_KEY_TABLE = 'FK_TYPE_FOREIGN_KEY_TABLE',\n FK_TYPE_SELF_REFERENCE_TABLE = 'FK_TYPE_SELF_REFERENCE_TABLE',\n}\n\nexport interface BaseConstraint {\n type: ConstraintType;\n}\n\nexport type Constraint = NotNullConstraint | CheckConstraint | ForeignKeyConstraint | UniqueConstraint;\n\nexport interface LogicalIndex {\n index: number;\n}\n\nexport interface PhysicalIndex {\n index: number;\n}\n\nexport interface NotNullConstraint extends BaseConstraint {\n enum: 'NOT_NULL';\n index: LogicalIndex;\n}\n\nexport interface CheckConstraint extends BaseConstraint {\n enum: 'CHECK';\n expression: ParsedExpression;\n}\n\nexport interface ForeignKeyConstraint extends BaseConstraint {\n enum: 'FOREIGN_KEY';\n pk_columns: string[];\n fk_columns: string[];\n fk_type: ForeignKeyType;\n schema: string;\n table: string;\n pk_keys: PhysicalIndex[];\n fk_keys: PhysicalIndex[];\n}\n\nexport interface UniqueConstraint extends BaseConstraint {\n enum: 'UNIQUE';\n is_primary_key: boolean;\n index: LogicalIndex;\n columns: string[];\n}\n"],"names":["ConstraintType","INVALID","NOT_NULL","CHECK","UNIQUE","FOREIGN_KEY","ForeignKeyType","FK_TYPE_PRIMARY_KEY_TABLE","FK_TYPE_FOREIGN_KEY_TABLE","FK_TYPE_SELF_REFERENCE_TABLE"],"mappings":";;;;;;;;;;;;;;;IAEO;UAAKA,cAAc;IAAdA,eACVC,aAAAA;IADUD,eAEVE,cAAAA;IAFUF,eAGVG,WAAAA;IAHUH,eAIVI,YAAAA;IAJUJ,eAKVK,iBAAAA;GALUL,mBAAAA;IAQL;UAAKM,cAAc;IAAdA,eACVC,+BAAAA;IADUD,eAEVE,+BAAAA;IAFUF,eAGVG,kCAAAA;GAHUH,mBAAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Constraint } from './Constraint';
|
|
2
|
+
import { MacroFunction } from './MacroFunction';
|
|
3
|
+
import { Value } from './Misc';
|
|
4
|
+
import { ColumnList, LogicalType } from './Nodes';
|
|
5
|
+
import { ParsedExpression } from './ParsedExpression';
|
|
6
|
+
import { SelectStatement } from './Statement';
|
|
7
|
+
export declare enum OnCreateConflict {
|
|
8
|
+
ERROR_ON_CONFLICT = "ERROR_ON_CONFLICT",
|
|
9
|
+
IGNORE_ON_CONFLICT = "IGNORE_ON_CONFLICT",
|
|
10
|
+
REPLACE_ON_CONFLICT = "REPLACE_ON_CONFLICT",
|
|
11
|
+
ALTER_ON_CONFLICT = "ALTER_ON_CONFLICT"
|
|
12
|
+
}
|
|
13
|
+
export declare enum CatalogType {
|
|
14
|
+
INVALID = "INVALID",
|
|
15
|
+
TABLE_ENTRY = "TABLE_ENTRY",
|
|
16
|
+
SCHEMA_ENTRY = "SCHEMA_ENTRY",
|
|
17
|
+
VIEW_ENTRY = "VIEW_ENTRY",
|
|
18
|
+
INDEX_ENTRY = "INDEX_ENTRY",
|
|
19
|
+
PREPARED_STATEMENT = "PREPARED_STATEMENT",
|
|
20
|
+
SEQUENCE_ENTRY = "SEQUENCE_ENTRY",
|
|
21
|
+
COLLATION_ENTRY = "COLLATION_ENTRY",
|
|
22
|
+
TYPE_ENTRY = "TYPE_ENTRY",
|
|
23
|
+
DATABASE_ENTRY = "DATABASE_ENTRY",
|
|
24
|
+
TABLE_FUNCTION_ENTRY = "TABLE_FUNCTION_ENTRY",
|
|
25
|
+
SCALAR_FUNCTION_ENTRY = "SCALAR_FUNCTION_ENTRY",
|
|
26
|
+
AGGREGATE_FUNCTION_ENTRY = "AGGREGATE_FUNCTION_ENTRY",
|
|
27
|
+
PRAGMA_FUNCTION_ENTRY = "PRAGMA_FUNCTION_ENTRY",
|
|
28
|
+
COPY_FUNCTION_ENTRY = "COPY_FUNCTION_ENTRY",
|
|
29
|
+
MACRO_ENTRY = "MACRO_ENTRY",
|
|
30
|
+
TABLE_MACRO_ENTRY = "TABLE_MACRO_ENTRY",
|
|
31
|
+
UPDATED_ENTRY = "UPDATED_ENTRY",
|
|
32
|
+
DELETED_ENTRY = "DELETED_ENTRY"
|
|
33
|
+
}
|
|
34
|
+
export interface BaseCreateInfo {
|
|
35
|
+
type: CatalogType;
|
|
36
|
+
catalog: string;
|
|
37
|
+
schema: string;
|
|
38
|
+
temporary: boolean;
|
|
39
|
+
internal: boolean;
|
|
40
|
+
on_conflict: OnCreateConflict;
|
|
41
|
+
sql: string;
|
|
42
|
+
}
|
|
43
|
+
export type CreateInfo = CreateIndexInfo | CreateTableInfo | CreateSchemaInfo | CreateViewInfo | CreateTypeInfo | CreateMacroInfo | CreateSequenceInfo;
|
|
44
|
+
export declare enum IndexType {
|
|
45
|
+
INVALID = "INVALID",
|
|
46
|
+
ART = "ART",
|
|
47
|
+
EXTENSION = "EXTENSION"
|
|
48
|
+
}
|
|
49
|
+
export declare enum IndexConstraintType {
|
|
50
|
+
NONE = "NONE",
|
|
51
|
+
UNIQUE = "UNIQUE",
|
|
52
|
+
PRIMARY = "PRIMARY",
|
|
53
|
+
FOREIGN = "FOREIGN"
|
|
54
|
+
}
|
|
55
|
+
export interface CreateIndexInfo extends BaseCreateInfo {
|
|
56
|
+
name: string;
|
|
57
|
+
table: string;
|
|
58
|
+
index_type: IndexType;
|
|
59
|
+
constraint_type: IndexConstraintType;
|
|
60
|
+
parsed_expressions: ParsedExpression[];
|
|
61
|
+
names: string[];
|
|
62
|
+
column_ids: number[];
|
|
63
|
+
options: Record<string, Value>;
|
|
64
|
+
index_type_name: string;
|
|
65
|
+
}
|
|
66
|
+
export interface CreateTableInfo extends BaseCreateInfo {
|
|
67
|
+
table: string;
|
|
68
|
+
columns: ColumnList;
|
|
69
|
+
constraints: Constraint[];
|
|
70
|
+
query?: SelectStatement;
|
|
71
|
+
}
|
|
72
|
+
export type CreateSchemaInfo = BaseCreateInfo;
|
|
73
|
+
export interface CreateViewInfo extends BaseCreateInfo {
|
|
74
|
+
view_name: string;
|
|
75
|
+
aliases: string[];
|
|
76
|
+
types: LogicalType[];
|
|
77
|
+
query?: SelectStatement;
|
|
78
|
+
}
|
|
79
|
+
export interface CreateTypeInfo extends BaseCreateInfo {
|
|
80
|
+
name: string;
|
|
81
|
+
logical_type: LogicalType;
|
|
82
|
+
}
|
|
83
|
+
export interface CreateMacroInfo extends BaseCreateInfo {
|
|
84
|
+
name: string;
|
|
85
|
+
function: MacroFunction;
|
|
86
|
+
}
|
|
87
|
+
export interface CreateSequenceInfo extends BaseCreateInfo {
|
|
88
|
+
name: string;
|
|
89
|
+
usage_count: number;
|
|
90
|
+
increment: number;
|
|
91
|
+
min_value: number;
|
|
92
|
+
max_value: number;
|
|
93
|
+
start_value: number;
|
|
94
|
+
cycle: boolean;
|
|
95
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _export(target, all) {
|
|
3
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: all[name]
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
_export(exports, {
|
|
9
|
+
OnCreateConflict: function() {
|
|
10
|
+
return OnCreateConflict;
|
|
11
|
+
},
|
|
12
|
+
CatalogType: function() {
|
|
13
|
+
return CatalogType;
|
|
14
|
+
},
|
|
15
|
+
IndexType: function() {
|
|
16
|
+
return IndexType;
|
|
17
|
+
},
|
|
18
|
+
IndexConstraintType: function() {
|
|
19
|
+
return IndexConstraintType;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var OnCreateConflict;
|
|
23
|
+
(function(OnCreateConflict) {
|
|
24
|
+
OnCreateConflict["ERROR_ON_CONFLICT"] = "ERROR_ON_CONFLICT";
|
|
25
|
+
OnCreateConflict["IGNORE_ON_CONFLICT"] = "IGNORE_ON_CONFLICT";
|
|
26
|
+
OnCreateConflict["REPLACE_ON_CONFLICT"] = "REPLACE_ON_CONFLICT";
|
|
27
|
+
OnCreateConflict["ALTER_ON_CONFLICT"] = "ALTER_ON_CONFLICT";
|
|
28
|
+
})(OnCreateConflict || (OnCreateConflict = {}));
|
|
29
|
+
var CatalogType;
|
|
30
|
+
(function(CatalogType) {
|
|
31
|
+
CatalogType["INVALID"] = "INVALID";
|
|
32
|
+
CatalogType["TABLE_ENTRY"] = "TABLE_ENTRY";
|
|
33
|
+
CatalogType["SCHEMA_ENTRY"] = "SCHEMA_ENTRY";
|
|
34
|
+
CatalogType["VIEW_ENTRY"] = "VIEW_ENTRY";
|
|
35
|
+
CatalogType["INDEX_ENTRY"] = "INDEX_ENTRY";
|
|
36
|
+
CatalogType["PREPARED_STATEMENT"] = "PREPARED_STATEMENT";
|
|
37
|
+
CatalogType["SEQUENCE_ENTRY"] = "SEQUENCE_ENTRY";
|
|
38
|
+
CatalogType["COLLATION_ENTRY"] = "COLLATION_ENTRY";
|
|
39
|
+
CatalogType["TYPE_ENTRY"] = "TYPE_ENTRY";
|
|
40
|
+
CatalogType["DATABASE_ENTRY"] = "DATABASE_ENTRY";
|
|
41
|
+
CatalogType[// functions
|
|
42
|
+
"TABLE_FUNCTION_ENTRY"] = "TABLE_FUNCTION_ENTRY";
|
|
43
|
+
CatalogType["SCALAR_FUNCTION_ENTRY"] = "SCALAR_FUNCTION_ENTRY";
|
|
44
|
+
CatalogType["AGGREGATE_FUNCTION_ENTRY"] = "AGGREGATE_FUNCTION_ENTRY";
|
|
45
|
+
CatalogType["PRAGMA_FUNCTION_ENTRY"] = "PRAGMA_FUNCTION_ENTRY";
|
|
46
|
+
CatalogType["COPY_FUNCTION_ENTRY"] = "COPY_FUNCTION_ENTRY";
|
|
47
|
+
CatalogType["MACRO_ENTRY"] = "MACRO_ENTRY";
|
|
48
|
+
CatalogType["TABLE_MACRO_ENTRY"] = "TABLE_MACRO_ENTRY";
|
|
49
|
+
CatalogType[// version info
|
|
50
|
+
"UPDATED_ENTRY"] = "UPDATED_ENTRY";
|
|
51
|
+
CatalogType["DELETED_ENTRY"] = "DELETED_ENTRY";
|
|
52
|
+
})(CatalogType || (CatalogType = {}));
|
|
53
|
+
var IndexType;
|
|
54
|
+
(function(IndexType) {
|
|
55
|
+
IndexType["INVALID"] = "INVALID";
|
|
56
|
+
IndexType["ART"] = "ART";
|
|
57
|
+
IndexType["EXTENSION"] = "EXTENSION";
|
|
58
|
+
})(IndexType || (IndexType = {}));
|
|
59
|
+
var IndexConstraintType;
|
|
60
|
+
(function(IndexConstraintType) {
|
|
61
|
+
IndexConstraintType["NONE"] = "NONE";
|
|
62
|
+
IndexConstraintType["UNIQUE"] = "UNIQUE";
|
|
63
|
+
IndexConstraintType["PRIMARY"] = "PRIMARY";
|
|
64
|
+
IndexConstraintType["FOREIGN"] = "FOREIGN";
|
|
65
|
+
})(IndexConstraintType || (IndexConstraintType = {}));
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=CreateInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../meerkat-core/src/types/duckdb-serialization-types/serialization/CreateInfo.ts"],"sourcesContent":["import { Constraint } from './Constraint';\nimport { MacroFunction } from './MacroFunction';\nimport { Value } from './Misc';\nimport { ColumnList, LogicalType } from './Nodes';\nimport { ParsedExpression } from './ParsedExpression';\nimport { SelectStatement } from './Statement';\n\nexport enum OnCreateConflict {\n ERROR_ON_CONFLICT = 'ERROR_ON_CONFLICT',\n IGNORE_ON_CONFLICT = 'IGNORE_ON_CONFLICT',\n REPLACE_ON_CONFLICT = 'REPLACE_ON_CONFLICT',\n ALTER_ON_CONFLICT = 'ALTER_ON_CONFLICT',\n}\n\nexport enum CatalogType {\n INVALID = 'INVALID',\n TABLE_ENTRY = 'TABLE_ENTRY',\n SCHEMA_ENTRY = 'SCHEMA_ENTRY',\n VIEW_ENTRY = 'VIEW_ENTRY',\n INDEX_ENTRY = 'INDEX_ENTRY',\n PREPARED_STATEMENT = 'PREPARED_STATEMENT',\n SEQUENCE_ENTRY = 'SEQUENCE_ENTRY',\n COLLATION_ENTRY = 'COLLATION_ENTRY',\n TYPE_ENTRY = 'TYPE_ENTRY',\n DATABASE_ENTRY = 'DATABASE_ENTRY',\n\n // functions\n TABLE_FUNCTION_ENTRY = 'TABLE_FUNCTION_ENTRY',\n SCALAR_FUNCTION_ENTRY = 'SCALAR_FUNCTION_ENTRY',\n AGGREGATE_FUNCTION_ENTRY = 'AGGREGATE_FUNCTION_ENTRY',\n PRAGMA_FUNCTION_ENTRY = 'PRAGMA_FUNCTION_ENTRY',\n COPY_FUNCTION_ENTRY = 'COPY_FUNCTION_ENTRY',\n MACRO_ENTRY = 'MACRO_ENTRY',\n TABLE_MACRO_ENTRY = 'TABLE_MACRO_ENTRY',\n\n // version info\n UPDATED_ENTRY = 'UPDATED_ENTRY',\n DELETED_ENTRY = 'DELETED_ENTRY',\n}\n\nexport interface BaseCreateInfo {\n type: CatalogType;\n catalog: string;\n schema: string;\n temporary: boolean;\n internal: boolean;\n on_conflict: OnCreateConflict;\n sql: string;\n}\n\nexport type CreateInfo =\n | CreateIndexInfo\n | CreateTableInfo\n | CreateSchemaInfo\n | CreateViewInfo\n | CreateTypeInfo\n | CreateMacroInfo\n | CreateSequenceInfo;\n\nexport enum IndexType {\n INVALID = 'INVALID',\n ART = 'ART',\n EXTENSION = 'EXTENSION',\n}\n\nexport enum IndexConstraintType {\n NONE = 'NONE',\n UNIQUE = 'UNIQUE',\n PRIMARY = 'PRIMARY',\n FOREIGN = 'FOREIGN',\n}\n\nexport interface CreateIndexInfo extends BaseCreateInfo {\n name: string;\n table: string;\n index_type: IndexType;\n constraint_type: IndexConstraintType;\n parsed_expressions: ParsedExpression[];\n names: string[];\n column_ids: number[];\n options: Record<string, Value>;\n index_type_name: string;\n}\n\nexport interface CreateTableInfo extends BaseCreateInfo {\n table: string;\n columns: ColumnList;\n constraints: Constraint[];\n query?: SelectStatement;\n}\n\nexport type CreateSchemaInfo = BaseCreateInfo\n\nexport interface CreateViewInfo extends BaseCreateInfo {\n view_name: string;\n aliases: string[];\n types: LogicalType[];\n query?: SelectStatement;\n}\n\nexport interface CreateTypeInfo extends BaseCreateInfo {\n name: string;\n logical_type: LogicalType;\n}\n\nexport interface CreateMacroInfo extends BaseCreateInfo {\n name: string;\n function: MacroFunction;\n}\n\nexport interface CreateSequenceInfo extends BaseCreateInfo {\n name: string;\n usage_count: number;\n increment: number;\n min_value: number;\n max_value: number;\n start_value: number;\n cycle: boolean;\n}\n"],"names":["OnCreateConflict","ERROR_ON_CONFLICT","IGNORE_ON_CONFLICT","REPLACE_ON_CONFLICT","ALTER_ON_CONFLICT","CatalogType","INVALID","TABLE_ENTRY","SCHEMA_ENTRY","VIEW_ENTRY","INDEX_ENTRY","PREPARED_STATEMENT","SEQUENCE_ENTRY","COLLATION_ENTRY","TYPE_ENTRY","DATABASE_ENTRY","TABLE_FUNCTION_ENTRY","SCALAR_FUNCTION_ENTRY","AGGREGATE_FUNCTION_ENTRY","PRAGMA_FUNCTION_ENTRY","COPY_FUNCTION_ENTRY","MACRO_ENTRY","TABLE_MACRO_ENTRY","UPDATED_ENTRY","DELETED_ENTRY","IndexType","ART","EXTENSION","IndexConstraintType","NONE","UNIQUE","PRIMARY","FOREIGN"],"mappings":";;;;;;;;;;;;;;;;;;;;;IAOO;UAAKA,gBAAgB;IAAhBA,iBACVC,uBAAAA;IADUD,iBAEVE,wBAAAA;IAFUF,iBAGVG,yBAAAA;IAHUH,iBAIVI,uBAAAA;GAJUJ,qBAAAA;IAOL;UAAKK,WAAW;IAAXA,YACVC,aAAAA;IADUD,YAEVE,iBAAAA;IAFUF,YAGVG,kBAAAA;IAHUH,YAIVI,gBAAAA;IAJUJ,YAKVK,iBAAAA;IALUL,YAMVM,wBAAAA;IANUN,YAOVO,oBAAAA;IAPUP,YAQVQ,qBAAAA;IARUR,YASVS,gBAAAA;IATUT,YAUVU,oBAAAA;IAVUV,YAYV,YAAY;IACZW,0BAAAA;IAbUX,YAcVY,2BAAAA;IAdUZ,YAeVa,8BAAAA;IAfUb,YAgBVc,2BAAAA;IAhBUd,YAiBVe,yBAAAA;IAjBUf,YAkBVgB,iBAAAA;IAlBUhB,YAmBViB,uBAAAA;IAnBUjB,YAqBV,eAAe;IACfkB,mBAAAA;IAtBUlB,YAuBVmB,mBAAAA;GAvBUnB,gBAAAA;IA6CL;UAAKoB,SAAS;IAATA,UACVnB,aAAAA;IADUmB,UAEVC,SAAAA;IAFUD,UAGVE,eAAAA;GAHUF,cAAAA;IAML;UAAKG,mBAAmB;IAAnBA,oBACVC,UAAAA;IADUD,oBAEVE,YAAAA;IAFUF,oBAGVG,aAAAA;IAHUH,oBAIVI,aAAAA;GAJUJ,wBAAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../meerkat-core/src/types/duckdb-serialization-types/serialization/Expression.d.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Value } from './Misc';
|
|
2
|
+
import { BoundCaseCheck, BoundParameterData, ColumnBinding, LogicalType } from './Nodes';
|
|
3
|
+
export declare enum ExpressionType {
|
|
4
|
+
INVALID = "INVALID",
|
|
5
|
+
OPERATOR_CAST = "OPERATOR_CAST",
|
|
6
|
+
OPERATOR_NOT = "OPERATOR_NOT",
|
|
7
|
+
OPERATOR_IS_NULL = "OPERATOR_IS_NULL",
|
|
8
|
+
OPERATOR_IS_NOT_NULL = "OPERATOR_IS_NOT_NULL",
|
|
9
|
+
COMPARE_EQUAL = "COMPARE_EQUAL",
|
|
10
|
+
COMPARE_BOUNDARY_START = "COMPARE_BOUNDARY_START",
|
|
11
|
+
COMPARE_NOTEQUAL = "COMPARE_NOTEQUAL",
|
|
12
|
+
COMPARE_LESSTHAN = "COMPARE_LESSTHAN",
|
|
13
|
+
COMPARE_GREATERTHAN = "COMPARE_GREATERTHAN",
|
|
14
|
+
COMPARE_LESSTHANOREQUALTO = "COMPARE_LESSTHANOREQUALTO",
|
|
15
|
+
COMPARE_GREATERTHANOREQUALTO = "COMPARE_GREATERTHANOREQUALTO",
|
|
16
|
+
COMPARE_IN = "COMPARE_IN",
|
|
17
|
+
COMPARE_NOT_IN = "COMPARE_NOT_IN",
|
|
18
|
+
COMPARE_DISTINCT_FROM = "COMPARE_DISTINCT_FROM",
|
|
19
|
+
COMPARE_BETWEEN = "COMPARE_BETWEEN",
|
|
20
|
+
COMPARE_NOT_BETWEEN = "COMPARE_NOT_BETWEEN",
|
|
21
|
+
COMPARE_NOT_DISTINCT_FROM = "COMPARE_NOT_DISTINCT_FROM",
|
|
22
|
+
COMPARE_BOUNDARY_END = "COMPARE_BOUNDARY_END",
|
|
23
|
+
CONJUNCTION_AND = "CONJUNCTION_AND",
|
|
24
|
+
CONJUNCTION_OR = "CONJUNCTION_OR",
|
|
25
|
+
VALUE_CONSTANT = "VALUE_CONSTANT",
|
|
26
|
+
VALUE_PARAMETER = "VALUE_PARAMETER",
|
|
27
|
+
VALUE_TUPLE = "VALUE_TUPLE",
|
|
28
|
+
VALUE_TUPLE_ADDRESS = "VALUE_TUPLE_ADDRESS",
|
|
29
|
+
VALUE_NULL = "VALUE_NULL",
|
|
30
|
+
VALUE_VECTOR = "VALUE_VECTOR",
|
|
31
|
+
VALUE_SCALAR = "VALUE_SCALAR",
|
|
32
|
+
VALUE_DEFAULT = "VALUE_DEFAULT",
|
|
33
|
+
AGGREGATE = "AGGREGATE",
|
|
34
|
+
BOUND_AGGREGATE = "BOUND_AGGREGATE",
|
|
35
|
+
GROUPING_FUNCTION = "GROUPING_FUNCTION",
|
|
36
|
+
WINDOW_AGGREGATE = "WINDOW_AGGREGATE",
|
|
37
|
+
WINDOW_RANK = "WINDOW_RANK",
|
|
38
|
+
WINDOW_RANK_DENSE = "WINDOW_RANK_DENSE",
|
|
39
|
+
WINDOW_NTILE = "WINDOW_NTILE",
|
|
40
|
+
WINDOW_PERCENT_RANK = "WINDOW_PERCENT_RANK",
|
|
41
|
+
WINDOW_CUME_DIST = "WINDOW_CUME_DIST",
|
|
42
|
+
WINDOW_ROW_NUMBER = "WINDOW_ROW_NUMBER",
|
|
43
|
+
WINDOW_FIRST_VALUE = "WINDOW_FIRST_VALUE",
|
|
44
|
+
WINDOW_LAST_VALUE = "WINDOW_LAST_VALUE",
|
|
45
|
+
WINDOW_LEAD = "WINDOW_LEAD",
|
|
46
|
+
WINDOW_LAG = "WINDOW_LAG",
|
|
47
|
+
WINDOW_NTH_VALUE = "WINDOW_NTH_VALUE",
|
|
48
|
+
FUNCTION = "FUNCTION",
|
|
49
|
+
BOUND_FUNCTION = "BOUND_FUNCTION",
|
|
50
|
+
CASE_EXPR = "CASE_EXPR",
|
|
51
|
+
OPERATOR_NULLIF = "OPERATOR_NULLIF",
|
|
52
|
+
OPERATOR_COALESCE = "OPERATOR_COALESCE",
|
|
53
|
+
ARRAY_EXTRACT = "ARRAY_EXTRACT",
|
|
54
|
+
ARRAY_SLICE = "ARRAY_SLICE",
|
|
55
|
+
STRUCT_EXTRACT = "STRUCT_EXTRACT",
|
|
56
|
+
ARRAY_CONSTRUCTOR = "ARRAY_CONSTRUCTOR",
|
|
57
|
+
ARROW = "ARROW",
|
|
58
|
+
SUBQUERY = "SUBQUERY",
|
|
59
|
+
STAR = "STAR",
|
|
60
|
+
TABLE_STAR = "TABLE_STAR",
|
|
61
|
+
PLACEHOLDER = "PLACEHOLDER",
|
|
62
|
+
COLUMN_REF = "COLUMN_REF",
|
|
63
|
+
FUNCTION_REF = "FUNCTION_REF",
|
|
64
|
+
TABLE_REF = "TABLE_REF",
|
|
65
|
+
CAST = "CAST",
|
|
66
|
+
BOUND_REF = "BOUND_REF",
|
|
67
|
+
BOUND_COLUMN_REF = "BOUND_COLUMN_REF",
|
|
68
|
+
BOUND_UNNEST = "BOUND_UNNEST",
|
|
69
|
+
COLLATE = "COLLATE",
|
|
70
|
+
LAMBDA = "LAMBDA",
|
|
71
|
+
POSITIONAL_REFERENCE = "POSITIONAL_REFERENCE",
|
|
72
|
+
BOUND_LAMBDA_REF = "BOUND_LAMBDA_REF"
|
|
73
|
+
}
|
|
74
|
+
export declare enum ExpressionClass {
|
|
75
|
+
INVALID = "INVALID",
|
|
76
|
+
AGGREGATE = "AGGREGATE",
|
|
77
|
+
CASE = "CASE",
|
|
78
|
+
CAST = "CAST",
|
|
79
|
+
COLUMN_REF = "COLUMN_REF",
|
|
80
|
+
COMPARISON = "COMPARISON",
|
|
81
|
+
CONJUNCTION = "CONJUNCTION",
|
|
82
|
+
CONSTANT = "CONSTANT",
|
|
83
|
+
DEFAULT = "DEFAULT",
|
|
84
|
+
FUNCTION = "FUNCTION",
|
|
85
|
+
OPERATOR = "OPERATOR",
|
|
86
|
+
STAR = "STAR",
|
|
87
|
+
SUBQUERY = "SUBQUERY",
|
|
88
|
+
WINDOW = "WINDOW",
|
|
89
|
+
PARAMETER = "PARAMETER",
|
|
90
|
+
COLLATE = "COLLATE",
|
|
91
|
+
LAMBDA = "LAMBDA",
|
|
92
|
+
POSITIONAL_REFERENCE = "POSITIONAL_REFERENCE",
|
|
93
|
+
BETWEEN = "BETWEEN",
|
|
94
|
+
BOUND_AGGREGATE = "BOUND_AGGREGATE",
|
|
95
|
+
BOUND_CASE = "BOUND_CASE",
|
|
96
|
+
BOUND_CAST = "BOUND_CAST",
|
|
97
|
+
BOUND_COLUMN_REF = "BOUND_COLUMN_REF",
|
|
98
|
+
BOUND_COMPARISON = "BOUND_COMPARISON",
|
|
99
|
+
BOUND_CONJUNCTION = "BOUND_CONJUNCTION",
|
|
100
|
+
BOUND_CONSTANT = "BOUND_CONSTANT",
|
|
101
|
+
BOUND_DEFAULT = "BOUND_DEFAULT",
|
|
102
|
+
BOUND_FUNCTION = "BOUND_FUNCTION",
|
|
103
|
+
BOUND_OPERATOR = "BOUND_OPERATOR",
|
|
104
|
+
BOUND_PARAMETER = "BOUND_PARAMETER",
|
|
105
|
+
BOUND_REF = "BOUND_REF",
|
|
106
|
+
BOUND_SUBQUERY = "BOUND_SUBQUERY",
|
|
107
|
+
BOUND_WINDOW = "BOUND_WINDOW",
|
|
108
|
+
BOUND_BETWEEN = "BOUND_BETWEEN",
|
|
109
|
+
BOUND_UNNEST = "BOUND_UNNEST",
|
|
110
|
+
BOUND_LAMBDA = "BOUND_LAMBDA",
|
|
111
|
+
BOUND_LAMBDA_REF = "BOUND_LAMBDA_REF",
|
|
112
|
+
BOUND_EXPRESSION = "BOUND_EXPRESSION"
|
|
113
|
+
}
|
|
114
|
+
export interface BaseExpression {
|
|
115
|
+
expression_class: ExpressionClass;
|
|
116
|
+
type: ExpressionType;
|
|
117
|
+
alias: string;
|
|
118
|
+
}
|
|
119
|
+
export type Expression = BoundBetweenExpression | BoundCaseExpression | BoundCastExpression | BoundColumnRefExpression | BoundComparisonExpression | BoundConjunctionExpression | BoundConstantExpression | BoundDefaultExpression | BoundLambdaExpression | BoundLambdaRefExpression | BoundOperatorExpression | BoundParameterExpression | BoundReferenceExpression | BoundUnnestExpression | BoundFunctionExpression | BoundAggregateExpression | BoundWindowExpression;
|
|
120
|
+
export interface BoundBetweenExpression extends BaseExpression {
|
|
121
|
+
input: Expression;
|
|
122
|
+
lower: Expression;
|
|
123
|
+
upper: Expression;
|
|
124
|
+
lower_inclusive: boolean;
|
|
125
|
+
upper_inclusive: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface BoundCaseExpression extends BaseExpression {
|
|
128
|
+
return_type: LogicalType;
|
|
129
|
+
case_checks: BoundCaseCheck[];
|
|
130
|
+
else_expr: Expression;
|
|
131
|
+
}
|
|
132
|
+
export interface BoundCastExpression extends BaseExpression {
|
|
133
|
+
child: Expression;
|
|
134
|
+
return_type: LogicalType;
|
|
135
|
+
try_cast: boolean;
|
|
136
|
+
}
|
|
137
|
+
export interface BoundColumnRefExpression extends BaseExpression {
|
|
138
|
+
return_type: LogicalType;
|
|
139
|
+
binding: ColumnBinding;
|
|
140
|
+
depth: number;
|
|
141
|
+
}
|
|
142
|
+
export interface BoundComparisonExpression extends BaseExpression {
|
|
143
|
+
left: Expression;
|
|
144
|
+
right: Expression;
|
|
145
|
+
}
|
|
146
|
+
export interface BoundConjunctionExpression extends BaseExpression {
|
|
147
|
+
children: Expression[];
|
|
148
|
+
}
|
|
149
|
+
export interface BoundConstantExpression extends BaseExpression {
|
|
150
|
+
value: Value;
|
|
151
|
+
}
|
|
152
|
+
export interface BoundDefaultExpression extends BaseExpression {
|
|
153
|
+
return_type: LogicalType;
|
|
154
|
+
}
|
|
155
|
+
export interface BoundLambdaExpression extends BaseExpression {
|
|
156
|
+
return_type: LogicalType;
|
|
157
|
+
lambda_expr: Expression;
|
|
158
|
+
captures: Expression[];
|
|
159
|
+
parameter_count: number;
|
|
160
|
+
}
|
|
161
|
+
export interface BoundLambdaRefExpression extends BaseExpression {
|
|
162
|
+
return_type: LogicalType;
|
|
163
|
+
binding: ColumnBinding;
|
|
164
|
+
lambda_index: number;
|
|
165
|
+
depth: number;
|
|
166
|
+
}
|
|
167
|
+
export interface BoundOperatorExpression extends BaseExpression {
|
|
168
|
+
return_type: LogicalType;
|
|
169
|
+
children: Expression[];
|
|
170
|
+
}
|
|
171
|
+
export interface BoundParameterExpression extends BaseExpression {
|
|
172
|
+
identifier: string;
|
|
173
|
+
return_type: LogicalType;
|
|
174
|
+
parameter_data: BoundParameterData;
|
|
175
|
+
}
|
|
176
|
+
export interface BoundReferenceExpression extends BaseExpression {
|
|
177
|
+
return_type: LogicalType;
|
|
178
|
+
index: number;
|
|
179
|
+
}
|
|
180
|
+
export interface BoundUnnestExpression extends BaseExpression {
|
|
181
|
+
return_type: LogicalType;
|
|
182
|
+
child: Expression;
|
|
183
|
+
}
|
|
184
|
+
export type BoundFunctionExpression = BaseExpression;
|
|
185
|
+
export type BoundAggregateExpression = BaseExpression;
|
|
186
|
+
export type BoundWindowExpression = BaseExpression;
|