Skip to content

Commit

Permalink
Merge pull request pressly#85 from Kansuler/master
Browse files Browse the repository at this point in the history
TiDB documentation & improved cmd binary
  • Loading branch information
VojtechVitek authored Dec 6, 2017
2 parents 8740198 + c09709c commit b0454a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]:5439/db" status
goose tidb "user:password@/dbname?parseTime=true" status
```
## create

Expand Down
19 changes: 9 additions & 10 deletions cmd/goose/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down Expand Up @@ -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:[email protected]:5439/db" status
goose tidb "user:password@/dbname?parseTime=true" status
Options:
`
Expand Down

0 comments on commit b0454a4

Please sign in to comment.