Skip to content

plesk/knex-waitfordb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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