import { t as SqlComparisonOperator } from "./lexer-DgsW7jMA.js"; //#region src/odb/sql/parser.d.ts type SqlAggregateFunction = "COUNT" | "SUM" | "AVG" | "MIN" | "MAX"; interface SqlNameRef { readonly name: string; readonly quoted: boolean; } interface SqlColumnRef { readonly qualifier: SqlNameRef | undefined; readonly column: SqlNameRef; readonly text: string; } type SqlLiteral = { readonly kind: "number"; readonly value: number; } | { readonly kind: "string"; readonly value: string; } | { readonly kind: "boolean"; readonly value: boolean; } | { readonly kind: "null"; }; type SqlOperand = { readonly kind: "column"; readonly column: SqlColumnRef; } | { readonly kind: "literal"; readonly literal: SqlLiteral; }; type SqlPredicate = { readonly kind: "comparison"; readonly operator: SqlComparisonOperator; readonly left: SqlOperand; readonly right: SqlOperand; } | { readonly kind: "isNull"; readonly operand: SqlOperand; readonly negated: boolean; } | { readonly kind: "like"; readonly operand: SqlOperand; readonly pattern: string; readonly negated: boolean; } | { readonly kind: "in"; readonly operand: SqlOperand; readonly values: readonly SqlLiteral[]; readonly negated: boolean; } | { readonly kind: "inSubquery"; readonly operand: SqlOperand; readonly query: SqlSelectStatement; readonly negated: boolean; } | { readonly kind: "between"; readonly operand: SqlOperand; readonly lower: SqlOperand; readonly upper: SqlOperand; readonly negated: boolean; } | { readonly kind: "exists"; readonly query: SqlSelectStatement; } | { readonly kind: "not"; readonly predicate: SqlPredicate; } | { readonly kind: "and"; readonly left: SqlPredicate; readonly right: SqlPredicate; } | { readonly kind: "or"; readonly left: SqlPredicate; readonly right: SqlPredicate; }; type SqlAggregateArgument = { readonly kind: "star"; } | { readonly kind: "column"; readonly column: SqlColumnRef; }; type SqlSelectItem = { readonly kind: "star"; } | { readonly kind: "column"; readonly column: SqlColumnRef; } | { readonly kind: "aggregate"; readonly aggregate: SqlAggregateFunction; readonly argument: SqlAggregateArgument; readonly outputName: string; }; type SqlSortDirection = "asc" | "desc"; interface SqlOrderByTerm { readonly column: SqlColumnRef; readonly direction: SqlSortDirection; } type SqlJoinKind = "inner" | "left" | "right" | "full" | "cross"; type SqlJoinCondition = { readonly kind: "on"; readonly predicate: SqlPredicate; } | { readonly kind: "using"; readonly columns: readonly SqlNameRef[]; } | { readonly kind: "natural"; } | { readonly kind: "none"; }; interface SqlJoinClause { readonly joinKind: SqlJoinKind; readonly table: SqlNameRef; readonly alias: SqlNameRef | undefined; readonly condition: SqlJoinCondition; } type SqlFromSource = { readonly kind: "table"; readonly table: SqlNameRef; readonly alias: SqlNameRef | undefined; } | { readonly kind: "derived"; readonly query: SqlSelectStatement; readonly alias: SqlNameRef; }; interface SqlFromClause { readonly source: SqlFromSource; readonly joins: readonly SqlJoinClause[]; } interface SqlSelectStatement { readonly sql: string; readonly items: readonly SqlSelectItem[]; readonly from: SqlFromClause; readonly where: SqlPredicate | undefined; readonly groupBy: readonly SqlColumnRef[]; readonly orderBy: readonly SqlOrderByTerm[]; } declare function parseSelect(sql: string): SqlSelectStatement; //#endregion export { parseSelect as _, SqlFromSource as a, SqlJoinKind as c, SqlOperand as d, SqlOrderByTerm as f, SqlSortDirection as g, SqlSelectStatement as h, SqlFromClause as i, SqlLiteral as l, SqlSelectItem as m, SqlAggregateFunction as n, SqlJoinClause as o, SqlPredicate as p, SqlColumnRef as r, SqlJoinCondition as s, SqlAggregateArgument as t, SqlNameRef as u };