mirror of https://github.com/go-gorm/gorm.git
change method NewDialect to New
This commit is contained in:
parent
52fd87c57b
commit
5ded927a9a
|
@ -8,7 +8,7 @@ type Dialect interface {
|
||||||
ReturningStr(key string) string
|
ReturningStr(key string) string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDialect(driver string) Dialect {
|
func New(driver string) Dialect {
|
||||||
var d Dialect
|
var d Dialect
|
||||||
switch driver {
|
switch driver {
|
||||||
case "postgres":
|
case "postgres":
|
||||||
|
|
2
main.go
2
main.go
|
@ -19,7 +19,7 @@ type DB struct {
|
||||||
|
|
||||||
func Open(driver, source string) (db DB, err error) {
|
func Open(driver, source string) (db DB, err error) {
|
||||||
db.db, err = sql.Open(driver, source)
|
db.db, err = sql.Open(driver, source)
|
||||||
db.dialect = dialect.NewDialect(driver)
|
db.dialect = dialect.New(driver)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue