# Functions
ApplyBindings replaces all `BindVar` expressions in the given sql.Node with their corresponding sql.Expression entries in the provided |bindings| map.
GetColumnFromIndexExpr returns column from the table given using the expression string given, in the form "table.column".
GetColumnsAndPrepareExpressions extracts the unique columns required by all those expressions and fixes the indexes of the GetFields in the expressions to match a row with only the returned columns in that same order.
No description provided by the author
No description provided by the author
Inspect traverses the plan in depth-first order: It starts by calling f(node); node must not be nil.
InspectExpressions traverses the plan and calls sql.Inspect on any expression it finds.
InspectExpressionsWithNode traverses the plan and calls sql.Inspect on any expression it finds.
IsBinary returns whether the node is binary or not.
No description provided by the author
IsNoRowNode returns whether this are node interacts only with schema and the catalog, not with any table rows.
No description provided by the author
IsUnary returns whether the node is unary or not.
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
NewAlterDefaultDrop returns a *AlterDefaultDrop node.
NewAlterDefaultSet returns a *AlterDefaultSet node.
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
NewBeginEndBlock creates a new *BeginEndBlock node.
NewBlock creates a new *Block node.
NewCachedResults returns a cached results plan Node, which will use a RowCache to cache results generated by Child.RowIter() and return those results for future calls to RowIter.
NewCall returns a *Call node.
No description provided by the author
NewCommit creates a new Commit node.
No description provided by the author
NewConcat creates a new Concat node with the given children.
No description provided by the author
NewCreateIndex creates a new CreateIndex node.
NewCreateProcedure returns a *CreateProcedure node.
NewCreateSavepoint creates a new CreateSavepoint node.
NewCreateTable creates a new CreateTable node.
NewCreateTableLike creates a new CreateTable node for CREATE TABLE LIKE statements.
NewCreateTableSelect create a new CreateTable node for CREATE TABLE [AS] SELECT.
No description provided by the author
NewCreateView creates a CreateView node with the specified parameters, setting its catalog to nil.
NewCrossJoin creates a new cross join node from two tables.
NewDeclareCondition returns a *DeclareCondition node.
NewDecoratedNode creates a new instance of DecoratedNode wrapping the node given, with the Deocration string given.
NewDeleteFrom creates a DeleteFrom node.
NewDescribe creates a new Describe node.
NewDescribeQuery creates a new DescribeQuery node.
NewDistinct creates a new Distinct node.
No description provided by the author
NewDropConstraint returns a new DropConstraint node.
No description provided by the author
NewDropIndex creates a new DropIndex node.
NewDropProcedure creates a new *DropProcedure node.
NewDropTable creates a new DropTable node.
NewDropTrigger creates a new NewDropTrigger node for DROP TRIGGER statements.
NewDropView creates a DropView node with the specified parameters, setting its catalog to nil.
NewDummyResolvedDB creates a new dummy database with the given name.
No description provided by the author
NewExchange creates a new Exchange node.
NewExistsSubquery created an ExistsSubquery expression.
NewFilter creates a new filter node.
NewFilterIter creates a new FilterIter.
NewGenerate creates a new generate node.
NewGroupBy creates a new GroupBy node.
NewHashLookup returns a node that performs an indexed hash lookup of cached rows for fulfilling RowIter() calls.
NewHaving creates a new having node.
NewIfConditional creates a new *IfConditional node.
NewIfElse creates a new *IfElseBlock node.
NewIndexedInSubqueryFilter returns an IndexedInSubqueryFilter sql.Node.
No description provided by the author
NewIndexedTableAccess returns a new IndexedTableAccess node with the index and key expressions given.
NewInnerJoin creates a new inner join node from two tables.
NewInsertInto creates an InsertInto node.
NewInSubquery creates an InSubquery expression.
NewLeftJoin creates a new left join node from two tables.
NewLimit creates a new Limit node with the given size.
No description provided by the author
NewLockTables creates a new LockTables node.
No description provided by the author
NewNaturalJoin returns a new NaturalJoin node.
NewNotInSubquery creates a new NotInSubquery expression.
NewOffset creates a new Offset node.
NewOrderedDistinct creates a new OrderedDistinct node.
NewProcedure returns a *Procedure.
NewProcedureResolvedTable returns a *ProcedureResolvedTable.
NewProcessIndexableTable returns a new ProcessIndexableTable.
NewProcessTable returns a new ProcessTable.
NewProject creates a new projection.
NewQueryProcess creates a new QueryProcess node.
NewReleaseSavepoint creates a new ReleaseSavepoint node.
No description provided by the author
NewRenameTable creates a new RenameTable node.
NewResolvedTable creates a new instance of ResolvedTable.
NewRightJoin creates a new right join node from two tables.
NewRollback creates a new Rollback node.
NewRollbackSavepoint creates a new RollbackSavepoint node.
NewRowUpdateResult returns a new RowUpdateResult with the given node to wrap.
NewSet creates a new Set node.
NewShowCharset returns a new ShowCharset reference.
NewShowColumns creates a new ShowColumns node.
NewShowCreateDatabase creates a new ShowCreateDatabase node.
NewShowCreateTable creates a new ShowCreateTable node.
NewShowCreateTrigger creates a new ShowCreateTrigger node for SHOW CREATE TRIGGER statements.
NewShowDatabases creates a new show databases node.
NewShowGrants creates a new ShowGrants node.
NewShowIndexes creates a new ShowIndexes node.
NewShowProcedureStatus creates a new *ShowProcedureStatus node.
NewShowProcessList creates a new ProcessList node.
NewShowStatus returns a new ShowStatus reference.
NewShowTables creates a new show tables node given a database.
NewShowTableStatus creates a new ShowTableStatus node.
NewShowCreateTrigger creates a new ShowCreateTrigger node for SHOW TRIGGER statements.
NewShowVariables returns a new ShowVariables reference.
NewSignal returns a *Signal node.
NewSignalName returns a *SignalName node.
NewSingleDropView creates a SingleDropView.
NewSort creates a new Sort node.
NewStartTransaction creates a new StartTransaction node.
NewStaticIndexedTableAccess returns a new IndexedTableAccess node with the indexlookup given.
No description provided by the author
NewSubquery returns a new subquery expression.
NewSubqueryAlias creates a new SubqueryAlias node.
NewTableAlias returns a new Table alias node.
No description provided by the author
NewTableEditorIter returns a new *tableEditorIter by wrapping the given iterator.
TransformedNamedNode is a wrapper for arbitrary logic to represent a table factor assembled from other nodes at some point in by the analyzer.
NewTriggerBeginEndBlock creates a new *TriggerBeginEndBlock node.
No description provided by the author
NewTruncate creates a Truncate node.
NewUnion creates a new Union node with the given children.
NewUnlockTables returns a new UnlockTables node.
NewUnresolvedTable creates a new Unresolved table.
NewUnresolvedTableAsOf creates a new Unresolved table with an AS OF expression.
NewUpdate creates an Update node.
NewUpdateJoin returns an *UpdateJoin node.
NewUpdateSource returns a new UpdateSource from the node and expressions given.
NewUse creates a new Use node.
No description provided by the author
NewValues creates a Values node with the given tuples.
No description provided by the author
No description provided by the author
NillaryNode is a node with no children.
ProjectRow evaluates a set of projections.
TransformExpressions applies a transformation function to all expressions on the given node.
TransformExpressionsUp applies a transformation function to all expressions on the given tree from the bottom up.
TransformExpressionsUp applies a transformation function to all expressions on the given tree from the bottom up.
TransformExpressions applies a transformation function to all expressions on the given node.
TransformUp applies a transformation function to the given tree from the bottom up.
TransformUpCtx transforms |n| from the bottom up, left to right, by passing each node to |f|.
Walk traverses the plan tree in depth-first order.
WalkExpressions traverses the plan and calls sql.Walk on any expression it finds.
WalkExpressionsWithNode traverses the plan and calls sql.WalkWithNode on any expression it finds.
# Constants
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
ProcedureParamDirection_In means the parameter passes its contained value to the stored procedure.
ProcedureParamDirection_Inout means the parameter passes its contained value to the stored procedure, while also modifying the given variable.
ProcedureParamDirection_Out means the parameter variable will be modified, but will not be read from within the stored procedure.
ProcedureSecurityContext_Definer uses the definer's security context.
ProcedureSecurityContext_Invoker uses the invoker's security context.
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
# Variables
DescribeSchema is the schema returned by a DescribeQuery node.
EmptyTable is a node representing an empty table.
ErrAddForeignKeyDuplicateColumn is returned when an ALTER TABLE ADD FOREIGN KEY statement has the same column multiple times.
ErrAlterTableNotSupported is thrown when the database doesn't support ALTER TABLE statements.
No description provided by the author
ErrCheckFailed is returned when the check constraint evaluates to false.
ErrCreateIndexDuplicateColumn is returned when a CREATE INDEX statement has the same column multiple times.
ErrCreateIndexMissingColumns is returned when a CREATE INDEX statement does not provide any columns.
ErrCreateIndexNonExistentColumn is returned when a key is provided in the index that isn't in the table.
ErrCreateTable is thrown when the database doesn't support table creation.
No description provided by the author
ErrDropTableNotSupported is thrown when the database doesn't support dropping tables.
ErrExprTypeNotIndexable is returned when the expression type cannot be indexed, such as BLOB or JSON.
ErrForeignKeyMissingColumns is returned when an ALTER TABLE ADD FOREIGN KEY statement does not provide any columns.
ErrGroupBy is returned when the aggregation is not supported.
ErrIndexActionNotImplemented is returned when the action has not been implemented.
ErrIndexNotAvailable is returned when trying to delete an index that is still not ready for usage.
ErrIndexNotFound is returned when the index cannot be found.
Used for making sure the row accumulator is correct.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrInsertIntoNotSupported is thrown when a table doesn't support inserts.
No description provided by the author
ErrInvalidIndexDriver is returned when the index driver can't be found.
ErrNoCheckConstraintSupport is returned when the table does not support CONSTRAINT CHECK operations.
ErrNoForeignKeySupport is returned when the table does not support FOREIGN KEY operations.
No description provided by the author
No description provided by the author
ErrNoPartitionable is returned when no Partitionable node is found in the Exchange tree.
ErrNotIndexable is returned when the table is not indexable.
ErrNotPrimaryKeyAlterable is return when a table cannot be determines to be primary key alterable.
No description provided by the author
ErrNullDefault is thrown when a non-null column is added with a null default.
No description provided by the author
ErrRenameTableNotSupported is thrown when the database doesn't support renaming tables.
No description provided by the author
ErrTableCreatedNotFound is thrown when a table is created from CREATE TABLE but cannot be found immediately afterward.
ErrTableNotLockable is returned whenever a lockable table can't be found.
ErrTableNotNameable is returned when the table is not nameable.
ErrTableNotValid is returned when the table is not valid.
ErrTemporaryTablesForeignKeySupport is returns when a user tries to create a temporary table with a foreign key.
No description provided by the author
ErrUnresolvedTable is thrown when a table cannot be resolved.
No description provided by the author
No description provided by the author
cc: https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sql-mode-strict The INSERT IGNORE syntax applies to these ignorable errors ER_BAD_NULL_ERROR - yes ER_DUP_ENTRY - yes ER_DUP_ENTRY_WITH_KEY_NAME - Yes ER_DUP_KEY - kinda ER_NO_PARTITION_FOR_GIVEN_VALUE - yes ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT - No ER_NO_REFERENCED_ROW_2 - Yes ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET - No ER_ROW_IS_REFERENCED_2 - Yes ER_SUBQUERY_NO_1_ROW - yes ER_VIEW_CHECK_FAILED - No.
Nothing is a node that will return no rows.
# Structs
No description provided by the author
No description provided by the author
AlterDefaultDrop represents the ALTER COLUMN DROP DEFAULT statement.
AlterDefaultSet represents the ALTER COLUMN SET DEFAULT statement.
No description provided by the author
No description provided by the author
BeginEndBlock represents a BEGIN/END block.
BinaryNode is a node with two children.
Block represents a collection of statements that should be executed in sequence.
No description provided by the author
No description provided by the author
Commit commits the changes performed in a transaction.
No description provided by the author
Concat is a node that returns everything in Left and then everything in Right, but it excludes any results in Right that already appeared in Left.
No description provided by the author
No description provided by the author
CreateDB creates an in memory database that lasts the length of the process only.
No description provided by the author
CreateIndex is a node to create an index.
No description provided by the author
No description provided by the author
CreateTable is a node describing the creation of some table.
No description provided by the author
CreateView is a node representing the creation (or replacement) of a view, which is defined by the Child node.
CrossJoin is a cross join between two tables.
DeclareCondition represents the DECLARE ..
DecoratedNode represents a plan node that has been decorated to illustrate some aspect of the query plan.
DeleteFrom is a node describing a deletion from some table.
Describe is a node that describes its children.
DescribeQuery returns the description of the query plan.
Distinct is a node that ensures all rows that come from it are unique.
No description provided by the author
No description provided by the author
DropConstraint is a temporary node to handle dropping a named constraint on a table.
DropDB removes a databases from the Catalog and updates the active database if it gets removed itself.
No description provided by the author
DropIndex is a node to drop an index.
No description provided by the author
DropTable is a node describing dropping one or more tables.
No description provided by the author
DropView is a node representing the removal of a list of views, defined by the children member.
DummyResolvedDB is a transient database useful only for instances where a database is not available but required.
No description provided by the author
Exchange is a node that can parallelize the underlying tree iterating partitions concurrently.
ExistsSubquery is an expression that checks that a subquery returns a non-empty result set.
Filter skips rows that don't match a certain expression.
FilterIter is an iterator that filters another iterator and skips rows that don't match the given condition.
Generate will explode rows using a generator.
GroupBy groups the rows by some expressions.
No description provided by the author
Having node is a filter that supports aggregate expressions.
IfConditional represents IF statements only.
IfElseBlock represents IF/ELSE IF/ELSE statements.
No description provided by the author
No description provided by the author
An IndexedJoin is a join that uses index lookups for the secondary table.
IndexedTableAccess represents an indexed lookup of a particular ResolvedTable.
InnerJoin is an inner join between two tables.
InsertInto is a node describing the insertion into some table.
InSubquery is an expression that checks an expression is in the result of a subquery.
LeftJoin is a left join between two tables.
Limit is a node that only allows up to N rows to be retrieved.
No description provided by the author
LockTables will lock tables for the session in which it's executed.
No description provided by the author
NaturalJoin is a join that automatically joins by all the columns with the same name.
Offset is a node that skips the first N rows.
OrderedDistinct is a Distinct node optimized for sorted row sets.
Procedure is a stored procedure that may be executed using the CALL statement.
ProcedureParam represents the parameter of a stored procedure.
ProcedureResolvedTable represents a resolved SQL Table inside of a stored procedure.
ProcessIndexableTable is a wrapper for sql.Tables inside a query process that support indexing.
ProcessTable is a wrapper for sql.Tables inside a query process.
Project is a projection of certain expression from the children node.
QueryProcess represents a running query process node.
No description provided by the author
No description provided by the author
No description provided by the author
ResolvedTable represents a resolved SQL Table.
RightJoin is a left join between two tables.
Rollback undoes the changes performed in the current transaction.
No description provided by the author
RowUpdateAccumulator wraps other nodes that update tables, and returns their results as OKResults with the appropriate fields set.
Set represents a set statement.
No description provided by the author
ShowColumns shows the columns details of a table.
ShowCreateDatabase returns the SQL for creating a database.
ShowCreateTable is a node that shows the CREATE TABLE statement for a table.
No description provided by the author
ShowDatabases is a node that shows the databases.
ShowGrants shows the columns details of a table.
ShowIndexes is a node that shows the indexes on a table.
No description provided by the author
ShowProcessList shows a list of all current running processes.
ShowStatus implements the SHOW STATUS MySQL command.
ShowTables is a node that shows the database tables.
ShowTableStatus returns the status of the tables in a database.
No description provided by the author
ShowVariables is a node that shows the global and session variablesTODO: implement the GLOBAL and SESSION distinction.
Signal represents the SIGNAL statement with a set SQLSTATE.
SignalInfo represents a piece of information for a SIGNAL statement.
SignalName represents the SIGNAL statement with a condition name.
No description provided by the author
Sort is the sort node.
StartTransaction explicitly starts a transaction.
No description provided by the author
Subquery is as an expression whose value is derived by executing a subquery.
SubqueryAlias is a node that gives a subquery a name.
TableAlias is a node that acts as a table with a given name.
TableCopier is a supporting node that allows for the optimization of copying tables.
TableLock is a read or write lock on a table.
TableSpec is a node describing the schema of a table.
TransformContext is the parameter to the Transform{,Selector}.
No description provided by the author
TriggerBeginEndBlock represents a BEGIN/END block specific to TRIGGER execution, which has special considerations regarding logic execution through the RowIter function.
TriggerExecutor is node that wraps, or is wrapped by, an INSERT, UPDATE, or DELETE node to execute defined trigger logic either before or after that operation.
No description provided by the author
Truncate is a node describing the deletion of all rows from some table.
UnaryNode is a node that has only one child.
Union is a node that returns everything in Left and then everything in Right.
UnlockTables will release all locks for the current session.
UnresolvedTable is a table that has not been resolved yet but whose name is known.
Update is a node for updating rows on tables.
UpdateInfo is the Info for OKResults returned by Update nodes.
No description provided by the author
UpdateSource is the source of updates for an Update node.
Use changes the current database.
No description provided by the author
Values represents a set of tuples of expressions.
No description provided by the author
With is a node to wrap the top-level node in a query plan so that any common table expressions can be applied in analysis.
# Interfaces
BlockRowIter is an iterator that produces rows.
No description provided by the author
No description provided by the author
Visitor visits nodes in the plan.
# Type aliases
Characteristic represents a characteristic that is defined on either a stored procedure or stored function.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NamedNotifyFunc is a function to notify about some event with a string argument.
NotifyFunc is a function to notify about some event.
No description provided by the author
ProcedureParamDirection represents the use case of the stored procedure parameter.
ProcedureSecurityContext determines whether the stored procedure is executed using the privileges of the definer or the invoker.
No description provided by the author
No description provided by the author
ShowWarnings is a node that shows the session warnings.
SignalConditionItemName represents the item name for the set conditions of a SIGNAL statement.
No description provided by the author
Transformer is a function which will return new sql.Node values for a given TransformContext.
TransformSelector is a function which will allow TransformUpCtx to not traverse past a certain TransformContext.
No description provided by the author
No description provided by the author