mirror of
https://github.com/go-gorm/gorm.git
synced 2025-01-23 10:50:28 +08:00
理由同中文版
parent
0bce7b58a9
commit
7db9b8b9a8
@ -47,7 +47,7 @@ func init() {
|
||||
// during initialization, you can use `gorm.Config` to change few configurations, e.g: NowFunc, which no longer allow modification through global variables
|
||||
db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{NowFunc: func() time.Time { return time.Now().Local() }})
|
||||
db, err := gorm.Open(mysql.Open("gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True"), &gorm.Config{})
|
||||
db, err := gorm.Open(postgres.Open("user=gorm password=gorm DB.name=gorm port=9920 TimeZone=Asia/Shanghai"), &gorm.Config{})
|
||||
db, err := gorm.Open(postgres.Open("user=gorm password=gorm dbname=gorm port=9920 TimeZone=Asia/Shanghai"), &gorm.Config{})
|
||||
|
||||
// most CRUD API kept compatibility
|
||||
db.AutoMigrate(&Product{})
|
||||
|
Loading…
Reference in New Issue
Block a user