Skip to content

Instantly share code, notes, and snippets.

@kkemple
Last active June 23, 2022 11:30
Show Gist options
  • Save kkemple/9b810e98dd9caa669580 to your computer and use it in GitHub Desktop.
Save kkemple/9b810e98dd9caa669580 to your computer and use it in GitHub Desktop.
module.exports = {
development: {
client: 'postgresql',
connection: {
port: process.env.DATABASE_PORT,
host: process.env.DATABASE_HOST,
database: process.env.DATABASE_NAME,
user: process.env.DATABASE_USER,
password: process.env.DATABASE_ACCESS_KEY,
},
pool: {
min: process.env.DATABASE_POOL_MIN,
max: process.env.DATABASE_POOL_MAX,
},
migrations: {
directory: './db/migrations',
tableName: 'knex_migrations',
},
seeds: {
directory: './db/seeds',
},
},
staging: { ... },
test: { ... },
production: { ... },
}
Copy link

ghost commented Feb 4, 2020

If by chance in the connection section I want to pass a file that exports all the data. How could I do it?

@dexfs
Copy link

dexfs commented Jun 6, 2020

@lucianodouglasm2 just require the file into knexjs config and pass the data.

const connection = require('./connection-data'); 

module.exports = {
  development: {
    client: 'postgresql',
    connection,
   ....
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment