SqlExpressionVisitor
Base interface designed to visit or modify SQL expression trees using visitor pattern.
This interface provides a general visit function to dispatch different type of expression nodes to their specific visit*
functions. Custom expression types that are unknown to Ktorm will be dispatched to visitUnknown.
For each expression type, there is a corresponding visit*
function in this interface; for SelectExpression, it's visitSelect; for TableExpression, it's visitTable; and so on. Those functions generally accept an expression instance of the specific type and dispatch the children nodes to their own visit*
functions. Finally, after all children nodes are visited, the parent expression instance will be directly returned if no children are modified.
As SQL expressions are immutable, to modify an expression, we need to override a child visit*
function, and return a new-created expression in it. Then its parent's visit*
function will notice the change and create a new parent expression using the modified child node returned by us. As the process is recursive, the ancestor nodes also returns new-created instances. Finally, as a result of calling visit, a new expression tree will be returned with our modifications applied.
SqlFormatter is a typical example used to format expressions as executable SQL strings.
Inheritors
Functions
Dispatch different type of expression nodes to their specific visit*
functions. Custom expression types that are unknown to Ktorm will be dispatched to visitUnknown.
Function that visits an AggregateExpression.
Function that visits an ArgumentExpression.
Function that visits a BetweenExpression.
Function that visits a BinaryExpression.
Function that visits a CaseWhenExpression.
Function that visits a CastingExpression.
Function that visits a ColumnExpression.
Function that visits a ColumnAssignmentExpression.
Function that visits a ColumnDeclaringExpression.
Function that visits a DeleteExpression.
Function that visits an ExistsExpression.
Helper function for visiting a list of expressions.
Function that visits a FunctionExpression.
Function that visits an InListExpression.
Function that visits an InsertExpression.
Function that visits an InsertFromQueryExpression.
Function that visits a JoinExpression.
Function that visits an OrderByExpression.
Function that visits a QueryExpression.
Function that visits a QuerySourceExpression.
Function that visits a general ScalarExpression, this function dispatches different type of scalar expressions to their specific visit*
functions. Custom expression types that are unknown to Ktorm will be dispatched to visitUnknown
Function that visits a SelectExpression.
Function that visits a TableExpression.
Function that visits an UnaryExpression.
Function that visits an UnionExpression.
Function that visits an unknown expression.
Function that visits an UpdateExpression.
Helper function for visiting when clauses of CaseWhenExpression.
Function that visits a WindowFrameBoundExpression.
Function that visits a WindowFunctionExpression.
Function that visits a WindowSpecificationExpression.