@questdb/sql-parser 0.1.3 → 0.1.4

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/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## 0.1.4 - 2026.03.17
5
+ ### Added
6
+ - Compound JOIN suggestions: suggest "LEFT JOIN", "ASOF JOIN" etc. as single completions instead of bare keywords [#13](https://github.com/questdb/sql-parser/pull/13)
7
+ - CTE grammar: extract `selectBody` rule so DECLARE/WITH are not suggested after WITH clause [#13](https://github.com/questdb/sql-parser/pull/13)
8
+
9
+ ### Fixed
10
+ - Table suggestion ranking: tables no longer interleave with columns in autocomplete [#13](https://github.com/questdb/sql-parser/pull/13)
11
+
12
+
4
13
  ## 0.1.3 - 2026.03.04
5
14
  ### Added
6
15
  - horizon join support [#9](https://github.com/questdb/sql-parser/pull/9)
package/dist/index.cjs CHANGED
@@ -1275,9 +1275,8 @@ var QuestDBParser = class extends import_chevrotain3.CstParser {
1275
1275
  ALT: () => this.SUBRULE(this.updateStatement)
1276
1276
  },
1277
1277
  {
1278
- // SELECT: delegate to selectStatement (its optional declareClause/
1279
- // withClause simply won't match since WITH was already consumed)
1280
- ALT: () => this.SUBRULE(this.selectStatement)
1278
+ // SELECT after WITH: no DECLARE/WITH prefixes allowed here
1279
+ ALT: () => this.SUBRULE(this.selectBody)
1281
1280
  }
1282
1281
  ]);
1283
1282
  });
