forked from pressly/goose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pressly#85 from Kansuler/master
TiDB documentation & improved cmd binary
- Loading branch information
Showing
2 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[email protected]:5439/db" status | ||
goose tidb "user:password@/dbname?parseTime=true" status | ||
Options: | ||
` | ||
|