Answers for "UnhandledPromiseRejectionWarning: Error: knex: Required configuration option 'client' is missing."

0

UnhandledPromiseRejectionWarning: Error: knex: Required configuration option 'client' is missing.

import 'dotenv/config'
import path from 'path'

export const development = {
	client: process.env.DBMS_TYPE,
	connection: {
		host: process.env.PG_HOST,
		user: process.env.PG_USER,
		password: process.env.PG_PASSWORD,
		port: process.env.PG_PORT_DEV,
		database: process.env.PG_DATABASE
	},
	pool: {
		min: 5,
		max: 10
	},
	migrations: path.resolve(process.cwd(), 'src/migrations'),
	seeds: path.resolve(process.cwd(), 'src/seeds')
}

export const production = {
	client: process.env.DBMS_TYPE,
	connection: {
		host: process.env.PG_HOST,
		user: process.env.PG_USER,
		password: process.env.PG_PASSWORD,
		port: process.env.PG_PORT,
		database: process.env.PG_DATABASE
	},
	pool: {
		min: 10,
		max: 20
	},
	migrations: path.resolve(process.cwd(), 'src/migrations'),
	seeds: path.resolve(process.cwd(), 'src/seeds')
}
Posted by: Guest on August-24-2021

Code answers related to "UnhandledPromiseRejectionWarning: Error: knex: Required configuration option 'client' is missing."

Browse Popular Code Answers by Language