-
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.
- Loading branch information
1 parent
2b4cd00
commit b0e5e64
Showing
1 changed file
with
24 additions
and
0 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 |
---|---|---|
@@ -1,2 +1,26 @@ | ||
# knex-waitfordb | ||
Waiting knex database connection | ||
|
||
## Requirements | ||
You must install knex in your project | ||
|
||
## Usage | ||
Add premigrate script to package.json to wait for initialize database before starting migration | ||
``` | ||
"scripts": { | ||
"premigrate": "knex-waitfordb", | ||
"migrate": "knex migrate:latest" | ||
} | ||
``` | ||
You can use arguments to set repeat or delay, see Options | ||
```sh | ||
knex-waitfordb --retry 100 --delay 1 | ||
``` | ||
|
||
## Options | ||
| Option | Default | Description | | ||
| --- | --- | --- | | ||
| retry | 100 | How many times to try to connect | | ||
| delay | 1 | Timeout between attempts in seconds | | ||
| config | knexfile | Knex config file for require | | ||
|