import { Constructor } from "@itwin/core-bentley"; /** * Id returned by native code * @internal */ declare enum NativeExpIds { AllOrAny = "AllOrAnyExp",/** Not supported or working */ Assignment = "AssignmentExp", BetweenRangeValue = "BetweenRangeValueExp", BinaryBoolean = "BinaryBooleanExp", BinaryValue = "BinaryValueExp", BooleanFactor = "BooleanFactorExp", Cast = "CastExp", ClassName = "ClassNameExp", CommonTable = "CommonTableExp", CommonTableBlock = "CommonTableBlockExp", CommonTableBlockName = "CommonTableBlockNameExp", CrossJoin = "CrossJoinExp", DeleteStatement = "DeleteStatementExp", DerivedProperty = "DerivedPropertyExp", FunctionCall = "FunctionCallExp", IIF = "IIFExp", InsertStatement = "InsertStatementExp", LikeRhsValue = "LikeRhsValueExp", LimitOffset = "LimitOffsetExp", LiteralValue = "LiteralValueExp", MemberFunctionCall = "MemberFunctionCallExp", NaturalJoin = "NaturalJoinExp", Options = "OptionsExp", OrderBySpec = "OrderBySpecExp", Parameter = "ParameterExp", PropertyName = "PropertyNameExp", QualifiedJoin = "QualifiedJoinExp", RowConstructor = "RowConstructor", SearchCaseValue = "SearchCaseValueExp", SelectStatement = "SelectStatementExp", SingleSelectStatement = "SingleSelectStatementExp", Subquery = "SubqueryExp", SubqueryRef = "SubqueryRefExp", SubqueryTest = "SubqueryTestExp", TableValuedFunction = "TableValuedFunctionExp", UnaryValue = "UnaryValueExp", UpdateStatement = "UpdateStatementExp", UsingRelationshipJoinExp = "UsingRelationshipJoinExp", NavValueCreationFunc = "NavValueCreationFuncExp" } /** * Type of literal value. * @alpha */ export declare enum LiteralValueType { Null = "NULL", String = "STRING", Date = "DATE", Time = "TIME", Timestamp = "TIMESTAMP", Raw = "RAW" } /** * Sort direction specified by ORDER BY spec @see [[OrderBySpecExpr]] * @alpha */ export type FirstOrLast = "FIRST" | "LAST"; /** * Sort direction specified by ORDER BY spec @see [[OrderBySpecExpr]] * @alpha */ export type SortDirection = "ASC" | "DESC"; /** * Describe how SELECT result is combined with another SELECT in compound select statement @see [[NextSelect]] @see [[SelectStatementExp]] * @alpha */ export type CompoundSelectOp = "UNION" | "UNION ALL" | "INTERSECT" | "EXCEPT"; /** * Test subquery result. @see [[SubqueryTest]] * @alpha */ export type SubqueryTestOp = "EXISTS"; /** * Describe JOIN/USING relationship direction when relationship is of time 1:1. @see [[UsingRelationshipJoin]] * @alpha */ export type JoinDirection = "FORWARD" | "BACKWARD"; /** * Join specification of a Qualified join. @see [[QualifiedJoinExpr]] * @alpha */ export type JoinSpec = BooleanExpr | string[] | undefined; /** * Qualified JOIN type @see [[QualifiedJoinExpr]] * @alpha */ export declare enum JoinType { LeftOuter = "LEFT OUTER JOIN", RightOuter = "RIGHT OUTER JOIN", FullOuter = "FULL OUTER JOIN", Inner = "INNER JOIN" } /** * Unary operator for @see [[ValueExpr]]. * @alpha */ export type UnaryValueOp = "-" | "+" | "~"; /** * Unary operator for @see [[BooleanExpr]] * @alpha */ export type UnaryBooleanOp = "NOT"; /** * Binary boolean operators used by @see [[BinaryBooleanExpr]] * @alpha */ export type BinaryBooleanOp = "AND" | "OR" | "=" | ">=" | ">" | "<=" | "<" | "<>" | "!="; /** * Binary value operators used by @see [[BinaryValueExpr]] * @alpha */ export type BinaryValueOp = "&" | "|" | "<<" | "||" | "/" | "-" | "*" | "+" | "%"; /** * Disqualify term in ECSQL so query planner does not try to find index for it. @see [[ClassNameExpr]] * @alpha */ export type DisqualifyOp = "+"; /** * Optional recursive keyword for common table expressions @see [[CteExpr]] * @alpha */ export type RecursiveCte = "RECURSIVE"; /** * Polymorphic constraint for @see [[ClassNameExpr]] * @alpha */ export type AllOrAnyOp = "ONLY" | "ALL"; /** * Filter rows in select clause or aggregate functions @see [[FuncCallExpr]] and @see [[SelectExpr]] * @alpha */ export type AllOrDistinctOp = "DISTINCT" | "ALL"; /** * Return by native code * @alpha */ export interface NativeECSqlParseNode { [key: string]: any; } /** * Return by native code * @alpha */ export interface NativeECSqlParseNodeProvider { parseECSql: (ecsql: string) => Promise; } /** * ECSql expr type supported @see [[Expr]] * @alpha */ export declare enum ExprType { Literal = "Literal", Unary = "Unary", Parameter = "Parameter", Cast = "Cast", BinaryValue = "BinaryValue", SearchCase = "SearchCase", IIF = "IIF", FuncCall = "FuncCall", PropertyName = "PropertyName", Subquery = "Subquery", Between = "Between", Like = "Like", In = "In", Not = "Not", IsOfType = "IsOfType", IsNull = "IsNull", BinaryBoolean = "BinaryBoolean", SubqueryTest = "SubqueryTest", UsingRelationshipJoin = "UsingRelationshipJoin", QualifiedJoin = "QualifiedJoin", SubqueryRef = "SubqueryRef", CteBlockRef = "CteBlockRef", ClassName = "ClassName", TableValuedFunc = "TableValuedFunc", DerivedProperty = "DerivedProperty", SetClause = "SetClause", Select = "Select", ECSqlOptionsClause = "ECSqlOptions", CteBlock = "CteBlock", MemberFuncCall = "MemberFuncCall", Cte = "Cte", UpdateStatement = "UpdateStatement", InsertStatement = "InsertStatement", DeleteStatement = "DeleteStatement", SelectStatement = "SelectStatement", SelectionClause = "SelectionClause", WhereClause = "WhereClause", GroupByClause = "GroupByClause", HavingClause = "HavingCluase", FromClause = "FromClause", OrderByClause = "OrderByClause", OrderBySpec = "OrderBySpec", LimitClause = "LimitClause", Assignment = "Assignment", NavValueCreationFunc = "NavValueCreationFunc" } /** * Allow to create statement expression tree from a ecsql * @alpha */ export declare class ExprFactory { readonly provider: NativeECSqlParseNodeProvider; constructor(provider: NativeECSqlParseNodeProvider); parseStatement(ecsql: string): Promise; } /** * Base class for all ECSql expressions. * @alpha */ export declare abstract class Expr { readonly expType: ExprType; constructor(expType: ExprType); /** * Write expression tree to a ECSQL string * @param writer A instance of writer to which expression tree will output tokens. */ abstract writeTo(writer: ECSqlWriter): void; abstract get children(): Expr[]; /** * Find instances of expressions matching the type in sub tree. * @param type a subclass of Expr * @returns */ findInstancesOf(type: Constructor): T[]; /** * Allow to traverse the expression tree depth first * @param callback this will be called for each expression traverse from first to last. */ traverse(callback: (expr: Expr, parent?: Expr) => void | boolean): void; /** * Test if class instance is of certain type * @param type A class that extends from Expr * @returns true if instances matches the type else return false. */ isInstanceOf(type: Constructor): boolean; asInstanceOf(type: Constructor): T | undefined; /** * Convert expression tree to ECSQL. * @param args args to ecsql writer. * @returns ECSQL string */ toECSql(args?: ECSqlWriterArgs): string; } /** * Base class for all ECSQL Statements. Here are list of subclasses @see [[CteExpr]], @see [[SelectStatement]], @see [[InsertStatement]], @see [UpdateStatement]] and @see [[DeleteStatement]] * @alpha */ export declare abstract class StatementExpr extends Expr { static deserialize(node: NativeECSqlParseNode): StatementExpr | InsertStatementExpr | UpdateStatementExpr | DeleteStatementExpr | CteExpr; } /** * Base class for all computed expression like Value and Boolean. * @alpha */ export declare abstract class ComputedExpr extends Expr { static deserialize(node: NativeECSqlParseNode): BooleanExpr | ValueExpr; } /** * Base class for a boolean expressions. It has following subclasses * @see [[BooleanExpr]] * @see [[ubqueryTestExpr]] * @see [[BetweenExpr]] * @see [[LikeExpr]] * @see [[InExpr]] * @see [[IsNullExpr]] * @see [[IsOfTypeExpr]] * @see [[NotExpr]] * @see [[BinaryBooleanExpr]] * @alpha */ export declare abstract class BooleanExpr extends ComputedExpr { static readonly deserializableIds: NativeExpIds[]; static deserialize(node: NativeECSqlParseNode): BooleanExpr | SubqueryTestExpr | BetweenExpr | LikeExpr | InExpr | IsNullExpr | IsOfTypeExpr | NotExpr | BinaryBooleanExpr; } /** * Base class for all value expressions. Following is list of subclasses. * @see [[SubqueryExpr]] * @see [[ValueExpr]] * @see [[UnaryValueExpr]] * @see [[FuncCallExpr]] * @see [[CastExpr]] * @see [[BinaryValueExpr]] * @see [[SearchCaseExpr]] * @see [[IIFExpr]] * @see [[LiteralExpr]] * @see [[PropertyNameExpr]] * @see [[NavValueCreationFunc]] * @alpha */ export declare abstract class ValueExpr extends ComputedExpr { static readonly deserializableIds: NativeExpIds[]; static deserialize(node: NativeECSqlParseNode): SubqueryExpr | ValueExpr | UnaryValueExpr | FuncCallExpr | CastExpr | BinaryValueExpr | SearchCaseExpr | IIFExpr | LiteralExpr | PropertyNameExpr | NavValueCreationFuncExpr; } /** * Hold polymorphic information about @see [[ClassNameExp]] * @alpha */ export interface PolymorphicInfo { allOrAny: AllOrAnyOp; disqualify?: DisqualifyOp; } /** * Base class for expressions that can be used in FROM clause of a SELECT. Following list of this subclasses. * @see [[ClassRefExpr]] * @see [[ClassNameExpr]] * @see [[SubqueryRefExpr]] * @see [[UsingRelationshipJoinExpr]] * @see [[QualifiedJoinExpr]] * @see [[CteBlockRefExpr]] * @see [[TableValuedFuncExpr]] * @alpha */ export declare abstract class ClassRefExpr extends Expr { static readonly deserializableIds: NativeExpIds[]; static deserialize(node: NativeECSqlParseNode): ClassNameExpr | SubqueryRefExpr | UsingRelationshipJoinExpr | QualifiedJoinExpr | CteBlockRefExpr | TableValuedFuncExpr; } /** * Options for @see [[ECSqlWriter]] * @alpha */ export interface ECSqlWriterArgs { readonly multiline: boolean; readonly eol: "\r\n" | "\n"; readonly spaceAfterComma: boolean; readonly spaceAroundBinOp: boolean; readonly keywordCasing: "lower" | "UPPER"; readonly indent: { readonly size: number; readonly char: string; }; } /** * Keywords output by @see [[ECSqlWriter.appendKeyword]] * @alpha */ export type Keywords = "ALL" | "AND" | "AS" | "ASC" | "BACKWARD" | "BETWEEN" | "BY" | "CASE" | "CAST" | "CROSS" | "DATE" | "DELETE" | "DESC" | "DISTINCT" | "ECSQLOPTIONS" | "ELSE" | "END" | "ESCAPE" | "EXCEPT" | "EXISTS" | "FIRST" | "FORWARD" | "FROM" | "FULL" | "GROUP" | "HAVING" | "IIF" | "IN" | "INNER" | "INSERT" | "INTERSECT" | "INTO" | "IS" | "JOIN" | "LAST" | "LEFT" | "LIKE" | "LIMIT" | "NATURAL" | "NOT" | "NULL" | "NULLS" | "OFFSET" | "ON" | "ONLY" | "OR" | "ORDER" | "OUTER" | "RECURSIVE" | "RIGHT" | "SELECT" | "SET" | "THEN" | "TIME" | "TIMESTAMP" | "UNION" | "UPDATE" | "USING" | "VALUES" | "WHEN" | "WHERE" | "WITH"; /** * Write expression tree to string * @alpha */ export declare class ECSqlWriter { readonly options: ECSqlWriterArgs; private _tokens; private _currentIndent; private _isNewLine; constructor(options?: ECSqlWriterArgs); indent(): void; unindent(): void; appendBinaryOp(val: string): this; appendKeyword(val: Keywords): this; appendComma(): void; appendQuoted(val: string): this; append(val: string): this; appendStringLiteral(val: string): this; appendLineOrSpace(): this; appendSpace(): this; appendLine(): this; clear(): this; squash(): this; toString(): string; appendExp(exp: Expr): this; appendParenLeft(): this; appendParenRight(): this; } /** * Use to describe selection clause terms in a SELECT statements @see [[SelectionClauseExpr]] @see [[SelectExpr]] * @alpha */ export declare class DerivedPropertyExpr extends Expr { readonly computedExpr: ComputedExpr; readonly alias?: string | undefined; static readonly type = ExprType.DerivedProperty; constructor(computedExpr: ComputedExpr, alias?: string | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): DerivedPropertyExpr; writeTo(writer: ECSqlWriter): void; } /** * Describes a ECSQL delete statement. * @alpha */ export declare class DeleteStatementExpr extends StatementExpr { readonly className: ClassNameExpr; readonly where?: WhereClauseExp | undefined; readonly options?: ECSqlOptionsClauseExpr | undefined; static readonly type = ExprType.DeleteStatement; constructor(className: ClassNameExpr, where?: WhereClauseExp | undefined, options?: ECSqlOptionsClauseExpr | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): DeleteStatementExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a ECSQL Insert statement. * @alpha */ export declare class InsertStatementExpr extends StatementExpr { readonly className: ClassNameExpr; readonly values: ValueExpr[]; readonly propertyNames?: PropertyNameExpr[] | undefined; static readonly type = ExprType.InsertStatement; constructor(className: ClassNameExpr, values: ValueExpr[], propertyNames?: PropertyNameExpr[] | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): InsertStatementExpr; writeTo(writer: ECSqlWriter): void; } /** * Describes a JOIN clause e.g. JOIN ON * @alpha */ export declare class QualifiedJoinExpr extends ClassRefExpr { readonly joinType: JoinType; readonly from: ClassRefExpr; readonly to: ClassRefExpr; readonly spec: JoinSpec; static readonly type = ExprType.QualifiedJoin; constructor(joinType: JoinType, from: ClassRefExpr, to: ClassRefExpr, spec: JoinSpec); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): QualifiedJoinExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a JOIN USING clause. * @alpha */ export declare class UsingRelationshipJoinExpr extends ClassRefExpr { readonly fromClassName: ClassRefExpr; readonly toClassName: ClassNameExpr; readonly toRelClassName: ClassNameExpr; readonly direction?: JoinDirection | undefined; static readonly type = ExprType.UsingRelationshipJoin; constructor(fromClassName: ClassRefExpr, toClassName: ClassNameExpr, toRelClassName: ClassNameExpr, direction?: JoinDirection | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): UsingRelationshipJoinExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe subquery result test e.g. EXISTS() * @alpha */ export declare class SubqueryTestExpr extends BooleanExpr { readonly op: SubqueryTestOp; readonly query: SubqueryExpr; static readonly type = ExprType.SubqueryTest; constructor(op: SubqueryTestOp, query: SubqueryExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): SubqueryTestExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a subquery when used in FROM clause. * @alpha */ export declare class SubqueryRefExpr extends ClassRefExpr { readonly query: SubqueryExpr; readonly polymorphicInfo?: PolymorphicInfo | undefined; readonly alias?: string | undefined; static readonly type = ExprType.SubqueryRef; constructor(query: SubqueryExpr, polymorphicInfo?: PolymorphicInfo | undefined, alias?: string | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): SubqueryRefExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe next select statement in a compound select statement. @see [[SelectStatementExp]] * @alpha */ export interface NextSelect { op: CompoundSelectOp; select: SelectStatementExpr; } /** * Describe a optionally compound SELECT statement. * @alpha */ export declare class SelectStatementExpr extends StatementExpr { readonly singleSelect: SelectExpr; readonly nextSelect?: NextSelect | undefined; static readonly type = ExprType.SelectStatement; constructor(singleSelect: SelectExpr, nextSelect?: NextSelect | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): SelectStatementExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe selection in a SELECT query * @alpha */ export declare class SelectionClauseExpr extends Expr { readonly derivedPropertyList: DerivedPropertyExpr[]; static readonly type = ExprType.SelectionClause; constructor(derivedPropertyList: DerivedPropertyExpr[]); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): SelectionClauseExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a GROUP BY clause in a SELECT statement. * @alpha */ export declare class GroupByClauseExpr extends Expr { readonly exprList: ValueExpr[]; static readonly type = ExprType.GroupByClause; constructor(exprList: ValueExpr[]); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): GroupByClauseExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a HAVING clause in a SELECT statement. * @alpha */ export declare class HavingClauseExpr extends Expr { readonly filterExpr: ComputedExpr; static readonly type = ExprType.HavingClause; constructor(filterExpr: ComputedExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): HavingClauseExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a FROM clause in a SELECT statement. * @alpha */ export declare class FromClauseExpr extends Expr { readonly classRefs: ClassRefExpr[]; static readonly type = ExprType.FromClause; constructor(classRefs: ClassRefExpr[]); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): FromClauseExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a WHERE clause in a SELECT, UPDATE and DELETE statement. * @alpha */ export declare class WhereClauseExp extends Expr { readonly filterExpr: ComputedExpr; static readonly type = ExprType.WhereClause; constructor(filterExpr: ComputedExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): WhereClauseExp; writeTo(writer: ECSqlWriter): void; } /** * Describe a single sorted term in a ORDER BY clause of a SELECT statement. * @alpha */ export declare class OrderBySpecExpr extends Expr { readonly term: ValueExpr; readonly sortDirection?: SortDirection | undefined; readonly nulls?: FirstOrLast | undefined; static readonly type = ExprType.OrderBySpec; constructor(term: ValueExpr, sortDirection?: SortDirection | undefined, nulls?: FirstOrLast | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): OrderBySpecExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a ORDER BY clause in a SELECT statement. * @alpha */ export declare class OrderByClauseExpr extends Expr { readonly terms: OrderBySpecExpr[]; static readonly type = ExprType.OrderByClause; constructor(terms: OrderBySpecExpr[]); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): OrderByClauseExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a LIMIT clause in a SELECT statement. * @alpha */ export declare class LimitClauseExpr extends Expr { readonly limit: ValueExpr; readonly offset?: ValueExpr | undefined; static readonly type = ExprType.LimitClause; constructor(limit: ValueExpr, offset?: ValueExpr | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): LimitClauseExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a single select statement. * @alpha */ export declare class SelectExpr extends Expr { readonly selection: SelectionClauseExpr; readonly rowQuantifier?: AllOrDistinctOp | undefined; readonly from?: FromClauseExpr | undefined; readonly where?: WhereClauseExp | undefined; readonly groupBy?: GroupByClauseExpr | undefined; readonly having?: HavingClauseExpr | undefined; readonly orderBy?: OrderByClauseExpr | undefined; readonly limit?: LimitClauseExpr | undefined; readonly options?: ECSqlOptionsClauseExpr | undefined; static readonly type = ExprType.Select; constructor(selection: SelectionClauseExpr, rowQuantifier?: AllOrDistinctOp | undefined, from?: FromClauseExpr | undefined, where?: WhereClauseExp | undefined, groupBy?: GroupByClauseExpr | undefined, having?: HavingClauseExpr | undefined, orderBy?: OrderByClauseExpr | undefined, limit?: LimitClauseExpr | undefined, options?: ECSqlOptionsClauseExpr | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): SelectExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a subquery when used as value. This kind of query expect to return one column and one one value. * @alpha */ export declare class SubqueryExpr extends ValueExpr { readonly query: SelectStatementExpr | CteExpr; static readonly type = ExprType.Subquery; constructor(query: SelectStatementExpr | CteExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): SubqueryExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a binary boolean expression in ECSQL. * @alpha */ export declare class BinaryBooleanExpr extends BooleanExpr { readonly op: BinaryBooleanOp; readonly lhsExpr: ComputedExpr; readonly rhsExpr: ComputedExpr; readonly not?: UnaryBooleanOp | undefined; static readonly type = ExprType.BinaryBoolean; constructor(op: BinaryBooleanOp, lhsExpr: ComputedExpr, rhsExpr: ComputedExpr, not?: UnaryBooleanOp | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): BinaryBooleanExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a IS NULL boolean expression * @alpha */ export declare class IsNullExpr extends BooleanExpr { readonly operandExpr: ValueExpr; readonly not?: UnaryBooleanOp | undefined; static readonly type = ExprType.IsNull; constructor(operandExpr: ValueExpr, not?: UnaryBooleanOp | undefined); get children(): Expr[]; static parseOp(node: NativeECSqlParseNode): boolean[]; static deserialize(node: NativeECSqlParseNode): IsNullExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a IS (type1[, type2]) in ECSQL. * @alpha */ export declare class IsOfTypeExpr extends BooleanExpr { readonly lhsExpr: ValueExpr; readonly typeNames: ClassNameExpr[]; readonly not?: UnaryBooleanOp | undefined; static readonly type = ExprType.IsOfType; constructor(lhsExpr: ValueExpr, typeNames: ClassNameExpr[], not?: UnaryBooleanOp | undefined); get children(): Expr[]; static parseOp(node: NativeECSqlParseNode): boolean[]; static deserialize(node: NativeECSqlParseNode): IsOfTypeExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a NOT boolean expression * @alpha */ export declare class NotExpr extends BooleanExpr { readonly operandExpr: ComputedExpr; static readonly type = ExprType.Not; constructor(operandExpr: ComputedExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): NotExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a IN subquery|(val1[,val2...]) boolean expression * @alpha */ export declare class InExpr extends BooleanExpr { readonly lhsExpr: ValueExpr; readonly rhsExpr: ValueExpr[] | SubqueryExpr; readonly not?: UnaryBooleanOp | undefined; static readonly type = ExprType.In; constructor(lhsExpr: ValueExpr, rhsExpr: ValueExpr[] | SubqueryExpr, not?: UnaryBooleanOp | undefined); get children(): Expr[]; static parseOp(op: string): boolean[]; static deserialize(node: NativeECSqlParseNode): InExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a LIKE [ESCAPE ] boolean expression * @alpha */ export declare class LikeExpr extends BooleanExpr { readonly lhsExpr: ValueExpr; readonly patternExpr: ValueExpr; readonly escapeExpr?: ValueExpr | undefined; readonly not?: UnaryBooleanOp | undefined; static readonly type = ExprType.Like; constructor(lhsExpr: ValueExpr, patternExpr: ValueExpr, escapeExpr?: ValueExpr | undefined, not?: UnaryBooleanOp | undefined); get children(): Expr[]; static parseOp(op: string): boolean[]; static deserialize(node: NativeECSqlParseNode): LikeExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a BETWEEN AND boolean expression * @alpha */ export declare class BetweenExpr extends BooleanExpr { readonly lhsExpr: ValueExpr; readonly lowerBoundExpr: ValueExpr; readonly upperBoundExpr: ValueExpr; readonly not?: UnaryBooleanOp | undefined; static readonly type = ExprType.Between; constructor(lhsExpr: ValueExpr, lowerBoundExpr: ValueExpr, upperBoundExpr: ValueExpr, not?: UnaryBooleanOp | undefined); get children(): Expr[]; static parseOp(op: string): boolean[]; static deserialize(node: NativeECSqlParseNode): BetweenExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a common table expression base query statement * @alpha */ export declare class CteExpr extends StatementExpr { readonly cteBlocks: CteBlockExpr[]; readonly query: SelectStatementExpr; readonly recursive?: RecursiveCte | undefined; static readonly type = ExprType.Cte; constructor(cteBlocks: CteBlockExpr[], query: SelectStatementExpr, recursive?: RecursiveCte | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): CteExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a single block of CTE that can be reference in FROM clause of a SELECT * @alpha */ export declare class CteBlockExpr extends Expr { readonly name: string; readonly query: SelectStatementExpr; readonly props: string[]; static readonly type = ExprType.CteBlock; constructor(name: string, query: SelectStatementExpr, props: string[]); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): CteBlockExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a name reference to a CTE block. * @alpha */ export declare class CteBlockRefExpr extends ClassRefExpr { readonly name: string; readonly alias?: string | undefined; static readonly type = ExprType.CteBlockRef; constructor(name: string, alias?: string | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): CteBlockRefExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a table value function expression in ECSQL that appear in FROM clause of query. * @alpha */ export declare class TableValuedFuncExpr extends ClassRefExpr { readonly schemaName: string; readonly memberFunc: MemberFuncCallExpr; readonly alias?: string | undefined; static readonly type = ExprType.TableValuedFunc; constructor(schemaName: string, memberFunc: MemberFuncCallExpr, alias?: string | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): TableValuedFuncExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a class name reference in ECSQL that appear in FROM clause of a SELECT. * @alpha */ export declare class ClassNameExpr extends ClassRefExpr { readonly schemaNameOrAlias: string; readonly className: string; readonly tablespace?: string | undefined; readonly alias?: string | undefined; polymorphicInfo?: PolymorphicInfo | undefined; readonly memberFunc?: MemberFuncCallExpr | undefined; static readonly type = ExprType.ClassName; constructor(schemaNameOrAlias: string, className: string, tablespace?: string | undefined, alias?: string | undefined, polymorphicInfo?: PolymorphicInfo | undefined, memberFunc?: MemberFuncCallExpr | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): ClassNameExpr; writeTo(writer: ECSqlWriter): void; static fromECSql(ecsql: string): ClassNameExpr; } /** * Describe a UPDATE statement in ECSQL. * @alpha */ export declare class UpdateStatementExpr extends StatementExpr { readonly className: ClassNameExpr; readonly assignement: SetClauseExpr; readonly where?: WhereClauseExp | undefined; readonly options?: ECSqlOptionsClauseExpr | undefined; static readonly type = ExprType.UpdateStatement; constructor(className: ClassNameExpr, assignement: SetClauseExpr, where?: WhereClauseExp | undefined, options?: ECSqlOptionsClauseExpr | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): UpdateStatementExpr; writeTo(writer: ECSqlWriter): void; } /** * Supported options in ECSQL option clause * @alpha */ export type ECSqlSupportedOptions = "NoECClassIdFilter" | "ReadonlyPropertiesAreUpdatable"; /** * ECSql option name and optionally value pair. * @alpha */ export interface ECSqlOption { name: ECSqlSupportedOptions; value?: string; } /** * Describe ECSQL option clause. * @alpha */ export declare class ECSqlOptionsClauseExpr extends Expr { readonly options: ECSqlOption[]; static readonly type = ExprType.ECSqlOptionsClause; constructor(options: ECSqlOption[]); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): ECSqlOptionsClauseExpr; writeTo(writer: ECSqlWriter): void; } /** * A single property value assignment for update clause * @alpha */ export declare class AssignmentExpr extends Expr { readonly propertyName: PropertyNameExpr; readonly valueExpr: ValueExpr; static readonly type = ExprType.Assignment; constructor(propertyName: PropertyNameExpr, valueExpr: ValueExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): AssignmentExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a set clause in a UPDATE statement * @alpha */ export declare class SetClauseExpr extends Expr { readonly assignments: AssignmentExpr[]; static readonly type = ExprType.SetClause; constructor(assignments: AssignmentExpr[]); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): SetClauseExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a strong typed IIF function in ECSQL * @alpha */ export declare class IIFExpr extends ValueExpr { readonly whenExpr: BooleanExpr; readonly thenExpr: ValueExpr; readonly elseExpr: ValueExpr; static readonly type = ExprType.IIF; constructor(whenExpr: BooleanExpr, thenExpr: ValueExpr, elseExpr: ValueExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): IIFExpr; writeTo(writer: ECSqlWriter): void; } /** * When then block in CASE-WHEN-THEN expression * @alpha */ export interface WhenThenBlock { whenExpr: BooleanExpr; thenExpr: ValueExpr; } /** * Describe a CASE-WHEN-THEN expression in ECSQL * @alpha */ export declare class SearchCaseExpr extends ValueExpr { readonly whenThenList: WhenThenBlock[]; readonly elseExpr?: ValueExpr | undefined; static readonly type = ExprType.SearchCase; constructor(whenThenList: WhenThenBlock[], elseExpr?: ValueExpr | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): SearchCaseExpr; writeTo(writer: ECSqlWriter): void; } /** * Describe a binary value expression * @alpha */ export declare class BinaryValueExpr extends ValueExpr { readonly op: BinaryValueOp; readonly lhsExpr: ValueExpr; readonly rhsExpr: ValueExpr; static readonly type = ExprType.BinaryValue; constructor(op: BinaryValueOp, lhsExpr: ValueExpr, rhsExpr: ValueExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): BinaryValueExpr; writeTo(writer: ECSqlWriter): void; } /** * Cast a expression into a target time e.g. CAST( AS STRING) * @alpha */ export declare class CastExpr extends ValueExpr { readonly valueExpr: ValueExpr; readonly targetType: string; static readonly type = ExprType.Cast; constructor(valueExpr: ValueExpr, targetType: string); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): CastExpr; writeTo(writer: ECSqlWriter): void; } /** * Represent a member function called w.r.t a ClassNameExpr * @alpha */ export declare class MemberFuncCallExpr extends Expr { readonly functionName: string; readonly args: ValueExpr[]; static readonly type = ExprType.MemberFuncCall; constructor(functionName: string, args: ValueExpr[]); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): MemberFuncCallExpr; writeTo(writer: ECSqlWriter): void; } /** * Represent a function call in ecsql * @alpha */ export declare class FuncCallExpr extends ValueExpr { readonly functionName: string; readonly args: ValueExpr[]; readonly allOrDistinct?: AllOrDistinctOp | undefined; static readonly type = ExprType.FuncCall; constructor(functionName: string, args: ValueExpr[], allOrDistinct?: AllOrDistinctOp | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): FuncCallExpr; writeTo(writer: ECSqlWriter): void; static makeAbs(arg: ValueExpr): FuncCallExpr; static makeLower(arg: ValueExpr): FuncCallExpr; static makeUpper(arg: ValueExpr): FuncCallExpr; static makeLTrim(arg0: ValueExpr, arg1?: ValueExpr): FuncCallExpr; static makeRTrim(arg0: ValueExpr, arg1?: ValueExpr): FuncCallExpr; static makeLHex(arg: ValueExpr): FuncCallExpr; static makeLIfNull(arg0: ValueExpr, arg1: ValueExpr): FuncCallExpr; static makeInstr(arg0: ValueExpr, arg1: ValueExpr): FuncCallExpr; static makeLength(arg0: ValueExpr): FuncCallExpr; static makeLike(arg0: ValueExpr, arg1: ValueExpr, arg2?: ValueExpr): FuncCallExpr; static makeLikelihood(arg0: ValueExpr, arg1: ValueExpr): FuncCallExpr; static makeMax(arg: ValueExpr, ...optionalArgs: ValueExpr[]): FuncCallExpr; static makeMin(arg: ValueExpr, ...optionalArgs: ValueExpr[]): FuncCallExpr; static makePrintf(arg: ValueExpr, ...optionalArgs: ValueExpr[]): FuncCallExpr; static makeRandom(): FuncCallExpr; static makeQuote(arg: ValueExpr): FuncCallExpr; static makeRandomBlob(arg: ValueExpr): FuncCallExpr; static makeReplace(arg0: ValueExpr, arg1: ValueExpr, arg2: ValueExpr): FuncCallExpr; static makeRound(arg0: ValueExpr, arg1?: ValueExpr): FuncCallExpr; static makeSign(arg0: ValueExpr): FuncCallExpr; static makeUnhex(arg0: ValueExpr): FuncCallExpr; static makeSoundex(arg0: ValueExpr): FuncCallExpr; static makeTrim(arg0: ValueExpr, arg1?: ValueExpr): FuncCallExpr; static makeTypeOf(arg0: ValueExpr): FuncCallExpr; static makeZeroBlob(arg0: ValueExpr): FuncCallExpr; static makeUnlikely(arg0: ValueExpr): FuncCallExpr; static makeSubstring(arg0: ValueExpr, arg1: ValueExpr, arg2: ValueExpr): FuncCallExpr; static makeStrToGuid(arg0: ValueExpr): FuncCallExpr; static makeGuidToStr(arg0: ValueExpr): FuncCallExpr; static makeIdToHex(arg0: ValueExpr): FuncCallExpr; static makeHexToId(arg0: ValueExpr): FuncCallExpr; static makeEcClassName(arg0: ValueExpr, fmt?: "s:c" | "a:c" | "s" | "a" | "c" | "s.c" | "a.c"): FuncCallExpr; static makeEcClassId(arg0: ValueExpr): FuncCallExpr; static makeInstanceOf(arg0: ValueExpr, arg1: ValueExpr): FuncCallExpr; } /** * Represent positional or named parameter * @alpha */ export declare class ParameterExpr extends ValueExpr { readonly name?: string | undefined; static readonly type = ExprType.Parameter; constructor(name?: string | undefined); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): ParameterExpr; writeTo(writer: ECSqlWriter): void; } /** * Unary value with operator e.g. [+|-|~] * @alpha */ export declare class UnaryValueExpr extends ValueExpr { readonly op: UnaryValueOp; readonly valueExpr: ValueExpr; static readonly type = ExprType.Unary; constructor(op: UnaryValueOp, valueExpr: ValueExpr); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): UnaryValueExpr; writeTo(writer: ECSqlWriter): void; } /** * Represent constant literal like string, data, time, timestamp, number or null * @alpha */ export declare class LiteralExpr extends ValueExpr { readonly valueType: LiteralValueType; readonly rawValue: string; static readonly type = ExprType.Literal; constructor(valueType: LiteralValueType, rawValue: string); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): LiteralExpr; writeTo(writer: ECSqlWriter): void; static makeRaw(val: string): LiteralExpr; static makeString(val: string): LiteralExpr; static makeNumber(val: number): LiteralExpr; static makeDate(val: Date): LiteralExpr; static makeTime(val: Date): LiteralExpr; static makeTimestamp(val: Date): LiteralExpr; static makeNull(): LiteralExpr; } /** * Represent property name identifier * @alpha */ export declare class PropertyNameExpr extends ValueExpr { readonly propertyPath: string; static readonly type = ExprType.PropertyName; constructor(propertyPath: string); get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): PropertyNameExpr; writeTo(writer: ECSqlWriter): void; } /** * Represent navigation value creation function * @alpha */ export declare class NavValueCreationFuncExpr extends ValueExpr { readonly columnRefExp: DerivedPropertyExpr; readonly idArgExp: ValueExpr; readonly classNameExp: ClassNameExpr; readonly relECClassIdExp?: ValueExpr | undefined; static readonly type = ExprType.NavValueCreationFunc; static readonly navValueCreationFuncExprName = "NAVIGATION_VALUE"; constructor(columnRefExp: DerivedPropertyExpr, idArgExp: ValueExpr, classNameExp: ClassNameExpr, relECClassIdExp?: ValueExpr | undefined); writeTo(writer: ECSqlWriter): void; get children(): Expr[]; static deserialize(node: NativeECSqlParseNode): NavValueCreationFuncExpr; } export {}; //# sourceMappingURL=ECSqlAst.d.ts.map