Documentation
¶
Index ¶
- func StandardRemoveQuotedTextAndComment(statement string) (string, error)
- type Tokenizer
- func (t *Tokenizer) SetLineForMySQLCreateTableStmt(node *tidbast.CreateTableStmt, firstLine int) error
- func (t *Tokenizer) SplitPostgreSQLMultiSQL() ([]base.SingleSQL, error)
- func (t *Tokenizer) SplitStandardMultiSQL() ([]base.SingleSQL, error)
- func (t *Tokenizer) SplitTiDBMultiSQL() ([]base.SingleSQL, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StandardRemoveQuotedTextAndComment ¶
StandardRemoveQuotedTextAndComment removes the quoted text and comment.
Types ¶
type Tokenizer ¶
type Tokenizer struct {
// contains filtered or unexported fields
}
func NewTokenizer ¶
NewTokenizer creates a new tokenizer. Notice: we append an additional eofRune in the statement. This is a sentinel rune.
func (*Tokenizer) SetLineForMySQLCreateTableStmt ¶
func (t *Tokenizer) SetLineForMySQLCreateTableStmt(node *tidbast.CreateTableStmt, firstLine int) error
func (*Tokenizer) SplitPostgreSQLMultiSQL ¶
SplitPostgreSQLMultiSQL splits the statement to a string slice. We mainly considered:
comments - style /* comments */ - style -- comments string - style 'string' - style $$ string $$ identifier - style "indentifier"
Notice:
- We support PostgreSQL CREATE PROCEDURE statement with $$ $$ style, but do not support BEGIN ATOMIC ... END; style. See https://www.postgresql.org/docs/14/sql-createprocedure.html.
func (*Tokenizer) SplitStandardMultiSQL ¶
SplitStandardMultiSQL splits the statement to a string slice. We mainly considered:
comments - style /* comments */ - style -- comments string - style 'string' identifier - style "identifier"
The difference between PostgreSQL and Oracle is that PostgreSQL supports dollar-quoted string, but Oracle does not.
Click to show internal directories.
Click to hide internal directories.