代码拉取完成,页面将自动刷新
同步操作将从 fifsky/gosql 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package gosql
import (
"fmt"
)
// Dialect interface contains behaviors that differ across SQL database
type Dialect interface {
// GetName get dialect's name
GetName() string
// Quote quotes field name to avoid SQL parsing exceptions by using a reserved word as a field name
Quote(key string) string
}
type commonDialect struct {
}
func (commonDialect) GetName() string {
return "common"
}
func (commonDialect) Quote(key string) string {
return fmt.Sprintf(`"%s"`, key)
}
var dialectsMap = map[string]Dialect{}
// RegisterDialect register new dialect
func RegisterDialect(name string, dialect Dialect) {
dialectsMap[name] = dialect
}
// GetDialect gets the dialect for the specified dialect name
func GetDialect(name string) (dialect Dialect, ok bool) {
dialect, ok = dialectsMap[name]
return
}
func mustGetDialect(name string) Dialect {
if dialect, ok := dialectsMap[name]; ok {
return dialect
}
panic(fmt.Sprintf("`%v` is not officially supported", name))
return nil
}
func newDialect(name string) Dialect {
if value, ok := GetDialect(name); ok {
return value
}
fmt.Printf("`%v` is not officially supported, running under compatibility mode.\n", name)
return &commonDialect{}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。