Skip to content

Instantly share code, notes, and snippets.

@Wonder2210
Created May 29, 2020 03:51
Show Gist options
  • Save Wonder2210/dd426019f2195dcc99a171f9f28ff02a to your computer and use it in GitHub Desktop.
Save Wonder2210/dd426019f2195dcc99a171f9f28ff02a to your computer and use it in GitHub Desktop.
error free knex config with typescript
const default_config = {
client: 'pg',
connection: {
database: "db",
user: "user",
password: "password"
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations',
directory: 'migrations'
},
timezone: 'UTC'
}
interface KnexConfig {
[key: string]: object;
};
const config : KnexConfig = {
development:{
...default_config
},
testing:{
...default_config
},
production:{
...default_config
}
};
export default config;
require('ts-node/register');
import config from './config';
module.exports= config["development"]
@Wonder2210
Copy link
Author

Anotación 2020-05-27 014623

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