Documentation ¶
Index ¶
- func CompatibleMySQLDs(s string) string
- func ContainsIgnoreCase(a, b string) bool
- func IfElse(ifCondition bool, ifValue, elseValue string) string
- func IsQuerySQL(sql string) (string, bool)
- func MySQLDump(db *sql.DB, writer io.Writer) error
- func SetConnectionPool(db *sql.DB) *sql.DB
- func SplitSqls(sqls string, separate rune) []string
- type ExecResult
- type More
- type MySQLMore
- type SQLExec
- type SQLMore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompatibleMySQLDs ¶
CompatibleMySQLDs make mysql datasource be compatible with raw, mysql or gossh host format.
func ContainsIgnoreCase ¶
ContainsIgnoreCase tell if a contains b in case-insensitively
func IsQuerySQL ¶
IsQuerySQL tests a sql is a query or not
Types ¶
type ExecResult ¶
type ExecResult struct { Error error CostTime time.Duration Headers []string Rows [][]string RowsAffected int64 LastInsertID int64 IsQuerySQL bool FirstKey string }
ExecResult defines the result structure of sql execution.
type More ¶
type More interface { // Matches 是否匹配当前实现 Matches() bool // EnhanceURI 增强URI EnhanceURI(dbURI string) string // EnhanceGormDB 增强GormDB EnhanceGormDB(db *gorm.DB) *gorm.DB }
More 为各个数据库增强的接口
type MySQLMore ¶
type MySQLMore struct {
// contains filtered or unexported fields
}
MySQLMore MySQL增强器
func (*MySQLMore) EnhanceGormDB ¶
EnhanceGormDB 增强GormDB
type SQLExec ¶
type SQLExec interface { // Exec execute query. Exec(query string, args ...interface{}) (sql.Result, error) Query(query string, args ...interface{}) (*sql.Rows, error) }
SQLExec wraps Exec method.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.