Skip to content

Commit

Permalink
Write README
Browse files Browse the repository at this point in the history
  • Loading branch information
tdimdimich committed May 20, 2021
1 parent 2b4cd00 commit b0e5e64
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
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 |

0 comments on commit b0e5e64

Please sign in to comment.