Documentation
¶
Index ¶
- type AlterTableSpec
- type AlterTableSpecKind
- type AlterTableStatement
- type Assignment
- type BatchStatement
- type ConflictClause
- type ConflictStyle
- type CreateIndexStatement
- type CreateTableColumn
- type CreateTableStatement
- type DeleteStatement
- type DropIndexStatement
- type ForeignKeyReference
- type IndexPart
- type InsertStatement
- type Join
- type LimitClause
- type RawStatement
- type ReleaseSavepointStatement
- type RenameTableStatement
- type RollbackToSavepointStatement
- type SavepointStatement
- type SelectStatement
- type SetStatement
- type SetTransactionStatement
- type ShowColumnsStatement
- type ShowCreateDatabaseStatement
- type ShowCreateTableStatement
- type ShowCreateViewStatement
- type ShowDatabasesStatement
- type ShowIndexStatement
- type ShowTableStatusStatement
- type ShowTablesStatement
- type ShowVariablesStatement
- type Statement
- type UpdateStatement
- type UseStatement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlterTableSpec ¶
type AlterTableSpec struct {
Kind AlterTableSpecKind
Column CreateTableColumn
Name string
NewName string
Default string
ConstraintName string
Parts []IndexPart
IfExists bool
IfNotExists bool
Reference ForeignKeyReference
}
AlterTableSpec is a normalized ALTER TABLE operation.
type AlterTableSpecKind ¶
type AlterTableSpecKind string
AlterTableSpecKind identifies the normalized ALTER TABLE operation kind.
const ( AlterTableSpecAddColumn AlterTableSpecKind = "add_column" AlterTableSpecDropColumn AlterTableSpecKind = "drop_column" AlterTableSpecSetDefault AlterTableSpecKind = "set_default" AlterTableSpecDropDefault AlterTableSpecKind = "drop_default" AlterTableSpecAlterType AlterTableSpecKind = "alter_type" AlterTableSpecSetNotNull AlterTableSpecKind = "set_not_null" AlterTableSpecDropNotNull AlterTableSpecKind = "drop_not_null" AlterTableSpecRenameColumn AlterTableSpecKind = "rename_column" AlterTableSpecAddPrimaryKey AlterTableSpecKind = "add_primary_key" AlterTableSpecAddUniqueKey AlterTableSpecKind = "add_unique_key" AlterTableSpecAddForeignKey AlterTableSpecKind = "add_foreign_key" AlterTableSpecDropPrimaryKey AlterTableSpecKind = "drop_primary_key" AlterTableSpecDropForeignKey AlterTableSpecKind = "drop_foreign_key" )
type AlterTableStatement ¶
type AlterTableStatement struct {
Name string
Specs []AlterTableSpec
}
AlterTableStatement is the normalized ALTER TABLE IR.
type Assignment ¶
Assignment is the normalized assignment node.
type BatchStatement ¶
type BatchStatement struct {
Statements []Statement
}
BatchStatement preserves a sequence of statements that must be rendered in order.
type ConflictClause ¶
type ConflictClause struct {
Style ConflictStyle
TargetColumns []string
Assignments []Assignment
}
ConflictClause is the normalized upsert node.
type ConflictStyle ¶
type ConflictStyle string
ConflictStyle identifies the source upsert form.
const ( // ConflictStyleMySQL represents mysql upsert semantics. ConflictStyleMySQL ConflictStyle = "mysql" // ConflictStylePostgres represents postgres upsert semantics. ConflictStylePostgres ConflictStyle = "postgres" )
type CreateIndexStatement ¶
type CreateIndexStatement struct {
Name string
Table string
Unique bool
IfNotExists bool
Parts []IndexPart
Using string
ParserName string
Where string
Comment string
Visibility string
Algorithm string
Lock string
}
CreateIndexStatement is the normalized CREATE INDEX IR.
type CreateTableColumn ¶
type CreateTableColumn struct {
Name string
Type string
NotNull bool
PrimaryKey bool
Unique bool
AutoIncrement bool
Default string
}
CreateTableColumn is a normalized CREATE TABLE column definition.
type CreateTableStatement ¶
type CreateTableStatement struct {
Name string
IfNotExists bool
Columns []CreateTableColumn
Constraints []string
}
CreateTableStatement is the normalized CREATE TABLE IR.
type DeleteStatement ¶
DeleteStatement is the normalized DELETE IR.
type DropIndexStatement ¶
DropIndexStatement is the normalized DROP INDEX IR.
type ForeignKeyReference ¶
type ForeignKeyReference struct {
Table string
Parts []IndexPart
Match string
OnDelete string
OnUpdate string
}
ForeignKeyReference is a normalized foreign-key reference definition.
type InsertStatement ¶
type InsertStatement struct {
Table string
Columns []string
Values []string
Conflict *ConflictClause
}
InsertStatement is the normalized INSERT IR.
type LimitClause ¶
LimitClause is the normalized limit node.
type RawStatement ¶
type RawStatement struct {
SQL string
}
RawStatement preserves raw SQL for pass-through rendering.
type ReleaseSavepointStatement ¶
type ReleaseSavepointStatement struct {
Name string
}
ReleaseSavepointStatement is the normalized RELEASE SAVEPOINT statement.
type RenameTableStatement ¶
RenameTableStatement is the normalized RENAME TABLE IR.
type RollbackToSavepointStatement ¶
type RollbackToSavepointStatement struct {
Name string
}
RollbackToSavepointStatement is the normalized ROLLBACK TO SAVEPOINT statement.
type SavepointStatement ¶
type SavepointStatement struct {
Name string
}
SavepointStatement is the normalized SAVEPOINT statement.
type SelectStatement ¶
type SelectStatement struct {
Columns []string
From string
Joins []Join
Where string
OrderBy []string
Limit *LimitClause
}
SelectStatement is the normalized SELECT IR.
type SetStatement ¶
SetStatement is the normalized safe subset of SET statements.
type SetTransactionStatement ¶
SetTransactionStatement is the normalized transaction isolation SET statement.
type ShowColumnsStatement ¶
type ShowColumnsStatement struct {
Table string
Database string
Full bool
Pattern string
Field string
}
ShowColumnsStatement is the normalized SHOW COLUMNS statement.
type ShowCreateDatabaseStatement ¶
ShowCreateDatabaseStatement is the normalized SHOW CREATE DATABASE statement.
type ShowCreateTableStatement ¶
ShowCreateTableStatement is the normalized SHOW CREATE TABLE statement.
type ShowCreateViewStatement ¶
ShowCreateViewStatement is the normalized SHOW CREATE VIEW statement.
type ShowDatabasesStatement ¶
ShowDatabasesStatement is the normalized SHOW DATABASES statement.
type ShowIndexStatement ¶
type ShowIndexStatement struct {
Table string
Database string
KeyName string
Column string
IndexType string
NonUnique string
SeqInIndex string
}
ShowIndexStatement is the normalized SHOW INDEX statement.
type ShowTableStatusStatement ¶
type ShowTableStatusStatement struct {
Database string
Pattern string
Name string
Comment string
Engine string
}
ShowTableStatusStatement is the normalized SHOW TABLE STATUS statement.
type ShowTablesStatement ¶
type ShowTablesStatement struct {
Database string
Full bool
Pattern string
Name string
TableType string
}
ShowTablesStatement is the normalized SHOW TABLES statement.
type ShowVariablesStatement ¶
ShowVariablesStatement is the normalized SHOW VARIABLES statement.
type Statement ¶
type Statement interface {
// contains filtered or unexported methods
}
Statement is the normalized IR statement.
type UpdateStatement ¶
type UpdateStatement struct {
Table string
Assignments []Assignment
Where string
}
UpdateStatement is the normalized UPDATE IR.
type UseStatement ¶
type UseStatement struct {
Database string
}
UseStatement is the normalized USE/current-schema statement.