Documentation ¶
Index ¶
- Constants
- func CreateInsertSqlsByRows(insertStmt *ast.InsertStmt, rows [][]interface{}, batchCount int64, ...) ([]string, error)
- func CreateInsertStmtTemplate(dbName, tableName string, columnNames []string) (*ast.InsertStmt, error)
- func CreateInsertStmtsByRows(insertStmt *ast.InsertStmt, rows [][]interface{}, batchCount int64) ([]*ast.InsertStmt, error)
- func ExistsCreateTableStmt(sqlStr string) (bool, error)
- func FindDBNamesByStmtNode(stmtNode ast.StmtNode) []string
- func GetAllAlterTableNames(sqlStrs []string) ([]string, error)
- func GetAllCreateTableNames(sqlStrs []string) ([]string, error)
- func GetDDLTableName(sqlStr string) (string, error)
- func GetSQLStmtHearderComment(stmt string) string
- func GetSQLStmtHearderCommentEndPos(stmt string) int
- func GetStmtType(stmtNode ast.StmtNode) string
- func GetStmtType2(sqlStr string) string
- func IsAllDDL(sqlStr string) (bool, []error, error)
- func IsCreateTableStmt(sqlStr string) (bool, error)
- func NewRow(fields []interface{}) []ast.ExprNode
- func NewRows(dataz [][]interface{}) [][]ast.ExprNode
- func NormalizeDigest(sqlStr string) (string, string)
- func ParseOneStmt(query string) (ast.StmtNode, error)
- func ReplaceDDLTableName(sqlStr string, replaceTableName string) (string, error)
- func ReplaceDDLTableNames(sqlStr string, replaceTableNames []string) ([]string, error)
- func ReplaceDDLsTableName(sqlStrs []string, logicRealTableNameMap map[string]string) ([]string, error)
- func ResetSelectLimitAndGet(stmtNode ast.StmtNode, defaultLimit int64) ast.StmtNode
- func RestoreSql(node ast.Node, endStr string) (string, error)
- func SqlToMulti(sqlStr string) ([]string, error)
Constants ¶
View Source
const ( StmtTypeUnknow = "Unknow" StmtTypeSelect = "Select" StmtTypeUpdate = "Update" StmtTypeDelete = "Delete" StmtTypeInsert = "Insert" StmtTypeCreate = "Create" StmtTypeAlter = "Alter" StmtTypeExplain = "Explain" )
Variables ¶
This section is empty.
Functions ¶
func CreateInsertSqlsByRows ¶
func CreateInsertStmtTemplate ¶
func CreateInsertStmtTemplate(dbName, tableName string, columnNames []string) (*ast.InsertStmt, error)
func CreateInsertStmtsByRows ¶
func CreateInsertStmtsByRows(insertStmt *ast.InsertStmt, rows [][]interface{}, batchCount int64) ([]*ast.InsertStmt, error)
func ExistsCreateTableStmt ¶
func GetAllAlterTableNames ¶
获取所有Alter table表名
func GetAllCreateTableNames ¶
获取所有Create table表名
func GetStmtType ¶
func GetStmtType2 ¶
func IsCreateTableStmt ¶
func NormalizeDigest ¶
func ReplaceDDLTableName ¶
func ReplaceDDLTableNames ¶
func ReplaceDDLsTableName ¶
func ReplaceDDLsTableName(sqlStrs []string, logicRealTableNameMap map[string]string) ([]string, error)
替换所有DDL表名
func ResetSelectLimitAndGet ¶
func SqlToMulti ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.