mirror of https://github.com/pressly/goose.git
commit
b0454a40a9
|
@ -67,6 +67,7 @@ Examples:
|
|||
goose postgres "user=postgres dbname=postgres sslmode=disable" status
|
||||
goose mysql "user:password@/dbname?parseTime=true" status
|
||||
goose redshift "postgres://user:password@qwerty.us-east-1.redshift.amazonaws.com:5439/db" status
|
||||
goose tidb "user:password@/dbname?parseTime=true" status
|
||||
```
|
||||
## create
|
||||
|
||||
|
|
|
@ -45,13 +45,15 @@ func main() {
|
|||
|
||||
driver, dbstring, command := args[0], args[1], args[2]
|
||||
|
||||
if err := goose.SetDialect(driver); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
switch driver {
|
||||
case "postgres", "mysql", "sqlite3", "redshift":
|
||||
if err := goose.SetDialect(driver); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
default:
|
||||
log.Fatalf("%q driver not supported\n", driver)
|
||||
case "redshift":
|
||||
driver = "postgres"
|
||||
case "tidb":
|
||||
driver = "mysql"
|
||||
}
|
||||
|
||||
switch dbstring {
|
||||
|
@ -60,10 +62,6 @@ func main() {
|
|||
default:
|
||||
}
|
||||
|
||||
if driver == "redshift" {
|
||||
driver = "postgres"
|
||||
}
|
||||
|
||||
db, err := sql.Open(driver, dbstring)
|
||||
if err != nil {
|
||||
log.Fatalf("-dbstring=%q: %v\n", dbstring, err)
|
||||
|
@ -104,6 +102,7 @@ Examples:
|
|||
goose postgres "user=postgres dbname=postgres sslmode=disable" status
|
||||
goose mysql "user:password@/dbname?parseTime=true" status
|
||||
goose redshift "postgres://user:password@qwerty.us-east-1.redshift.amazonaws.com:5439/db" status
|
||||
goose tidb "user:password@/dbname?parseTime=true" status
|
||||
|
||||
Options:
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue