Skip to content

Instantly share code, notes, and snippets.

@tdubs42
Last active September 16, 2021 22:02
Show Gist options
  • Save tdubs42/655ab37705889cf8f37d3e54184902dc to your computer and use it in GitHub Desktop.
Save tdubs42/655ab37705889cf8f37d3e54184902dc to your computer and use it in GitHub Desktop.
baseline for knex config file
const sharedConfig = {
client: 'sqlite3',
useNullAsDefault: true,
migrations: {
directory: './data/migrations',
},
seeds: {
directory: './data/seeds',
},
pool: {
afterCreate: (conn, done) => {
conn.run('PRAGMA foreign_keys = ON', done)
},
},
}
module.exports = {
development: {
...sharedConfig,
connection: { filename: './data/dev.db3' },
},
testing: {
...sharedConfig,
connection: { filename: './data/test.db3' },
},
production: {
...sharedConfig,
connection: { filename: './data/prod.db3' },
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment