mirror of https://github.com/go-gorm/gorm.git
23 lines
413 B
Go
23 lines
413 B
Go
package dialect
|
|
|
|
type Dialect interface {
|
|
BinVar(i int) string
|
|
SupportLastInsertId() bool
|
|
SqlTag(column interface{}, size int) string
|
|
PrimaryKeyTag(column interface{}, size int) string
|
|
ReturningStr(key string) string
|
|
}
|
|
|
|
func NewDialect(driver string) Dialect {
|
|
var d Dialect
|
|
switch driver {
|
|
case "postgres":
|
|
d = &postgres{}
|
|
case "mysql":
|
|
d = &mysql{}
|
|
case "sqlite3":
|
|
d = &sqlite3{}
|
|
}
|
|
return d
|
|
}
|