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