# README
go-sql2struct
sqlparser
摘自 https://github.com/vitessio/vitess
Usage
import ( "github.com/Bill-cc/go-sql2struct" )
example
# Packages
No description provided by the author
No description provided by the author
Package hack gives you some efficient functionality at the cost of breaking some Go rules.
No description provided by the author
Package sqltypes implements interfaces and types that represent SQL values.
No description provided by the author
No description provided by the author
Package visitorgen is responsible for taking the ast.go of Vitess andand producing visitor infrastructure for it.
Package vterrors provides simple error handling primitives for Vitess
In all Vitess code, errors should be propagated using vterrors.Wrapf() and not fmt.Errorf().
# Functions
Append appends the SQLNode to the buffer.
ASTToStatementType returns a StatementType from an AST stmt.
BuildParsedQuery builds a ParsedQuery from the input.
CanNormalize takes Statement and returns if the statement can be normalized.
Convert converts between AST expressions and executable expressions.
EncodeValue encodes one bind variable value into the query.
ExtractCommentDirectives parses the comment list for any execution directives of the form:
/*vt+ OPTION_ONE=1 OPTION_TWO OPTION_THREE=abcd */
It returns the map of the directive values or nil if there aren't any.
ExtractMysqlComment extracts the version and SQL from a comment-only query such as /*!50708 sql here */.
FetchBindVar resolves the bind variable by fetching it from bindVariables.
FormatImpossibleQuery creates an impossible query in a TrackedBuffer.
No description provided by the author
GetBindvars returns a map of the bind vars referenced in the statement.
GetTableName returns the table name from the SimpleTableExpr only if it's a simple expression.
IgnoreMaxMaxMemoryRowsDirective returns true if the max memory rows override directive is set to true.
IgnoreMaxPayloadSizeDirective returns true if the max payload size override directive is set to true.
IsColName returns true if the Expr is a *ColName.
IsDML returns true if the query is an INSERT, UPDATE or DELETE statement.
IsDMLStatement returns true if the query is an INSERT, UPDATE or DELETE statement.
IsLockingFunc returns true for all functions that are used to work with mysql advisory locks.
IsNull returns true if the Expr is SQL NULL.
IsSetStatement takes Statement and returns if the statement is set statement.
IsSimpleTuple returns true if the Expr is a ValTuple that contains simple values or if it's a list arg.
IsValue returns true if the Expr is a string, integral or value arg.
IsVschemaDDL returns true if the query is an Vschema alter ddl.
KeywordString returns the string corresponding to the given keyword.
LikeToRegexp converts a like sql expression to regular expression.
NewArgument builds a new ValArg.
NewBitLiteral builds a new BitVal containing a bit literal.
NewColIdent makes a new ColIdent.
NewColIdentWithAt makes a new ColIdent.
NewColName makes a new ColName.
NewFloatLiteral builds a new FloatVal.
NewHexLiteral builds a new HexVal.
NewHexNumLiteral builds a new HexNum.
NewIntLiteral builds a new IntVal.
NewParsedQuery returns a ParsedQuery of the ast.
NewPlanValue builds a sqltypes.PlanValue from an Expr.
NewSelect is used to create a select statement.
NewStringTokenizer creates a new Tokenizer for the sql string.
NewStrLiteral builds a new StrVal.
NewTableIdent creates a new TableIdent.
NewTokenizer creates a new Tokenizer reading a sql string from the io.Reader.
NewTrackedBuffer creates a new TrackedBuffer.
NewWhere creates a WHERE or HAVING clause out of a Expr.
Normalize changes the statement to use bind values, and updates the bind vars to those values.
NormalizeAlphabetically rewrites given query such that: - WHERE 'AND' expressions are reordered alphabetically.
Parse parses the SQL in full and returns a Statement, which is the AST representation of the query.
ParseNext parses a single SQL statement from the tokenizer returning a Statement which is the AST representation of the query.
ParseNextStrictDDL is the same as ParseNext except it errors on partially parsed DDL statements.
ParseStrictDDL is the same as Parse except it errors on partially parsed DDL statements.
ParseTable parses the input as a qualified table name.
ParseTokenizer is a raw interface to parse from the given tokenizer.
PrepareAST will normalize the query.
Preview analyzes the beginning of the query using a simpler and faster textual comparison to identify the statement type.
QueryMatchesTemplates sees if the given query has the same fingerprint as one of the given templates (one is enough).
RedactSQLQuery returns a sql string with the params stripped out for display.
ReplaceExpr finds the from expression from root and replaces it with to.
Rewrite traverses a syntax tree recursively, starting with root, and calling pre and post for each node as described below.
RewriteAST rewrites the whole AST, replacing function calls and adding column aliases to queries.
SkipQueryPlanCacheDirective returns true if skip query plan cache directive is set to true in query.
SplitAndExpression breaks up the Expr into AND-separated conditions and appends them to filters.
SplitMarginComments pulls out any leading or trailing comments from a raw sql query.
SplitStatement returns the first sql statement up to either a ; or EOF and the remainder from the given buffer.
SplitStatementToPieces split raw sql statement that may have multi sql pieces to sql pieces returns the sql pieces blob contains; or error if sql cannot be parsed.
String returns a string representation of an SQLNode.
StripLeadingComments trims the SQL string and removes any leading comments.
TableFromStatement returns the qualified table name for the query.
TruncateForLog is used when displaying queries as part of error logs to avoid overwhelming logging systems with potentially long queries and bind value data.
TruncateForUI is used when displaying queries on various Vitess status pages to keep the pages small enough to load and render properly.
Unionize returns a UNION, either creating one or adding SELECT to an existing one.
Walk calls visit on every node.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - DBDDL.Action.
Constants for Enum Type - DDL.Action.
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - ExplainType.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - OrderDirection.
Order.Direction.
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - RangeCondOperator.
RangeCond.Operator.
No description provided by the author
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
BinaryExpr.Operator.
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
These are the possible Valtype values.
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - MatchExprOption.
No description provided by the author
No description provided by the author
No description provided by the author
These map to the SQL-defined reference actions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - ConvertTypeOperator.
ConvertType.Operator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - DBDDL.Action.
Constants for Enum Type - DDL.Action.
DDL strings.
Constants for Enum Type - DDL.Action.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DBVarName is a reserved bind var name for database().
No description provided by the author
No description provided by the author
DefaultAction indicates no action was explicitly specified.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - OrderDirection.
No description provided by the author
No description provided by the author
No description provided by the author
DirectiveIgnoreMaxMemoryRows skips memory row validation when set.
DirectiveIgnoreMaxPayloadSize skips payload size validation when set.
DirectiveMultiShardAutocommit is the query comment directive to allow single round trip autocommit with a multi-shard statement.
DirectiveQueryTimeout sets a query timeout in vtgate.
DirectiveScatterErrorsAsWarnings enables partial success scatter select queries.
DirectiveSkipQueryPlanCache skips query plan cache when set.
No description provided by the author
No description provided by the author
Select.Distinct.
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
DoubleAt represnts @@.
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
Constants for Enum Type - DBDDL.Action.
Constants for Enum Type - DDL.Action.
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Explain formats.
Constant for Enum Type - ExplainType.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
ComparisonExpr.Operator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
These are the possible Valtype values.
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - IndexHintsType.
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - Lock.
No description provided by the author
FoundRowsName is a reserved bind var name for found_rows().
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - Scope.
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - WhereType.
No description provided by the author
No description provided by the author
No description provided by the author
These are the possible Valtype values.
No description provided by the author
These are the possible Valtype values.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - IndexHintsType.
No description provided by the author
Constants for Enum Type - Scope.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
No description provided by the author
Constants for Enum Type - Insert.Action.
DDL strings.
No description provided by the author
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - SelectIntoType.
No description provided by the author
Constant for Enum Type - SelectIntoType.
Constant for Enum Type - SelectIntoType.
No description provided by the author
INTO OUTFILE.
These are the possible Valtype values.
No description provided by the author
No description provided by the author
Constant for Enum Type - IsExprOperator.
No description provided by the author
Constant for Enum Type - IsExprOperator.
No description provided by the author
Constant for Enum Type - IsExprOperator.
No description provided by the author
Constant for Enum Type - IsExprOperator.
No description provided by the author
Constant for Enum Type - IsExprOperator.
IsExpr.Operator.
No description provided by the author
Constant for Enum Type - IsExprOperator.
No description provided by the author
No description provided by the author
JoinTableExpr.Join.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
Constant for Enum Type - ExplainType.
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LastInsertIDName is a reserved bind var name for last_insert_id().
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - JoinType.
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - Scope.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - JoinType.
Constant for Enum Type - MatchExprOption.
No description provided by the author
Constant for Enum Type - MatchExprOption.
No description provided by the author
No description provided by the author
Constants for Enum Type - JoinType.
No description provided by the author
Constants for Enum Type - JoinType.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
These map to the SQL-defined reference actions.
NoAt represents no @.
Constants for Enum Type - Lock.
Select.Lock.
No description provided by the author
Constant for Enum Type - ConvertTypeOperator.
No description provided by the author
Constant for Enum Type - MatchExprOption.
MatchExpr.Option.
Constants for Enum Type - JoinType.
No description provided by the author
Constant for Enum Type - RangeCondOperator.
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Online DDL hint.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - MatchExprOption.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum type - IsolationLevel.
No description provided by the author
Constants for Enum type - AccessMode.
Constants for Enum type - IsolationLevel.
Transaction isolation levels.
Constants for Enum type - AccessMode.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - ComparisonExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
No description provided by the author
Constant for Enum Type - PartitionSpecAction.
Partition strings.
No description provided by the author
No description provided by the author
Constants for Enum type - IsolationLevel.
No description provided by the author
No description provided by the author
Constants for Enum Type - Insert.Action.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
These map to the SQL-defined reference actions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - JoinType.
No description provided by the author
No description provided by the author
No description provided by the author
RowCountName is a reserved bind var name for row_count().
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum type - IsolationLevel.
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - Scope.
Set.Scope or Show.Scope.
No description provided by the author
These map to the SQL-defined reference actions.
These map to the SQL-defined reference actions.
No description provided by the author
No description provided by the author
Constants for Enum Type - Lock.
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
Constant for Enum Type - BinaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
SingleAt represents @.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Select.Cache.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - JoinType.
No description provided by the author
No description provided by the author
These are the possible Valtype values.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - ExplainType.
No description provided by the author
SetExpr.Expr, for SET TRANSACTION ..
No description provided by the author
No description provided by the author
Constant for Enum Type - ExplainType.
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - DDL.Action.
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Union.Type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
UnaryExpr.Operator.
No description provided by the author
Constant for Enum Type - IndexHintsType.
UserDefinedVariableName is what we prepend bind var names for user defined variables.
Index hints.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
No description provided by the author
Constant for Enum Type - UnaryExprOperator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - Scope.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Vindex DDL param to specify the owner of a vindex.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - Scope.
No description provided by the author
No description provided by the author
Constant for Enum Type - ExplainType.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for Enum Type - WhereType.
Where.Type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
Aggregates is a map of all aggregate functions.
ErrEmpty is a sentinel error returned when parsing empty statements.
ErrExprNotSupported signals that the expression cannot be handled by expression evaluation engine.
TruncateErrLen truncate queries in error logs to the given length.
TruncateUILen truncate queries in debug UIs to the given length.
# Structs
No description provided by the author
No description provided by the author
*********** Expressions.
AutoIncSpec defines and autoincrement value for a ADD AUTO_INCREMENT statement.
Statements.
*********** Expressions.
BindVarNeeds represents the bind vars that need to be provided as the result of expression rewriting.
*********** Expressions.
No description provided by the author
ColIdent is a case insensitive SQL identifier.
*********** Expressions.
*********** Expressions.
ColumnDefinition describes a column in a CREATE TABLE statement.
ColumnType represents a sql type in a CREATE TABLE statement All optional fields are nil if not specified.
Statements.
*********** Expressions.
ConstraintDefinition describes a constraint in a CREATE TABLE statement.
*********** Expressions.
ConvertType represents the type in call to CONVERT(expr, type).
*********** Expressions.
Statements.
A Cursor describes a node encountered during Apply.
*********** Expressions.
Statements.
Statements.
*********** Expressions.
Statements.
No description provided by the author
*********** Expressions.
Statements.
No description provided by the author
*********** Expressions.
*********** Expressions.
IndexColumn describes a column in an index definition with optional length.
IndexDefinition describes an index in a CREATE TABLE statement.
IndexHints represents a list of index hints.
IndexInfo describes the name and type of an index in a CREATE TABLE statement.
IndexOption is used for trailing options for indexes: COMMENT, KEY_BLOCK_SIZE, USING, WITH PARSER.
Statements.
*********** Expressions.
*********** Expressions.
JoinCondition represents the join conditions (either a ON or USING clause) of a JoinTableExpr.
No description provided by the author
LengthScaleOption is used for types that have an optional length and scale.
Limit represents a LIMIT clause.
*********** Expressions.
Statements.
MarginComments holds the leading and trailing comments that surround a query.
*********** Expressions.
No description provided by the author
*********** Expressions.
*********** Expressions.
OptLike works for create table xxx like xxx.
Order represents an ordering expression.
*********** Expressions.
Statements.
Statements.
Statements.
No description provided by the author
ParsedQuery represents a parsed query where bind locations are precompued for fast substitutions.
PartitionDefinition describes a very minimal partition definition.
PartitionSpec describe partition actions (for alter and create).
PositionedErr holds context related to parser errors.
*********** Expressions.
Statements.
RewriteASTResult contains the rewritten ast and meta information about it.
Statements.
Statements.
Statements.
Statements.
Statements.
SetExpr represents a set expression.
Statements.
Statements.
ShowColumns is of ShowInternal type, holds the show columns statement.
ShowFilter is show tables filter.
ShowLegacy is of ShowInternal type, holds the legacy show ast struct.
ShowTablesOpt is show tables option.
ShowTableStatus is of ShowInternal type, holds SHOW TABLE STATUS queries.
Statements.
No description provided by the author
Statements.
No description provided by the author
*********** Expressions.
TableIdent is a case sensitive SQL identifier.
No description provided by the author
TableSpec describes the structure of a table from a CREATE TABLE statement.
*********** Expressions.
Tokenizer is the struct used to generate SQL tokens for the parser.
TrackedBuffer is used to rebuild a query from the ast.
TupleEqualityList is for generating equality constraints for tables that have composite primary keys.
*********** Expressions.
Statements.
Statements.
Statements.
UpdateExpr represents an update expression.
Statements.
*********** Expressions.
VindexParam defines a key/value parameter for a CREATE VINDEX statement.
VindexSpec defines a vindex for a CREATE VINDEX or DROP VINDEX statement.
Statements.
*********** Expressions.
Where represents a WHERE or HAVING clause.
*********** Expressions.
# Interfaces
Statements.
*********** Expressions.
No description provided by the author
Statements.
Encodable defines the interface for types that can be custom-encoded into SQL.
*********** Expressions.
InsertRows represents the rows for an INSERT statement.
No description provided by the author
Statements.
ShowInternal will represent all the show statement types.
No description provided by the author
SQLNode defines the interface for all nodes generated by the parser.
Statements.
No description provided by the author
# Type aliases
Statements.
An ApplyFunc is invoked by Rewrite for each node n, even if n is nil, before and/or after the node's children, using a Cursor describing the current node and providing operations on it.
*********** Expressions.
AtCount represents the '@' count in ColIdent.
*********** Expressions.
*********** Expressions.
ColumnKeyOption indicates whether or not the given column is defined as an index element and contains the type of the option.
Columns represents an insert column list.
CommentDirectives is the parsed representation for execution directives conveyed in query comments.
Comments represents a list of comments.
*********** Expressions.
ConvertTypeOperator is an enum for ConvertType.Operator.
Statements.
Statements.
Statements.
Exprs represents a list of value expressions.
GroupBy represents a GROUP BY clause.
Statements.
IndexHintsType is an enum for IndexHints.Type.
Statements.
InsertValues is a custom SQL encoder for the values of an insert statement.
*********** Expressions.
Statements.
No description provided by the author
*********** Expressions.
Statements.
*********** Expressions.
NodeFormatter defines the signature of a custom node formatter function that can be given to TrackedBuffer for code generation.
OnDup represents an ON DUPLICATE KEY clause.
OrderBy represents an ORDER By clause.
OrderDirection is an enum for the direction in which to order - asc or desc.
Partitions is a type alias for Columns so we can handle printing efficiently.
PartitionSpecAction is an enum for PartitionSpec.Action.
Precendence is used to know the precedence between operators, so we can introduce parens when needed in the String representation of the AST.
*********** Expressions.
ReferenceAction indicates the action takes by a referential constraint e.g.
Statements.
SelectExprs represents SELECT expressions.
Statements.
SetExprs represents a list of set expressions.
StatementType encodes the type of a SQL statement.
TableExprs represents a list of table expressions.
TableNames is a list of TableName.
*********** Expressions.
UpdateExprs represents a list of update expressions.
*********** Expressions.
ValType specifies the type for Literal.
Values represents a VALUES clause.
Visit defines the signature of a function that can be used to visit all nodes of a parse tree.
WhereType is an enum for Where.Type.