Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveCommentInSQLStatement ¶
RemoveCommentInSQLStatement removes the comments in the SQL statement, including single line comment (--) and multiple line comment (/*...*/)
Types ¶
type SQLFlowStmt ¶
type SQLFlowStmt struct { IsUnfinishedSelect bool Original string *SQLFlowSelectStmt Inputs []string Outputs []string }
SQLFlowStmt represents a parsed SQL statement. The original statement is in Original. If it is a standard SQL statement, Original has the statement as well, and Extended is nil. Or, if it is a statement with SQLFlow syntax extension, Original is the whole statement and Extended is the parsed extension.
func Parse ¶
func Parse(dialect, program string) ([]*SQLFlowStmt, error)
Parse a SQL program in the given dialect into a list of SQL statements.
func ParseStatement ¶
func ParseStatement(dialect, program string) (*SQLFlowStmt, error)
ParseStatement parses a SQL program by calling Parse, and asserts that this program contains one and only one statement. Notice: If program contains more than one statement, we should call sql.RewriteSQLWithHints
func (*SQLFlowStmt) IsExtendedSyntax ¶
func (stmt *SQLFlowStmt) IsExtendedSyntax() bool
IsExtendedSyntax returns true if a parsed statement uses any SQLFlow syntax extensions.