Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 632 Bytes

README.md

File metadata and controls

26 lines (22 loc) · 632 Bytes

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

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