Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractMysqlComment(sql string) (version string, innerSQL string)
- func KeywordString(id int) string
- func SplitStatement(blob string) (string, string, error)
- func SplitStatementToPieces(blob string) (pieces []string, err error)
- func String(node SQLNode) string
- func StripLeadingComments(sql string) string
- type AliasedExpr
- type AliasedTableExpr
- type AndExpr
- type ArrayConstructor
- type ArrayElement
- type ArrayElements
- type Begin
- type BeginEnd
- type BinaryExpr
- type BoolVal
- type CaseExpr
- type CastExpr
- type CheckDefinition
- type ColIdent
- func (node ColIdent) CompliantName() string
- func (node ColIdent) Equal(in ColIdent) bool
- func (node ColIdent) EqualString(str string) bool
- func (node ColIdent) Format(buf *TrackedBuffer)
- func (node ColIdent) IsEmpty() bool
- func (node ColIdent) Lowered() string
- func (node ColIdent) MarshalJSON() ([]byte, error)
- func (node ColIdent) String() string
- func (node *ColIdent) UnmarshalJSON(b []byte) error
- type ColName
- type ColTuple
- type CollateExpr
- type ColumnDefinition
- type ColumnKeyOption
- type ColumnType
- type Columns
- type Comment
- type CommentDirectives
- type Comments
- type Commit
- type ComparisonExpr
- type ConstraintOptions
- type ConvertExpr
- type ConvertType
- type ConvertUsingExpr
- type Cursor
- type CursorDefinition
- type DBDDL
- type DDL
- type Declare
- type DeclareType
- type Default
- type DefaultDefinition
- type DefaultValueOrExpression
- type Delete
- type ExistsExpr
- type Expr
- type Exprs
- type Extension
- type ForeignKeyDefinition
- type FuncCallExpr
- type FuncExpr
- type GeneratedColumn
- type GroupBy
- type GroupConcatExpr
- type IdentityOpt
- type If
- type IndexColumn
- type IndexColumnsOrExpression
- type IndexDefinition
- type IndexHints
- type IndexInfo
- type IndexOption
- type IndexPartition
- type IndexSpec
- type Insert
- type InsertRows
- type IntervalExpr
- type IsExpr
- type JoinCondition
- type JoinTableExpr
- type LengthScaleOption
- type Limit
- type ListArg
- type LocalVariable
- type MarginComments
- type MatchExpr
- type NewQualifierColName
- type NextSeqValExpr
- type NodeFormatter
- type NotExpr
- type NullVal
- type OnDup
- type OrExpr
- type Order
- type OrderBy
- type OtherAdmin
- type OtherRead
- type OverExpr
- type ParenExpr
- type ParenSelect
- type ParenTableExpr
- type ParserMode
- type Partition
- type PartitionBy
- type PartitionDefinition
- type PartitionSpec
- type Partitions
- type Permissive
- type Policy
- type RangeCond
- type Rollback
- type SQLNode
- type SQLVal
- func NewBitVal(in []byte) *SQLVal
- func NewBoolSQLVal(in bool) *SQLVal
- func NewFloatVal(in []byte) *SQLVal
- func NewHexNum(in []byte) *SQLVal
- func NewHexVal(in []byte) *SQLVal
- func NewIntVal(in []byte) *SQLVal
- func NewStrVal(in []byte) *SQLVal
- func NewUnicodeStrVal(in []byte) *SQLVal
- func NewValArg(in []byte) *SQLVal
- func NewValArgWithOpt(in []byte, opt *SQLVal) *SQLVal
- type Select
- type SelectExpr
- type SelectExprs
- type SelectStatement
- type Sequence
- type Set
- type SetBoolOption
- type SetExpr
- type SetExprs
- type Show
- type ShowFilter
- type ShowTablesOpt
- type SimpleTableExpr
- type SridDefinition
- type StarExpr
- type Statement
- type Stream
- type Subquery
- type SubstrExpr
- type TableExpr
- type TableExprs
- type TableIdent
- type TableName
- type TableNames
- type TableSpec
- type Tokenizer
- type TrackedBuffer
- type Trigger
- type Type
- type UnaryExpr
- type Union
- type Update
- type UpdateExpr
- type UpdateExprs
- type Use
- type ValTuple
- type ValType
- type Values
- type ValuesFuncExpr
- type View
- type VindexParam
- type VindexSpec
- type When
- type Where
- type While
Constants ¶
const ( DistinctStr = "distinct " StraightJoinHint = "straight_join " )
Select.Distinct
const ( ForUpdateStr = " for update" )
Select.Lock
const ( SQLCacheStr = "sql_cache " SQLNoCacheStr = "sql_no_cache " )
Select.Cache
const ( UnionStr = "union" UnionAllStr = "union all" UnionDistinctStr = "union distinct" )
Union.Type
const ( InsertStr = "insert" ReplaceStr = "replace" )
DDL strings.
const ( SessionStr = "session" GlobalStr = "global" )
Set.Scope or Show.Scope
const ( CreateStr = "create" AlterStr = "alter" DropStr = "drop" RenameStr = "rename" TruncateStr = "truncate" CreateVindexStr = "create vindex" AddColVindexStr = "add vindex" DropColVindexStr = "drop vindex" AddIndexStr = "add index" CreateIndexStr = "create index" AddPrimaryKeyStr = "add primary key" AddForeignKeyStr = "add foreign key" CreatePolicyStr = "create policy" CreateViewStr = "create view" CreateMatViewStr = "create materialized view" CreateSqlSecurityStr = "create sql security" CreateTriggerStr = "create trigger" CreateTypeStr = "create type" CommentStr = "comment" CreateExtensionStr = "create extension" )
DDL strings.
const ( JoinStr = "join" StraightJoinStr = "straight_join" LeftJoinStr = "left join" RightJoinStr = "right join" NaturalJoinStr = "natural join" NaturalLeftJoinStr = "natural left join" NaturalRightJoinStr = "natural right join" )
JoinTableExpr.Join
const ( UseStr = "use " IgnoreStr = "ignore " ForceStr = "force " )
Index hints.
const ( WhereStr = "where" HavingStr = "having" )
Where.Type
const ( EqualStr = "=" LessThanStr = "<" GreaterThanStr = ">" LessEqualStr = "<=" GreaterEqualStr = ">=" NotEqualStr = "!=" NullSafeEqualStr = "<=>" InStr = "in" NotInStr = "not in" LikeStr = "like" NotLikeStr = "not like" RegexpStr = "regexp" NotRegexpStr = "not regexp" JSONExtractOp = "->" JSONUnquoteExtractOp = "->>" PosixRegexStr = "~" PosixRegexCiStr = "~*" PosixNotRegexStr = "!~" PosixNotRegexCiStr = "!~*" )
ComparisonExpr.Operator
const ( BetweenStr = "between" NotBetweenStr = "not between" )
RangeCond.Operator
const ( IsNullStr = "is null" IsNotNullStr = "is not null" IsTrueStr = "is true" IsNotTrueStr = "is not true" IsFalseStr = "is false" IsNotFalseStr = "is not false" )
IsExpr.Operator
const ( StrVal = ValType(iota) IntVal FloatVal HexNum HexVal ValArg BitVal ValBool UnicodeStrVal )
These are the possible Valtype values. HexNum represents a 0x... value. It cannot be treated as a simple value because it can be interpreted differently depending on the context.
const ( BitAndStr = "&" BitOrStr = "|" BitXorStr = "^" PlusStr = "+" MinusStr = "-" MultStr = "*" DivStr = "/" IntDivStr = "div" ModStr = "%" ShiftLeftStr = "<<" ShiftRightStr = ">>" )
BinaryExpr.Operator
const ( UPlusStr = "+" UMinusStr = "-" TildaStr = "~" BangStr = "!" BinaryStr = "binary " UBinaryStr = "_binary " )
UnaryExpr.Operator
const ( BooleanModeStr = " in boolean mode" NaturalLanguageModeStr = " in natural language mode" NaturalLanguageModeWithQueryExpansionStr = " in natural language mode with query expansion" QueryExpansionStr = " with query expansion" )
MatchExpr.Option
const ( AscScr = "asc" DescScr = "desc" )
Order.Direction and IndexColumn.Direction
const ( OpenStr = "open" CloseStr = "close" DeallocateStr = "deallocate" FetchStr = "fetch" )
const ( ParserModeMysql = ParserMode(iota) ParserModePostgres ParserModeSQLite3 ParserModeMssql )
const ACTION = 57496
const ADD = 57452
const AFTER = 57510
const AGAINST = 57670
const ALL = 57363
const ALLOW_PAGE_LOCKS = 57508
const ALLOW_ROW_LOCKS = 57507
const ALTER = 57448
const ALWAYS = 57682
const ANALYZE = 57451
const AND = 57416
const ANSI_DEFAULTS = 57637
const ANSI_NULLS = 57640
const ANSI_NULL_DFLT_OFF = 57638
const ANSI_NULL_DFLT_ON = 57639
const ANSI_PADDING = 57641
const ANSI_WARNINGS = 57642
const APPROXNUM = 57600
const ARITHABORT = 57632
const ARRAY = 57593
const AS = 57365
const ASC = 57367
const AUTOINCREMENT = 57605
const AUTO_INCREMENT = 57599
const BEFORE = 57509
const BEGIN = 57531
const BETWEEN = 57418
const BIGINT = 57544
const BIGSERIAL = 57545
const BINARY = 57442
const BIT = 57536
const BIT_LITERAL = 57409
const BLOB = 57577
const BOOL = 57565
const BOOLEAN = 57671
const BPCHAR = 57596
const BY = 57358
const CACHE = 57687
const CASCADE = 57494
const CASE = 57419
const CAST = 57661
const CHAR = 57562
const CHARACTER = 57566
const CHARSET = 57616
const CHECK = 57705
const CITEXT = 57576
const CLOSE = 57516
const CLUSTERED = 57691
const COLLATE = 57441
const COLUMN = 57462
const COLUMNSTORE = 57694
const COMMENT = 57407
const COMMENT_KEYWORD = 57408
const COMMIT = 57534
const COMMITTED = 57625
const CONCAT_NULL_YIELDS_NULL = 57629
const CONCURRENTLY = 57528
const CONSTRAINT = 57463
const CONVERT = 57660
const CREATE = 57447
const CROSS = 57392
const CURRENT_DATE = 57652
const CURRENT_TIME = 57653
const CURRENT_TIMESTAMP = 57650
const CURRENT_USER = 57500
const CURSOR = 57514
const CURSOR_CLOSE_ON_COMMIT = 57630
const CYCLE = 57688
const (
CharacterSetStr = " character set"
)
this string is "character set" and this comment is required
const DATABASE = 57651
const DATABASES = 57606
const DATE = 57476
const DATETIME = 57557
const DATETIME2 = 57560
const DATETIMEOFFSET = 57559
const DEALLOCATE = 57521
const DECIMAL = 57551
const DECLARE = 57362
const DEFAULT = 57371
const DEFERRABLE = 57524
const DEFERRED = 57527
const DEFINER = 57702
const DELETE = 57352
const DESC = 57368
const DESCRIBE = 57474
const DISTINCT = 57364
const DIV = 57438
const DOUBLE = 57548
const DROP = 57449
const DUPLICATE = 57370
const EACH = 57511
const ELSE = 57422
const END = 57423
const ENUM = 57583
const ESCAPE = 57477
const EXISTS = 57366
const EXPANSION = 57677
const EXPLAIN = 57475
const EXTENDED = 57612
const FALSE = 57412
const FETCH = 57517
const FILLFACTOR = 57503
const FIRST = 57519
const FLOAT = 57403
const FLOAT_TYPE = 57550
const FMTONLY = 57633
const FOR = 57361
const FORCE = 57395
const FORCEPLAN = 57643
const FOREIGN = 57467
const FROM = 57353
const FULL = 57613
const FULLTEXT = 57466
const GE = 57425
const GENERATED = 57681
const GEOMETRY = 57584
const GEOMETRYCOLLECTION = 57588
const GETDATE = 57595
const GLOBAL = 57617
const GROUP = 57355
const GROUP_CONCAT = 57664
const HAVING = 57356
const HEX = 57399
const HEXNUM = 57404
const HOLDLOCK = 57696
const ID = 57398
const IDENTITY = 57683
const IF = 57460
const IGNORE = 57459
const IGNORE_DUP_KEY = 57504
const IMMEDIATE = 57526
const IMPLICIT_TRANSACTIONS = 57647
const IN = 57431
const INCLUDE = 57695
const INCREMENT = 57685
const INDEX = 57455
const INHERIT = 57666
const INITIALLY = 57525
const INNER = 57390
const INSERT = 57350
const INSTEAD = 57522
const INT = 57541
const INTEGER = 57542
const INTEGRAL = 57402
const INTERVAL = 57444
const INTNUM = 57546
const INTO = 57369
const INVOKER = 57703
const IS = 57428
const ISOLATION = 57619
const JOIN = 57386
const JSON = 57581
const JSONB = 57582
const JSON_EXTRACT_OP = 57445
const JSON_UNQUOTE_EXTRACT_OP = 57446
const KEY = 57472
const KEYS = 57375
const KEY_BLOCK_SIZE = 57468
const LAG = 57668
const LANGUAGE = 57672
const LAST = 57520
const LAST_INSERT_ID = 57379
const LE = 57424
const LEAD = 57667
const LEFT = 57388
const LESS = 57484
const LEVEL = 57620
const LEX_ERROR = 57346
const LIKE = 57429
const LIMIT = 57359
const LINESTRING = 57586
const LIST_ARG = 57406
const LOCALTIME = 57654
const LOCALTIMESTAMP = 57655
const LOCK = 57374
const LONGBLOB = 57580
const LONGTEXT = 57575
const MATCH = 57669
const MATERIALIZED = 57456
const MAX = 57414
const MAXVALUE = 57481
const MEDIUMBLOB = 57579
const MEDIUMINT = 57540
const MEDIUMTEXT = 57574
const MINVALUE = 57686
const MOD = 57439
const MODE = 57383
const MONEY = 57554
const MULTILINESTRING = 57590
const MULTIPOINT = 57589
const MULTIPOLYGON = 57591
const NAMES = 57615
const NATURAL = 57393
const NCHAR = 57568
const NE = 57426
const NEW = 57628
const NEXT = 57380
const NO = 57495
const NOCOUNT = 57634
const NOEXEC = 57635
const NOLOCK = 57697
const NONCLUSTERED = 57692
const NONE = 57690
const NOT = 57417
const NOW = 57594
const NOWAIT = 57698
const NTEXT = 57570
const NULL = 57410
const NULLX = 57598
const NULL_SAFE_EQUAL = 57427
const NUMERIC = 57552
const NUMERIC_ROUNDABORT = 57636
const NVARCHAR = 57569
const OF = 57523
const OFF = 57413
const OFFSET = 57360
const ON = 57396
const ONLY = 57623
const OPEN = 57515
const OPTIMIZE = 57479
const OR = 57415
const ORDER = 57357
const OUTER = 57391
const OVER = 57706
const OWNED = 57689
const PAD_INDEX = 57502
const PAGLOCK = 57699
const PARSER = 57675
const PARTITION = 57482
const PERMISSIVE = 57497
const POINT = 57585
const POLICY = 57469
const POLYGON = 57587
const POSIX_NOT_REGEX = 57434
const POSIX_NOT_REGEX_CI = 57435
const POSIX_REGEX = 57432
const POSIX_REGEX_CI = 57433
const PRECISION = 57549
const PRIMARY = 57461
const PRIOR = 57518
const PROCEDURE = 57486
const PROCESSLIST = 57614
const PUBLIC = 57499
const QUERY = 57676
const QUOTED_IDENTIFIER = 57631
const READ = 57621
const REAL = 57547
const REFERENCES = 57464
const REGEXP = 57430
const REMOTE_PROC_TRANSACTIONS = 57648
const RENAME = 57450
const REORGANIZE = 57483
const REPAIR = 57478
const REPEATABLE = 57624
const REPLACE = 57659
const REPLICATION = 57693
const RESTRICT = 57493
const RESTRICTIVE = 57498
const RIGHT = 57389
const ROLLBACK = 57535
const ROW = 57512
const ROWID = 57376
const ROWLOCK = 57700
const (
ReorganizeStr = "reorganize partition"
)
Partition strings
const SCHEMA = 57453
const SCROLL = 57513
const SECURITY = 57530
const SELECT = 57348
const SEPARATOR = 57665
const SEQUENCE = 57684
const SERIAL = 57543
const SERIALIZABLE = 57627
const SESSION = 57618
const SESSION_USER = 57501
const SET = 57373
const SHARE = 57382
const SHIFT_LEFT = 57436
const SHIFT_RIGHT = 57437
const SHOW = 57473
const SHOWPLAN_ALL = 57644
const SHOWPLAN_TEXT = 57645
const SHOWPLAN_XML = 57646
const SIGNED = 57601
const SMALLDATETIME = 57561
const SMALLINT = 57538
const SMALLMONEY = 57553
const SMALLSERIAL = 57539
const SPATIAL = 57465
const SQL = 57529
const SQL_CACHE = 57385
const SQL_NO_CACHE = 57384
const SRID = 57372
const START = 57532
const STATISTICS_INCREMENTAL = 57506
const STATISTICS_NORECOMPUTE = 57505
const STATUS = 57491
const STORED = 57680
const STRAIGHT_JOIN = 57387
const STREAM = 57349
const STRICT = 57377
const STRING = 57400
const SUBSTR = 57662
const SUBSTRING = 57663
const TABLE = 57454
const TABLELOCK = 57701
const TABLES = 57607
const TEXT = 57572
const TEXT_PATTERN_OPS = 57597
const THAN = 57485
const THEN = 57421
const TIME = 57555
const TIMESTAMP = 57556
const TINYBLOB = 57578
const TINYINT = 57537
const TINYTEXT = 57573
const TO = 57458
const TRANSACTION = 57533
const TRIGGER = 57487
const TRUE = 57411
const TRUNCATE = 57480
const TYPE = 57488
const TYPECAST = 57704
const UNARY = 57440
const UNCOMMITTED = 57626
const UNDERSCORE_BINARY = 57443
const UNICODE_STRING = 57401
const UNION = 57347
const UNIQUE = 57471
const UNSIGNED = 57602
const UNUSED = 57678
const UPDATE = 57351
const USE = 57394
const USING = 57397
const UTC_DATE = 57656
const UTC_TIME = 57657
const UTC_TIMESTAMP = 57658
const UUID = 57571
const VALUE = 57381
const VALUES = 57378
const VALUE_ARG = 57405
const VARBINARY = 57567
const VARCHAR = 57563
const VARIABLES = 57492
const VARIADIC = 57592
const VARYING = 57564
const VIEW = 57457
const VINDEX = 57489
const VINDEXES = 57490
const VIRTUAL = 57679
const VITESS_KEYSPACES = 57608
const VITESS_SHARDS = 57609
const VITESS_TABLETS = 57610
const VSCHEMA_TABLES = 57611
const WHEN = 57420
const WHERE = 57354
const WHILE = 57470
const WITH = 57673
const WITHOUT = 57674
const WRITE = 57622
const XACT_ABORT = 57649
const YEAR = 57558
const ZEROFILL = 57603
const ZONE = 57604
Variables ¶
var Aggregates = map[string]bool{ "avg": true, "bit_and": true, "bit_or": true, "bit_xor": true, "count": true, "group_concat": true, "max": true, "min": true, "std": true, "stddev_pop": true, "stddev_samp": true, "stddev": true, "sum": true, "var_pop": true, "var_samp": true, "variance": true, "lead": true, "lag": true, }
Aggregates is a map of all aggregate functions.
Functions ¶
func ExtractMysqlComment ¶
ExtractMysqlComment extracts the version and SQL from a comment-only query such as /*!50708 sql here */
func KeywordString ¶
KeywordString returns the string corresponding to the given keyword
func SplitStatement ¶
SplitStatement returns the first sql statement up to either a ; or EOF and the remainder from the given buffer
func SplitStatementToPieces ¶
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
func StripLeadingComments ¶
StripLeadingComments trims the SQL string and removes any leading comments
Types ¶
type AliasedExpr ¶
AliasedExpr defines an aliased SELECT expression.
func (*AliasedExpr) Format ¶
func (node *AliasedExpr) Format(buf *TrackedBuffer)
Format formats the node.
type AliasedTableExpr ¶
type AliasedTableExpr struct { Expr SimpleTableExpr Partitions Partitions As TableIdent TableHints []string IndexHints *IndexHints }
AliasedTableExpr represents a table expression coupled with an optional alias or index hint. If As is empty, no alias was used.
func (*AliasedTableExpr) Format ¶
func (node *AliasedTableExpr) Format(buf *TrackedBuffer)
Format formats the node.
func (*AliasedTableExpr) RemoveHints ¶
func (node *AliasedTableExpr) RemoveHints() *AliasedTableExpr
RemoveHints returns a new AliasedTableExpr with the hints removed.
type ArrayConstructor ¶
type ArrayConstructor struct {
Elements ArrayElements
}
func (*ArrayConstructor) Format ¶
func (node *ArrayConstructor) Format(buf *TrackedBuffer)
type ArrayElement ¶
type ArrayElement interface { SQLNode // contains filtered or unexported methods }
type ArrayElements ¶
type ArrayElements []ArrayElement
func (ArrayElements) Format ¶
func (node ArrayElements) Format(buf *TrackedBuffer)
type BeginEnd ¶
type BeginEnd struct {
Statements []Statement
}
func (*BeginEnd) Format ¶
func (node *BeginEnd) Format(buf *TrackedBuffer)
type BinaryExpr ¶
BinaryExpr represents a binary value expression.
func (*BinaryExpr) Format ¶
func (node *BinaryExpr) Format(buf *TrackedBuffer)
Format formats the node.
type CastExpr ¶ added in v0.12.3
type CastExpr struct { Expr Expr Type *ConvertType }
CastExpr represents expr::type
func (*CastExpr) Format ¶ added in v0.12.3
func (node *CastExpr) Format(buf *TrackedBuffer)
type CheckDefinition ¶
type ColIdent ¶
type ColIdent struct {
// contains filtered or unexported fields
}
ColIdent is a case insensitive SQL identifier. It will be escaped with backquotes if necessary.
func (ColIdent) CompliantName ¶
CompliantName returns a compliant id name that can be used for a bind var.
func (ColIdent) EqualString ¶
EqualString performs a case-insensitive compare with str.
func (ColIdent) Lowered ¶
Lowered returns a lower-cased column name. This function should generally be used only for optimizing comparisons.
func (ColIdent) MarshalJSON ¶
MarshalJSON marshals into JSON.
func (ColIdent) String ¶
String returns the unescaped column name. It must not be used for SQL generation. Use parser.String instead. The Stringer conformance is for usage in templates.
func (*ColIdent) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type ColName ¶
type ColName struct { // Metadata is not populated by the parser. // It's a placeholder for analyzers to store // additional data, typically info about which // table or column this node references. Metadata interface{} Name ColIdent Qualifier TableName }
ColName represents a column name.
type ColTuple ¶
type ColTuple interface { Expr // contains filtered or unexported methods }
ColTuple represents a list of column values. It can be ValTuple, Subquery, ListArg.
type CollateExpr ¶
CollateExpr represents dynamic collate operator.
func (*CollateExpr) Format ¶
func (node *CollateExpr) Format(buf *TrackedBuffer)
Format formats the node.
type ColumnDefinition ¶
type ColumnDefinition struct { Name ColIdent Type ColumnType }
ColumnDefinition describes a column in a CREATE TABLE statement
func (*ColumnDefinition) Format ¶
func (col *ColumnDefinition) Format(buf *TrackedBuffer)
Format formats the node.
type ColumnKeyOption ¶
type ColumnKeyOption int
ColumnKeyOption indicates whether or not the given column is defined as an index element and contains the type of the option
type ColumnType ¶
type ColumnType struct { // The base type string Type string // Generic field options. NotNull *BoolVal Autoincrement BoolVal Default *DefaultDefinition Srid *SridDefinition OnUpdate *SQLVal Comment *SQLVal Check *CheckDefinition Array BoolVal // Numeric field options Length *SQLVal Unsigned BoolVal Zerofill BoolVal Scale *SQLVal DisplayWidth *SQLVal // Text field options Charset string Collate string // Timestamp field options Timezone BoolVal // Enum values EnumValues []string // Key specification KeyOpt ColumnKeyOption References string ReferenceNames Columns ReferenceOnDelete ColIdent ReferenceOnUpdate ColIdent // MySQL: GENERATED ALWAYS AS (expr) Generated *GeneratedColumn // PostgreSQL: GENERATED AS IDENTITY Identity *IdentityOpt }
ColumnType represents a sql type in a CREATE TABLE statement All optional fields are nil if not specified
func (*ColumnType) DescribeType ¶
func (ct *ColumnType) DescribeType() string
DescribeType returns the abbreviated type information as required for describe table
func (*ColumnType) Format ¶
func (ct *ColumnType) Format(buf *TrackedBuffer)
Format returns a canonical string representation of the type and all relevant options
func (*ColumnType) SQLType ¶
func (ct *ColumnType) SQLType() querypb.Type
SQLType returns the sqltypes type code for the given column
type Columns ¶
type Columns []ColIdent
Columns represents an insert column list.
func (Columns) FindColumn ¶
FindColumn finds a column in the column list, returning the index if it exists or -1 otherwise
type CommentDirectives ¶
type CommentDirectives map[string]interface{}
CommentDirectives is the parsed representation for execution directives conveyed in query comments
func ExtractCommentDirectives ¶
func ExtractCommentDirectives(comments Comments) CommentDirectives
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.
func (CommentDirectives) IsSet ¶
func (d CommentDirectives) IsSet(key string) bool
IsSet checks the directive map for the named directive and returns true if the directive is set and has a true/false or 0/1 value
type ComparisonExpr ¶
ComparisonExpr represents a two-value comparison expression.
func (*ComparisonExpr) Format ¶
func (node *ComparisonExpr) Format(buf *TrackedBuffer)
Format formats the node.
type ConstraintOptions ¶
type ConvertExpr ¶
type ConvertExpr struct { Expr Expr Type *ConvertType }
ConvertExpr represents a call to CONVERT(expr, type) or it's equivalent CAST(expr AS type). Both are rewritten to the former.
func (*ConvertExpr) Format ¶
func (node *ConvertExpr) Format(buf *TrackedBuffer)
type ConvertType ¶
ConvertType represents the type in call to CONVERT(expr, type)
func (*ConvertType) Format ¶
func (node *ConvertType) Format(buf *TrackedBuffer)
Format formats the node.
type ConvertUsingExpr ¶
ConvertUsingExpr represents a call to CONVERT(expr USING charset).
func (*ConvertUsingExpr) Format ¶
func (node *ConvertUsingExpr) Format(buf *TrackedBuffer)
type CursorDefinition ¶
type CursorDefinition struct { Name ColIdent Scroll bool Select SelectStatement }
func (*CursorDefinition) Format ¶
func (node *CursorDefinition) Format(buf *TrackedBuffer)
type DDL ¶
type DDL struct { Action string Table TableName NewName TableName IfExists bool TableSpec *TableSpec PartitionSpec *PartitionSpec IndexSpec *IndexSpec IndexCols []IndexColumn IndexExpr Expr VindexSpec *VindexSpec VindexCols []ColIdent ForeignKey *ForeignKeyDefinition Policy *Policy View *View Trigger *Trigger Type *Type Comment *Comment Extension *Extension }
DDL represents a CREATE, ALTER, DROP, RENAME or TRUNCATE statement. Table is set for AlterStr, DropStr, RenameStr, TruncateStr NewName is set for AlterStr, CreateStr, RenameStr. VindexSpec is set for CreateVindexStr, DropVindexStr, AddColVindexStr, DropColVindexStr VindexCols is set for AddColVindexStr
type Declare ¶
type Declare struct { Type DeclareType Variables []*LocalVariable Cursor *CursorDefinition }
func (*Declare) Format ¶
func (node *Declare) Format(buf *TrackedBuffer)
type DeclareType ¶
type DeclareType int
type DefaultDefinition ¶
type DefaultDefinition struct { ValueOrExpression DefaultValueOrExpression ConstraintName ColIdent // only for MSSQL }
type DefaultValueOrExpression ¶ added in v0.16.5
type Delete ¶
type Delete struct { Comments Comments Targets TableNames TableExprs TableExprs Partitions Partitions Where *Where OrderBy OrderBy Limit *Limit }
Delete represents a DELETE statement. If you add fields here, consider adding them to calls to validateSubquerySamePlan.
type ExistsExpr ¶
type ExistsExpr struct {
Subquery *Subquery
}
ExistsExpr represents an EXISTS expression.
func (*ExistsExpr) Format ¶
func (node *ExistsExpr) Format(buf *TrackedBuffer)
Format formats the node.
type Expr ¶
type Expr interface { SQLNode // contains filtered or unexported methods }
Expr represents an expression.
type Exprs ¶
type Exprs []Expr
Exprs represents a list of value expressions. It's not a valid expression because it's not parenthesized.
type ForeignKeyDefinition ¶
type FuncCallExpr ¶
FuncCallExpr represents a function call that takes Exprs.
func (*FuncCallExpr) Format ¶
func (node *FuncCallExpr) Format(buf *TrackedBuffer)
type FuncExpr ¶
type FuncExpr struct { Qualifier TableIdent Name ColIdent Distinct bool Exprs SelectExprs Over *OverExpr }
FuncExpr represents a function call that takes SelectExprs.
func (*FuncExpr) IsAggregate ¶
IsAggregate returns true if the function is an aggregate.
type GeneratedColumn ¶
type GroupConcatExpr ¶
type GroupConcatExpr struct { Distinct string Exprs SelectExprs OrderBy OrderBy Separator string }
GroupConcatExpr represents a call to GROUP_CONCAT
func (*GroupConcatExpr) Format ¶
func (node *GroupConcatExpr) Format(buf *TrackedBuffer)
Format formats the node
type IdentityOpt ¶
type If ¶
type If struct { Condition Expr IfStatements []Statement ElseStatements []Statement Keyword string }
func (*If) Format ¶
func (node *If) Format(buf *TrackedBuffer)
type IndexColumn ¶
IndexColumn describes a column in an index definition with optional length
type IndexColumnsOrExpression ¶
type IndexColumnsOrExpression struct { IndexCols []IndexColumn IndexExpr Expr }
type IndexDefinition ¶
type IndexDefinition struct { Info *IndexInfo Columns []IndexColumn Options []*IndexOption Partition *IndexPartition }
IndexDefinition describes an index in a CREATE TABLE statement
func (*IndexDefinition) Format ¶
func (idx *IndexDefinition) Format(buf *TrackedBuffer)
Format formats the node.
type IndexHints ¶
IndexHints represents a list of index hints.
func (*IndexHints) Format ¶
func (node *IndexHints) Format(buf *TrackedBuffer)
Format formats the node.
type IndexInfo ¶
type IndexInfo struct { Type string Name ColIdent Primary bool Spatial bool Unique bool Fulltext bool Clustered BoolVal }
IndexInfo describes the name and type of an index in a CREATE TABLE statement
type IndexOption ¶
IndexOption is used for trailing options for indexes: COMMENT, KEY_BLOCK_SIZE, USING
type IndexPartition ¶
type IndexSpec ¶
type IndexSpec struct { Name ColIdent Type ColIdent Unique bool Primary bool Constraint bool Clustered bool // for MSSQL ColumnStore bool // for MSSQL Included []ColIdent Where *Where Options []*IndexOption Partition *IndexPartition // for MSSQL ConstraintOptions *ConstraintOptions }
type Insert ¶
type Insert struct { Action string Comments Comments Ignore string Table TableName Partitions Partitions Columns Columns Rows InsertRows OnDup OnDup }
Insert represents an INSERT or REPLACE statement. Per the MySQL docs, http://dev.mysql.com/doc/refman/5.7/en/replace.html Replace is the counterpart to `INSERT IGNORE`, and works exactly like a normal INSERT except if the row exists. In that case it first deletes the row and re-inserts with new values. For that reason we keep it as an Insert struct. Replaces are currently disallowed in sharded schemas because of the implications the deletion part may have on vindexes. If you add fields here, consider adding them to calls to validateSubquerySamePlan.
type InsertRows ¶
type InsertRows interface { SQLNode // contains filtered or unexported methods }
InsertRows represents the rows for an INSERT statement.
type IntervalExpr ¶
IntervalExpr represents a date-time INTERVAL expression.
func (*IntervalExpr) Format ¶
func (node *IntervalExpr) Format(buf *TrackedBuffer)
Format formats the node.
type JoinCondition ¶
JoinCondition represents the join conditions (either a ON or USING clause) of a JoinTableExpr.
func (JoinCondition) Format ¶
func (node JoinCondition) Format(buf *TrackedBuffer)
Format formats the node.
type JoinTableExpr ¶
type JoinTableExpr struct { LeftExpr TableExpr Join string RightExpr TableExpr Condition JoinCondition }
JoinTableExpr represents a TableExpr that's a JOIN operation.
func (*JoinTableExpr) Format ¶
func (node *JoinTableExpr) Format(buf *TrackedBuffer)
Format formats the node.
type LengthScaleOption ¶
LengthScaleOption is used for types that have an optional length and scale
type LocalVariable ¶
type LocalVariable struct { Name ColIdent DataType ColumnType }
func (*LocalVariable) Format ¶
func (node *LocalVariable) Format(buf *TrackedBuffer)
type MarginComments ¶
MarginComments holds the leading and trailing comments that surround a query.
func SplitMarginComments ¶
func SplitMarginComments(sql string) (query string, comments MarginComments)
SplitMarginComments pulls out any leading or trailing comments from a raw sql query. This function also trims leading (if there's a comment) and trailing whitespace.
type MatchExpr ¶
type MatchExpr struct { Columns SelectExprs Expr Expr Option string }
MatchExpr represents a call to the MATCH function
func (*MatchExpr) Format ¶
func (node *MatchExpr) Format(buf *TrackedBuffer)
Format formats the node
type NewQualifierColName ¶
type NewQualifierColName struct {
Name ColIdent
}
NewQualifierColName represents a column name with NEW qualifier.
func (*NewQualifierColName) Equal ¶
func (node *NewQualifierColName) Equal(c *ColName) bool
Equal returns true if the column names match.
func (*NewQualifierColName) Format ¶
func (node *NewQualifierColName) Format(buf *TrackedBuffer)
Format formats the node.
type NextSeqValExpr ¶ added in v0.15.21
type NextSeqValExpr struct {
SequenceName TableIdent
}
NextSeqVal represents a NEXT VALUE FOR expression in SQL Server.
func (*NextSeqValExpr) Format ¶ added in v0.15.21
func (node *NextSeqValExpr) Format(buf *TrackedBuffer)
Format formats the node.
type NodeFormatter ¶
type NodeFormatter func(buf *TrackedBuffer, node SQLNode)
NodeFormatter defines the signature of a custom node formatter function that can be given to TrackedBuffer for code generation.
type OtherAdmin ¶
type OtherAdmin struct{}
OtherAdmin represents a misc statement that relies on ADMIN privileges, such as REPAIR, OPTIMIZE, or TRUNCATE statement. It should be used only as an indicator. It does not contain the full AST for the statement.
func (*OtherAdmin) Format ¶
func (node *OtherAdmin) Format(buf *TrackedBuffer)
Format formats the node.
type OtherRead ¶
type OtherRead struct{}
OtherRead represents a DESCRIBE, or EXPLAIN statement. It should be used only as an indicator. It does not contain the full AST for the statement.
func (*OtherRead) Format ¶
func (node *OtherRead) Format(buf *TrackedBuffer)
Format formats the node.
type OverExpr ¶ added in v0.15.8
type OverExpr struct { PartitionBy PartitionBy OrderBy OrderBy }
OverExpr represents a call to OVER
func (*OverExpr) Format ¶ added in v0.15.8
func (node *OverExpr) Format(buf *TrackedBuffer)
Format formats the node
type ParenExpr ¶
type ParenExpr struct {
Expr Expr
}
ParenExpr represents a parenthesized boolean expression.
func (*ParenExpr) Format ¶
func (node *ParenExpr) Format(buf *TrackedBuffer)
Format formats the node.
type ParenSelect ¶
type ParenSelect struct {
Select SelectStatement
}
ParenSelect is a parenthesized SELECT statement.
func (*ParenSelect) AddOrder ¶
func (node *ParenSelect) AddOrder(order *Order)
AddOrder adds an order by element
func (*ParenSelect) Format ¶
func (node *ParenSelect) Format(buf *TrackedBuffer)
Format formats the node.
func (*ParenSelect) SetLimit ¶
func (node *ParenSelect) SetLimit(limit *Limit)
SetLimit sets the limit clause
type ParenTableExpr ¶
type ParenTableExpr struct {
Exprs TableExprs
}
ParenTableExpr represents a parenthesized list of TableExpr.
func (*ParenTableExpr) Format ¶
func (node *ParenTableExpr) Format(buf *TrackedBuffer)
Format formats the node.
type ParserMode ¶
type ParserMode int
type Partition ¶ added in v0.15.10
type Partition struct {
Expr Expr
}
Partition represents an partitions expression.
func (*Partition) Format ¶ added in v0.15.10
func (node *Partition) Format(buf *TrackedBuffer)
Format formats the node.
type PartitionBy ¶ added in v0.15.8
type PartitionBy []*Partition
PartitionBy represents a PARTITON BY clause.
func (PartitionBy) Format ¶ added in v0.15.8
func (node PartitionBy) Format(buf *TrackedBuffer)
Format formats the node.
type PartitionDefinition ¶
PartitionDefinition describes a very minimal partition definition
func (*PartitionDefinition) Format ¶
func (node *PartitionDefinition) Format(buf *TrackedBuffer)
Format formats the node
type PartitionSpec ¶
type PartitionSpec struct { Action string Name ColIdent Definitions []*PartitionDefinition }
PartitionSpec describe partition actions (for alter and create)
func (*PartitionSpec) Format ¶
func (node *PartitionSpec) Format(buf *TrackedBuffer)
Format formats the node.
type Partitions ¶
type Partitions Columns
Partitions is a type alias for Columns so we can handle printing efficiently
func (Partitions) Format ¶
func (node Partitions) Format(buf *TrackedBuffer)
Format formats the node
type RangeCond ¶
RangeCond represents a BETWEEN or a NOT BETWEEN expression.
func (*RangeCond) Format ¶
func (node *RangeCond) Format(buf *TrackedBuffer)
Format formats the node.
type SQLNode ¶
type SQLNode interface {
Format(buf *TrackedBuffer)
}
SQLNode defines the interface for all nodes generated by the parser.
type SQLVal ¶
SQLVal represents a single value.
func NewBoolSQLVal ¶
func NewUnicodeStrVal ¶ added in v0.15.15
NewUnicode bulds a new UniodeStrVal.
func NewValArgWithOpt ¶
type Select ¶
type Select struct { Cache string Comments Comments Distinct string Hints string SelectExprs SelectExprs From TableExprs Where *Where GroupBy GroupBy Having *Where OrderBy OrderBy Limit *Limit Lock string }
Select represents a SELECT statement.
func (*Select) AddHaving ¶
AddHaving adds the boolean expression to the HAVING clause as an AND condition. If the expression is an OR clause, it parenthesizes it. Currently, the OR operator is the only one that's lower precedence than AND.
type SelectExpr ¶
type SelectExpr interface { SQLNode // contains filtered or unexported methods }
SelectExpr represents a SELECT expression.
type SelectExprs ¶
type SelectExprs []SelectExpr
SelectExprs represents SELECT expressions.
func (SelectExprs) Format ¶
func (node SelectExprs) Format(buf *TrackedBuffer)
Format formats the node.
type SelectStatement ¶
type SelectStatement interface { AddOrder(*Order) SetLimit(*Limit) SQLNode // contains filtered or unexported methods }
SelectStatement any SELECT statement.
type SetBoolOption ¶ added in v0.15.19
SetOption represents a SET statement that specifies option in SQL Server.
func (*SetBoolOption) Format ¶ added in v0.15.19
func (node *SetBoolOption) Format(buf *TrackedBuffer)
Format formats the node.
type Show ¶
type Show struct { Type string OnTable TableName ShowTablesOpt *ShowTablesOpt Scope string }
Show represents a show statement.
func (*Show) HasOnTable ¶
HasOnTable returns true if the show statement has an "on" clause
type ShowFilter ¶
ShowFilter is show tables filter
func (*ShowFilter) Format ¶
func (node *ShowFilter) Format(buf *TrackedBuffer)
Format formats the node.
type ShowTablesOpt ¶
type ShowTablesOpt struct { Extended string Full string DbName string Filter *ShowFilter }
ShowTablesOpt is show tables option
type SimpleTableExpr ¶
type SimpleTableExpr interface { SQLNode // contains filtered or unexported methods }
SimpleTableExpr represents a simple table expression.
type SridDefinition ¶ added in v0.14.2
type SridDefinition struct {
Value *SQLVal
}
type StarExpr ¶
type StarExpr struct {
TableName TableName
}
StarExpr defines a '*' or 'table.*' expression.
type Statement ¶
type Statement interface { SQLNode // contains filtered or unexported methods }
Statement represents a statement.
func ParseNext ¶
ParseNext parses a single SQL statement from the tokenizer returning a Statement which is the AST representation of the query. The tokenizer will always read up to the end of the statement, allowing for the next call to ParseNext to parse any subsequent SQL statements. When there are no more statements to parse, a error of io.EOF is returned.
func ParseStrictDDLWithMode ¶
func ParseStrictDDLWithMode(sql string, mode ParserMode) (Statement, error)
type Stream ¶
type Stream struct { Comments Comments SelectExpr SelectExpr Table TableName }
Stream represents a SELECT statement.
type SubstrExpr ¶
SubstrExpr represents a call to SubstrExpr(column, value_expression) or SubstrExpr(column, value_expression,value_expression) also supported syntax SubstrExpr(column from value_expression for value_expression)
func (*SubstrExpr) Format ¶
func (node *SubstrExpr) Format(buf *TrackedBuffer)
Format formats the node.
type TableExpr ¶
type TableExpr interface { SQLNode // contains filtered or unexported methods }
TableExpr represents a table expression.
type TableExprs ¶
type TableExprs []TableExpr
TableExprs represents a list of table expressions.
func (TableExprs) Format ¶
func (node TableExprs) Format(buf *TrackedBuffer)
Format formats the node.
type TableIdent ¶
type TableIdent struct {
// contains filtered or unexported fields
}
TableIdent is a case sensitive SQL identifier. It will be escaped with backquotes if necessary.
func NewTableIdent ¶
func NewTableIdent(str string) TableIdent
NewTableIdent creates a new TableIdent.
func (TableIdent) CompliantName ¶
func (node TableIdent) CompliantName() string
CompliantName returns a compliant id name that can be used for a bind var.
func (TableIdent) Format ¶
func (node TableIdent) Format(buf *TrackedBuffer)
Format formats the node.
func (TableIdent) IsEmpty ¶
func (node TableIdent) IsEmpty() bool
IsEmpty returns true if TabIdent is empty.
func (TableIdent) MarshalJSON ¶
func (node TableIdent) MarshalJSON() ([]byte, error)
MarshalJSON marshals into JSON.
func (TableIdent) String ¶
func (node TableIdent) String() string
String returns the unescaped table name. It must not be used for SQL generation. Use parser.String instead. The Stringer conformance is for usage in templates.
func (*TableIdent) UnmarshalJSON ¶
func (node *TableIdent) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals from JSON.
type TableName ¶
type TableName struct {
Name, Qualifier TableIdent
}
TableName represents a table name. Qualifier, if specified, represents a database or keyspace. TableName is a value struct whose fields are case sensitive. This means two TableName vars can be compared for equality and a TableName can also be used as key in a map.
func (TableName) ToViewName ¶
ToViewName returns a TableName acceptable for use as a VIEW. VIEW names are always lowercase, so ToViewName lowercasese the name. Databases are case-sensitive so Qualifier is left untouched.
type TableNames ¶
type TableNames []TableName
TableNames is a list of TableName.
func (TableNames) Format ¶
func (node TableNames) Format(buf *TrackedBuffer)
Format formats the node.
type TableSpec ¶
type TableSpec struct { Columns []*ColumnDefinition Indexes []*IndexDefinition ForeignKeys []*ForeignKeyDefinition Checks []*CheckDefinition Options map[string]string }
TableSpec describes the structure of a table from a CREATE TABLE statement
func (*TableSpec) AddCheck ¶
func (ts *TableSpec) AddCheck(check *CheckDefinition)
func (*TableSpec) AddColumn ¶
func (ts *TableSpec) AddColumn(cd *ColumnDefinition)
AddColumn appends the given column to the list in the spec
func (*TableSpec) AddForeignKey ¶
func (ts *TableSpec) AddForeignKey(foreignKey *ForeignKeyDefinition)
func (*TableSpec) AddIndex ¶
func (ts *TableSpec) AddIndex(id *IndexDefinition)
AddIndex appends the given index to the list in the spec
type Tokenizer ¶
type Tokenizer struct { InStream io.Reader AllowComments bool ForceEOF bool Position int LastError error ParseTree Statement // contains filtered or unexported fields }
Tokenizer is the struct used to generate SQL tokens for the parser.
func NewStringTokenizer ¶
func NewStringTokenizer(sql string, mode ParserMode) *Tokenizer
NewStringTokenizer creates a new Tokenizer for the sql string.
func NewTokenizer ¶
NewTokenizer creates a new Tokenizer reading a sql string from the io.Reader.
type TrackedBuffer ¶
TrackedBuffer is used to rebuild a query from the ast. bindLocations keeps track of locations in the buffer that use bind variables for efficient future substitutions. nodeFormatter is the formatting function the buffer will use to format a node. By default(nil), it's FormatNode. But you can supply a different formatting function if you want to generate a query that's different from the default.
func NewTrackedBuffer ¶
func NewTrackedBuffer(nodeFormatter NodeFormatter) *TrackedBuffer
NewTrackedBuffer creates a new TrackedBuffer.
func (*TrackedBuffer) HasBindVars ¶
func (buf *TrackedBuffer) HasBindVars() bool
HasBindVars returns true if the parsed query uses bind vars.
func (*TrackedBuffer) Myprintf ¶
func (buf *TrackedBuffer) Myprintf(format string, values ...interface{})
Myprintf mimics fmt.Fprintf(buf, ...), but limited to Node(%v), Node.Value(%s) and string(%s). It also allows a %a for a value argument, in which case it adds tracking info for future substitutions.
The name must be something other than the usual Printf() to avoid "go vet" warnings due to our custom format specifiers.
func (*TrackedBuffer) WriteArg ¶
func (buf *TrackedBuffer) WriteArg(arg string)
WriteArg writes a value argument into the buffer along with tracking information for future substitutions. arg must contain the ":" or "::" prefix.
func (*TrackedBuffer) WriteNode ¶
func (buf *TrackedBuffer) WriteNode(node SQLNode) *TrackedBuffer
WriteNode function, initiates the writing of a single SQLNode tree by passing through to Myprintf with a default format string
type Type ¶
type Type struct { Name TableName // workaround: using TableName to handle schema Type ColumnType }
type UnaryExpr ¶
UnaryExpr represents a unary value expression.
func (*UnaryExpr) Format ¶
func (node *UnaryExpr) Format(buf *TrackedBuffer)
Format formats the node.
type Union ¶
type Union struct { Type string Left, Right SelectStatement OrderBy OrderBy Limit *Limit Lock string }
Union represents a UNION statement.
type Update ¶
type Update struct { Comments Comments TableExprs TableExprs Exprs UpdateExprs Where *Where OrderBy OrderBy Limit *Limit }
Update represents an UPDATE statement. If you add fields here, consider adding them to calls to validateSubquerySamePlan.
type UpdateExpr ¶
UpdateExpr represents an update expression.
func (*UpdateExpr) Format ¶
func (node *UpdateExpr) Format(buf *TrackedBuffer)
Format formats the node.
type UpdateExprs ¶
type UpdateExprs []*UpdateExpr
UpdateExprs represents a list of update expressions.
func (UpdateExprs) Format ¶
func (node UpdateExprs) Format(buf *TrackedBuffer)
Format formats the node.
type ValuesFuncExpr ¶
type ValuesFuncExpr struct {
Name *ColName
}
ValuesFuncExpr represents a function call.
func (*ValuesFuncExpr) Format ¶
func (node *ValuesFuncExpr) Format(buf *TrackedBuffer)
Format formats the node.
type View ¶
type View struct { Action string SecurityType string Name TableName Definition SelectStatement }
type VindexParam ¶
VindexParam defines a key/value parameter for a CREATE VINDEX statement
func (VindexParam) Format ¶
func (node VindexParam) Format(buf *TrackedBuffer)
Format formats the node.
type VindexSpec ¶
type VindexSpec struct { Name ColIdent Type ColIdent Params []VindexParam }
VindexSpec defines a vindex for a CREATE VINDEX or DROP VINDEX statement
func (*VindexSpec) Format ¶
func (node *VindexSpec) Format(buf *TrackedBuffer)
Format formats the node. The "CREATE VINDEX" preamble was formatted in the containing DDL node Format, so this just prints the type, any parameters, and optionally the owner
func (*VindexSpec) ParseParams ¶
func (node *VindexSpec) ParseParams() (string, map[string]string)
ParseParams parses the vindex parameter list, pulling out the special-case "owner" parameter
Directories ¶
Path | Synopsis |
---|---|
dependency
|
|
hack
Package hack gives you some efficient functionality at the cost of breaking some Go rules.
|
Package hack gives you some efficient functionality at the cost of breaking some Go rules. |
querypb
Package query is a generated protocol buffer package.
|
Package query is a generated protocol buffer package. |
sqltypes
Package sqltypes implements interfaces and types that represent SQL values.
|
Package sqltypes implements interfaces and types that represent SQL values. |