@@ -1287,6 +1286,9 @@ var QuestDBParser = class extends import_chevrotain3.CstParser {
1287
1286
  this.selectStatement = this.RULE("selectStatement", () => {
1288
1287
  this.OPTION(() => this.SUBRULE(this.declareClause));
1289
1288
  this.OPTION2(() => this.SUBRULE(this.withClause));
1289
+ this.SUBRULE(this.selectBody);
1290
+ });
1291
+ this.selectBody = this.RULE("selectBody", () => {
1290
1292
  this.SUBRULE(this.simpleSelect);
1291
1293
  this.MANY(() => {
1292
1294
  this.SUBRULE(this.setOperation);
@@ -1655,17 +1657,13 @@ var QuestDBParser = class extends import_chevrotain3.CstParser {
1655
1657
  { ALT: () => this.CONSUME(NumberLiteral) }
1656
1658
  ]);
1657
1659
  });
1658
- // Standard joins: (INNER | LEFT [OUTER] | RIGHT [OUTER] | FULL [OUTER] | CROSS)? JOIN + ON
1660
+ // Standard joins: (INNER | LEFT [OUTER] | CROSS)? JOIN + ON
1659
1661
  this.standardJoin = this.RULE("standardJoin", () => {
1660
1662
  this.OPTION(() => {
1661
1663
  this.OR([
1662
1664
  {
1663
1665
  ALT: () => {
1664
- this.OR1([
1665
- { ALT: () => this.CONSUME(Left) },
1666
- { ALT: () => this.CONSUME(Right) },
1667
- { ALT: () => this.CONSUME(Full) }
1668
- ]);
1666
+ this.CONSUME(Left);
1669
1667
  this.OPTION1(() => this.CONSUME(Outer));
1670
1668
  }
1671
1669
  },
@@ -4796,8 +4794,8 @@ var QuestDBVisitor = class extends BaseVisitor {
4796
4794
  inner = this.visit(ctx.insertStatement);
4797
4795
  } else if (ctx.updateStatement) {
4798
4796
  inner = this.visit(ctx.updateStatement);
4799
- } else if (ctx.selectStatement) {
4800
- inner = this.visit(ctx.selectStatement);
4797
+ } else if (ctx.selectBody) {
4798
+ inner = this.visit(ctx.selectBody);
4801
4799
  } else {
4802
4800
  throw new Error("withStatement: expected insert, update, or select");
4803
4801
  }
@@ -4808,13 +4806,17 @@ var QuestDBVisitor = class extends BaseVisitor {
4808
4806
  // SELECT Statement
4809
4807
  // ==========================================================================
4810
4808
  selectStatement(ctx) {
4811
- const result = this.visit(ctx.simpleSelect);
4809
+ const result = this.visit(ctx.selectBody);
4812
4810
  if (ctx.declareClause) {
4813
4811
  result.declare = this.visit(ctx.declareClause);
4814
4812
  }
4815
4813
  if (ctx.withClause) {
4816
4814
  result.with = this.visit(ctx.withClause);
4817
4815
  }
4816
+ return result;
4817
+ }
4818
+ selectBody(ctx) {
4819
+ const result = this.visit(ctx.simpleSelect);
4818
4820
  if (ctx.setOperation && ctx.setOperation.length > 0) {
4819
4821
  result.setOperations = ctx.setOperation.map(
4820
4822
  (op) => this.visit(op)
@@ -5160,8 +5162,6 @@ var QuestDBVisitor = class extends BaseVisitor {
5160
5162
  };
5161
5163
  if (ctx.Inner) result.joinType = "inner";
5162
5164
  else if (ctx.Left) result.joinType = "left";
5163
- else if (ctx.Right) result.joinType = "right";
5164
- else if (ctx.Full) result.joinType = "full";
5165
5165
  else if (ctx.Cross) result.joinType = "cross";
5166
5166
  if (ctx.Outer) result.outer = true;
5167
5167
  if (ctx.expression) {
@@ -10299,6 +10299,17 @@ function getAllColumns(schema) {
10299
10299
  }
10300
10300
  return columns;
10301
10301
  }
10302
+ var JOIN_COMPOUND_MAP = /* @__PURE__ */ new Map([
10303
+ ["Left", "LEFT JOIN"],
10304
+ ["Inner", "INNER JOIN"],
10305
+ ["Cross", "CROSS JOIN"],
10306
+ ["Asof", "ASOF JOIN"],
10307
+ ["Lt", "LT JOIN"],
10308
+ ["Splice", "SPLICE JOIN"],
10309
+ ["Window", "WINDOW JOIN"],
10310
+ ["Horizon", "HORIZON JOIN"],
10311
+ ["Outer", "OUTER JOIN"]
10312
+ ]);
10302
10313
  function buildSuggestions(tokenTypes, schema, tablesInScope, options) {
10303
10314
  const suggestions = [];
10304
10315
  const seenKeywords = /* @__PURE__ */ new Set();
@@ -10306,6 +10317,7 @@ function buildSuggestions(tokenTypes, schema, tablesInScope, options) {
10306
10317
  const includeColumns = options?.includeColumns ?? true;
10307
10318
  const includeTables = options?.includeTables ?? true;
10308
10319
  const isMidWord = options?.isMidWord ?? false;
10320
+ const isJoinContext = tokenTypes.some((t) => t.name === "Join");
10309
10321
  for (const tokenType of tokenTypes) {
10310
10322
  const name = tokenType.name;
10311
10323
  if (SKIP_TOKENS.has(name)) {
@@ -10318,6 +10330,19 @@ function buildSuggestions(tokenTypes, schema, tablesInScope, options) {
10318
10330
  if (name === "Identifier" || name === "QuotedIdentifier") {
10319
10331
  continue;
10320
10332
  }
10333
+ if (isJoinContext && JOIN_COMPOUND_MAP.has(name)) {
10334
+ const compound = JOIN_COMPOUND_MAP.get(name);
10335
+ if (seenKeywords.has(compound)) continue;
10336
+ seenKeywords.add(compound);
10337
+ suggestions.push({
10338
+ label: compound,
10339
+ kind: "keyword" /* Keyword */,
10340
+ insertText: compound,
10341
+ filterText: compound.toLowerCase(),
10342
+ priority: 2 /* Medium */
10343
+ });
10344
+ continue;
10345
+ }
10321
10346
  const keyword = tokenNameToKeyword(name);
10322
10347
  if (seenKeywords.has(keyword)) {
10323
10348
  continue;
@@ -10478,7 +10503,7 @@ function rankTableSuggestions(suggestions, referencedColumns, columnIndex) {
10478
10503
  if (s.kind !== "table" /* Table */) continue;
10479
10504
  const score = scores.get(s.label.toLowerCase());
10480
10505
  if (score === void 0) continue;
10481
- s.priority = score === referencedColumns.size ? 1 /* High */ : 2 /* Medium */;
10506
+ s.priority = score === referencedColumns.size ? 2 /* Medium */ : 3 /* MediumLow */;
10482
10507
  }
10483
10508
  }
10484
10509
  function getLastSignificantTokens(tokens) {
package/dist/index.js CHANGED
@@ -1215,9 +1215,8 @@ var QuestDBParser = class extends CstParser {
1215
1215
  ALT: () => this.SUBRULE(this.updateStatement)
1216
1216
  },
1217
1217
  {
1218
- // SELECT: delegate to selectStatement (its optional declareClause/
1219
- // withClause simply won't match since WITH was already consumed)
1220
- ALT: () => this.SUBRULE(this.selectStatement)
1218
+ // SELECT after WITH: no DECLARE/WITH prefixes allowed here
1219
+ ALT: () => this.SUBRULE(this.selectBody)
1221
1220
  }
1222
1221
  ]);
1223
1222
  });
@@ -1227,6 +1226,9 @@ var QuestDBParser = class extends CstParser {
1227
1226
  this.selectStatement = this.RULE("selectStatement", () => {
1228
1227
  this.OPTION(() => this.SUBRULE(this.declareClause));
1229
1228
  this.OPTION2(() => this.SUBRULE(this.withClause));
1229
+ this.SUBRULE(this.selectBody);
1230
+ });
1231
+ this.selectBody = this.RULE("selectBody", () => {
1230
1232
  this.SUBRULE(this.simpleSelect);
1231
1233
  this.MANY(() => {
1232
1234
  this.SUBRULE(this.setOperation);
@@ -1595,17 +1597,13 @@ var QuestDBParser = class extends CstParser {
1595
1597
  { ALT: () => this.CONSUME(NumberLiteral) }
1596
1598
  ]);
1597
1599
  });
1598
- // Standard joins: (INNER | LEFT [OUTER] | RIGHT [OUTER] | FULL [OUTER] | CROSS)? JOIN + ON
1600
+ // Standard joins: (INNER | LEFT [OUTER] | CROSS)? JOIN + ON
1599
1601
  this.standardJoin = this.RULE("standardJoin", () => {
1600
1602
  this.OPTION(() => {
1601
1603
  this.OR([
1602
1604
  {
1603
1605
  ALT: () => {
1604
- this.OR1([
1605
- { ALT: () => this.CONSUME(Left) },
1606
- { ALT: () => this.CONSUME(Right) },
1607
- { ALT: () => this.CONSUME(Full) }
1608
- ]);
1606
+ this.CONSUME(Left);
1609
1607
  this.OPTION1(() => this.CONSUME(Outer));
1610
1608
  }
1611
1609
  },
@@ -4736,8 +4734,8 @@ var QuestDBVisitor = class extends BaseVisitor {
4736
4734
  inner = this.visit(ctx.insertStatement);
4737
4735
  } else if (ctx.updateStatement) {
4738
4736
  inner = this.visit(ctx.updateStatement);
4739
- } else if (ctx.selectStatement) {
4740
- inner = this.visit(ctx.selectStatement);
4737
+ } else if (ctx.selectBody) {
4738
+ inner = this.visit(ctx.selectBody);
4741
4739
  } else {
4742
4740
  throw new Error("withStatement: expected insert, update, or select");
4743
4741
  }
@@ -4748,13 +4746,17 @@ var QuestDBVisitor = class extends BaseVisitor {
4748
4746
  // SELECT Statement
4749
4747
  // ==========================================================================
4750
4748
  selectStatement(ctx) {
4751
- const result = this.visit(ctx.simpleSelect);
4749
+ const result = this.visit(ctx.selectBody);
4752
4750
  if (ctx.declareClause) {
4753
4751
  result.declare = this.visit(ctx.declareClause);
4754
4752
  }
4755
4753
  if (ctx.withClause) {
4756
4754
  result.with = this.visit(ctx.withClause);
4757
4755
  }
4756
+ return result;
4757
+ }
4758
+ selectBody(ctx) {
4759
+ const result = this.visit(ctx.simpleSelect);
4758
4760
  if (ctx.setOperation && ctx.setOperation.length > 0) {
4759
4761
  result.setOperations = ctx.setOperation.map(
4760
4762
  (op) => this.visit(op)
@@ -5100,8 +5102,6 @@ var QuestDBVisitor = class extends BaseVisitor {
5100
5102
  };
5101
5103
  if (ctx.Inner) result.joinType = "inner";
5102
5104
  else if (ctx.Left) result.joinType = "left";
5103
- else if (ctx.Right) result.joinType = "right";
5104
- else if (ctx.Full) result.joinType = "full";
5105
5105
  else if (ctx.Cross) result.joinType = "cross";
5106
5106
  if (ctx.Outer) result.outer = true;
5107
5107
  if (ctx.expression) {
@@ -10239,6 +10239,17 @@ function getAllColumns(schema) {
10239
10239
  }
10240
10240
  return columns;
10241
10241
  }
10242
+ var JOIN_COMPOUND_MAP = /* @__PURE__ */ new Map([
10243
+ ["Left", "LEFT JOIN"],
10244
+ ["Inner", "INNER JOIN"],
10245
+ ["Cross", "CROSS JOIN"],
10246
+ ["Asof", "ASOF JOIN"],
10247
+ ["Lt", "LT JOIN"],
10248
+ ["Splice", "SPLICE JOIN"],
10249
+ ["Window", "WINDOW JOIN"],
10250
+ ["Horizon", "HORIZON JOIN"],
10251
+ ["Outer", "OUTER JOIN"]
10252
+ ]);
10242
10253
  function buildSuggestions(tokenTypes, schema, tablesInScope, options) {
10243
10254
  const suggestions = [];
10244
10255
  const seenKeywords = /* @__PURE__ */ new Set();
@@ -10246,6 +10257,7 @@ function buildSuggestions(tokenTypes, schema, tablesInScope, options) {
10246
10257
  const includeColumns = options?.includeColumns ?? true;
10247
10258
  const includeTables = options?.includeTables ?? true;
10248
10259
  const isMidWord = options?.isMidWord ?? false;
10260
+ const isJoinContext = tokenTypes.some((t) => t.name === "Join");
10249
10261
  for (const tokenType of tokenTypes) {
10250
10262
  const name = tokenType.name;
10251
10263
  if (SKIP_TOKENS.has(name)) {
@@ -10258,6 +10270,19 @@ function buildSuggestions(tokenTypes, schema, tablesInScope, options) {
10258
10270
  if (name === "Identifier" || name === "QuotedIdentifier") {
10259
10271
  continue;
10260
10272
  }
10273
+ if (isJoinContext && JOIN_COMPOUND_MAP.has(name)) {
10274
+ const compound = JOIN_COMPOUND_MAP.get(name);
10275
+ if (seenKeywords.has(compound)) continue;
10276
+ seenKeywords.add(compound);
10277
+ suggestions.push({
10278
+ label: compound,
10279
+ kind: "keyword" /* Keyword */,
10280
+ insertText: compound,
10281
+ filterText: compound.toLowerCase(),
10282
+ priority: 2 /* Medium */
10283
+ });
10284
+ continue;
10285
+ }
10261
10286
  const keyword = tokenNameToKeyword(name);
10262
10287
  if (seenKeywords.has(keyword)) {
10263
10288
  continue;
@@ -10418,7 +10443,7 @@ function rankTableSuggestions(suggestions, referencedColumns, columnIndex) {
10418
10443
  if (s.kind !== "table" /* Table */) continue;
10419
10444
  const score = scores.get(s.label.toLowerCase());
10420
10445
  if (score === void 0) continue;
10421
- s.priority = score === referencedColumns.size ? 1 /* High */ : 2 /* Medium */;
10446
+ s.priority = score === referencedColumns.size ? 2 /* Medium */ : 3 /* MediumLow */;
10422
10447
  }
10423
10448
  }
10424
10449
  function getLastSignificantTokens(tokens) {
@@ -603,7 +603,7 @@ export interface TableRef extends AstNode {
603
603
  }
604
604
  export interface JoinClause extends AstNode {
605
605
  type: "join";
606
- joinType?: "inner" | "left" | "right" | "full" | "cross" | "asof" | "lt" | "splice" | "window" | "horizon";
606
+ joinType?: "inner" | "left" | "cross" | "asof" | "lt" | "splice" | "window" | "horizon";
607
607
  outer?: boolean;
608
608
  table: TableRef;
609
609
  on?: Expression;
@@ -13,6 +13,7 @@ declare class QuestDBParser extends CstParser {
13
13
  statement: import("chevrotain").ParserMethod<[], import("chevrotain").CstNode>;
14
14
  private withStatement;
15
15
  private selectStatement;
16
+ private selectBody;
16
17
  private withClause;
17
18
  private cteDefinition;
18
19
  private simpleSelect;
@@ -1,5 +1,5 @@
1
1
  import * as AST from "./ast";
2
- import type { AddUserStatementCstChildren, AdditiveExpressionCstChildren, AlignToClauseCstChildren, AlterGroupStatementCstChildren, AlterMaterializedViewActionCstChildren, AlterMaterializedViewStatementCstChildren, AlterServiceAccountStatementCstChildren, AlterStatementCstChildren, AlterTableActionCstChildren, AlterTableStatementCstChildren, AlterUserActionCstChildren, AlterUserStatementCstChildren, AlterViewStatementCstChildren, AndExpressionCstChildren, ArrayBracketBodyCstChildren, ArrayElementCstChildren, ArrayLiteralCstChildren, ArraySubscriptCstChildren, AsofLtJoinCstChildren, AssumeServiceAccountStatementCstChildren, BackupStatementCstChildren, BatchClauseCstChildren, BitAndExpressionCstChildren, BitOrExpressionCstChildren, BitXorExpressionCstChildren, BooleanLiteralCstChildren, CancelQueryStatementCstChildren, CaseExpressionCstChildren, CastDefinitionCstChildren, CastExpressionCstChildren, CheckpointStatementCstChildren, ColumnDefinitionCstChildren, ColumnRefCstChildren, CompileViewStatementCstChildren, ConcatExpressionCstChildren, Ipv4ContainmentExpressionCstChildren, ConvertPartitionTargetCstChildren, CopyCancelCstChildren, CopyFromCstChildren, CopyOptionCstChildren, CopyOptionsCstChildren, CopyStatementCstChildren, CopyToCstChildren, CreateGroupStatementCstChildren, CreateMaterializedViewBodyCstChildren, CreateServiceAccountStatementCstChildren, CreateStatementCstChildren, CreateTableBodyCstChildren, CreateUserStatementCstChildren, CreateViewBodyCstChildren, CteDefinitionCstChildren, DataTypeCstChildren, DeclareAssignmentCstChildren, DeclareClauseCstChildren, DedupClauseCstChildren, DropGroupStatementCstChildren, DropMaterializedViewStatementCstChildren, DropServiceAccountStatementCstChildren, DropStatementCstChildren, DropTableStatementCstChildren, DropUserStatementCstChildren, DropViewStatementCstChildren, DurationExpressionCstChildren, EqualityExpressionCstChildren, ExitServiceAccountStatementCstChildren, ExplainStatementCstChildren, ExpressionCstChildren, FillClauseCstChildren, FillValueCstChildren, FromClauseCstChildren, FromToClauseCstChildren, FunctionCallCstChildren, FunctionNameCstChildren, GrantAssumeServiceAccountStatementCstChildren, GrantStatementCstChildren, GrantTableTargetCstChildren, GroupByClauseCstChildren, IdentifierCstChildren, IdentifierExpressionCstChildren, ImplicitSelectBodyCstChildren, ImplicitSelectStatementCstChildren, IndexDefinitionCstChildren, InsertStatementCstChildren, IntervalValueCstChildren, JoinClauseCstChildren, LatestOnClauseCstChildren, LimitClauseCstChildren, LiteralCstChildren, MaterializedViewPartitionCstChildren, MaterializedViewPeriodCstChildren, MaterializedViewRefreshCstChildren, MultiplicativeExpressionCstChildren, NotExpressionCstChildren, OrExpressionCstChildren, OrderByClauseCstChildren, OrderByItemCstChildren, OverClauseCstChildren, PartitionPeriodCstChildren, PermissionListCstChildren, PermissionTokenCstChildren, PivotAggregationCstChildren, PivotBodyCstChildren, PivotForClauseCstChildren, PivotInValueCstChildren, PivotStatementCstChildren, PrimaryExpressionCstChildren, QualifiedNameCstChildren, QualifiedStarCstChildren, ReindexTableStatementCstChildren, RefreshMaterializedViewStatementCstChildren, RelationalExpressionCstChildren, RemoveUserStatementCstChildren, RenameTableStatementCstChildren, ResumeWalStatementCstChildren, RevokeAssumeServiceAccountStatementCstChildren, RevokeStatementCstChildren, SampleByClauseCstChildren, SelectItemCstChildren, SelectListCstChildren, SelectStatementCstChildren, SetClauseCstChildren, SetExpressionCstChildren, SetOperationCstChildren, SetTypeStatementCstChildren, ShowStatementCstChildren, SimpleSelectCstChildren, SnapshotStatementCstChildren, SpliceJoinCstChildren, HorizonJoinCstChildren, HorizonOffsetCstChildren, StandardJoinCstChildren, StatementCstChildren, StatementsCstChildren, StringOrIdentifierCstChildren, StringOrQualifiedNameCstChildren, TableFunctionCallCstChildren, TableFunctionNameCstChildren, TableNameCstChildren, TableNameOrStringCstChildren, TableParamCstChildren, TableParamNameCstChildren, TableRefCstChildren, TimeUnitCstChildren, TimeZoneValueCstChildren, TruncateTableStatementCstChildren, TypeCastExpressionCstChildren, UnaryExpressionCstChildren, UpdateStatementCstChildren, VacuumTableStatementCstChildren, ValuesClauseCstChildren, ValuesListCstChildren, WhereClauseCstChildren, WindowFrameBoundCstChildren, WindowFrameClauseCstChildren, WindowJoinBoundCstChildren, WindowJoinCstChildren, WindowPartitionByClauseCstChildren, WithClauseCstChildren, WithStatementCstChildren } from "./cst-types";
2
+ import type { AddUserStatementCstChildren, AdditiveExpressionCstChildren, AlignToClauseCstChildren, AlterGroupStatementCstChildren, AlterMaterializedViewActionCstChildren, AlterMaterializedViewStatementCstChildren, AlterServiceAccountStatementCstChildren, AlterStatementCstChildren, AlterTableActionCstChildren, AlterTableStatementCstChildren, AlterUserActionCstChildren, AlterUserStatementCstChildren, AlterViewStatementCstChildren, AndExpressionCstChildren, ArrayBracketBodyCstChildren, ArrayElementCstChildren, ArrayLiteralCstChildren, ArraySubscriptCstChildren, AsofLtJoinCstChildren, AssumeServiceAccountStatementCstChildren, BackupStatementCstChildren, BatchClauseCstChildren, BitAndExpressionCstChildren, BitOrExpressionCstChildren, BitXorExpressionCstChildren, BooleanLiteralCstChildren, CancelQueryStatementCstChildren, CaseExpressionCstChildren, CastDefinitionCstChildren, CastExpressionCstChildren, CheckpointStatementCstChildren, ColumnDefinitionCstChildren, ColumnRefCstChildren, CompileViewStatementCstChildren, ConcatExpressionCstChildren, Ipv4ContainmentExpressionCstChildren, ConvertPartitionTargetCstChildren, CopyCancelCstChildren, CopyFromCstChildren, CopyOptionCstChildren, CopyOptionsCstChildren, CopyStatementCstChildren, CopyToCstChildren, CreateGroupStatementCstChildren, CreateMaterializedViewBodyCstChildren, CreateServiceAccountStatementCstChildren, CreateStatementCstChildren, CreateTableBodyCstChildren, CreateUserStatementCstChildren, CreateViewBodyCstChildren, CteDefinitionCstChildren, DataTypeCstChildren, DeclareAssignmentCstChildren, DeclareClauseCstChildren, DedupClauseCstChildren, DropGroupStatementCstChildren, DropMaterializedViewStatementCstChildren, DropServiceAccountStatementCstChildren, DropStatementCstChildren, DropTableStatementCstChildren, DropUserStatementCstChildren, DropViewStatementCstChildren, DurationExpressionCstChildren, EqualityExpressionCstChildren, ExitServiceAccountStatementCstChildren, ExplainStatementCstChildren, ExpressionCstChildren, FillClauseCstChildren, FillValueCstChildren, FromClauseCstChildren, FromToClauseCstChildren, FunctionCallCstChildren, FunctionNameCstChildren, GrantAssumeServiceAccountStatementCstChildren, GrantStatementCstChildren, GrantTableTargetCstChildren, GroupByClauseCstChildren, IdentifierCstChildren, IdentifierExpressionCstChildren, ImplicitSelectBodyCstChildren, ImplicitSelectStatementCstChildren, IndexDefinitionCstChildren, InsertStatementCstChildren, IntervalValueCstChildren, JoinClauseCstChildren, LatestOnClauseCstChildren, LimitClauseCstChildren, LiteralCstChildren, MaterializedViewPartitionCstChildren, MaterializedViewPeriodCstChildren, MaterializedViewRefreshCstChildren, MultiplicativeExpressionCstChildren, NotExpressionCstChildren, OrExpressionCstChildren, OrderByClauseCstChildren, OrderByItemCstChildren, OverClauseCstChildren, PartitionPeriodCstChildren, PermissionListCstChildren, PermissionTokenCstChildren, PivotAggregationCstChildren, PivotBodyCstChildren, PivotForClauseCstChildren, PivotInValueCstChildren, PivotStatementCstChildren, PrimaryExpressionCstChildren, QualifiedNameCstChildren, QualifiedStarCstChildren, ReindexTableStatementCstChildren, RefreshMaterializedViewStatementCstChildren, RelationalExpressionCstChildren, RemoveUserStatementCstChildren, RenameTableStatementCstChildren, ResumeWalStatementCstChildren, RevokeAssumeServiceAccountStatementCstChildren, RevokeStatementCstChildren, SampleByClauseCstChildren, SelectItemCstChildren, SelectListCstChildren, SelectBodyCstChildren, SelectStatementCstChildren, SetClauseCstChildren, SetExpressionCstChildren, SetOperationCstChildren, SetTypeStatementCstChildren, ShowStatementCstChildren, SimpleSelectCstChildren, SnapshotStatementCstChildren, SpliceJoinCstChildren, HorizonJoinCstChildren, HorizonOffsetCstChildren, StandardJoinCstChildren, StatementCstChildren, StatementsCstChildren, StringOrIdentifierCstChildren, StringOrQualifiedNameCstChildren, TableFunctionCallCstChildren, TableFunctionNameCstChildren, TableNameCstChildren, TableNameOrStringCstChildren, TableParamCstChildren, TableParamNameCstChildren, TableRefCstChildren, TimeUnitCstChildren, TimeZoneValueCstChildren, TruncateTableStatementCstChildren, TypeCastExpressionCstChildren, UnaryExpressionCstChildren, UpdateStatementCstChildren, VacuumTableStatementCstChildren, ValuesClauseCstChildren, ValuesListCstChildren, WhereClauseCstChildren, WindowFrameBoundCstChildren, WindowFrameClauseCstChildren, WindowJoinBoundCstChildren, WindowJoinCstChildren, WindowPartitionByClauseCstChildren, WithClauseCstChildren, WithStatementCstChildren } from "./cst-types";
3
3
  declare const BaseVisitor: new (...args: any[]) => import("chevrotain").ICstVisitor<any, any>;
4
4
  declare class QuestDBVisitor extends BaseVisitor {
5
5
  constructor();
@@ -8,6 +8,7 @@ declare class QuestDBVisitor extends BaseVisitor {
8
8
  statement(ctx: StatementCstChildren): AST.Statement;
9
9
  withStatement(ctx: WithStatementCstChildren): AST.Statement;
10
10
  selectStatement(ctx: SelectStatementCstChildren): AST.SelectStatement;
11
+ selectBody(ctx: SelectBodyCstChildren): AST.SelectStatement;
11
12
  withClause(ctx: WithClauseCstChildren): AST.CTE[];
12
13
  cteDefinition(ctx: CteDefinitionCstChildren): AST.CTE;
13
14
  simpleSelect(ctx: SimpleSelectCstChildren): AST.SelectStatement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@questdb/sql-parser",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "SQL parser for QuestDB syntax using Chevrotain",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",