Add --wait-timeout option (#127)

Closes #127
This commit is contained in:
Nikita Konev 2020-03-26 18:25:45 +03:00 committed by Adrian Macneil
parent ed9e57a4ad
commit 079523c25f
2 changed files with 13 additions and 4 deletions

View file

@ -284,12 +284,12 @@ Waiting for database....
Creating: myapp_development
```
If the database is still not available after 60 seconds, the command will return an error:
You can customize the timeout using `--wait-timeout` (default 60s). If the database is still not available, the command will return an error:
```sh
$ dbmate wait
Waiting for database............................................................
Error: unable to connect to database: pq: role "foobar" does not exist
$ dbmate --wait-timeout=5s wait
Waiting for database.....
Error: unable to connect to database: dial tcp 127.0.0.1:5432: connect: connection refused
```
Please note that the `wait` command does not verify whether your specified database exists, only that the server is available and ready (so it will return success if the database server is available, but your database has not yet been created).