@alphaapps/nestjs-db
v3.0.31
Published
This module was first created to support `sequelize` ORM because it wasn't supported yet by `NestJS` but now we use `@nestjs/sequelize` package. Right now the only usage of it is to configure `sequelize` in a standard way. ### Installation: ```shell npm
Downloads
235
Maintainers
Readme
Database Lib:
This module was first created to support sequelize
ORM because it wasn't supported yet by NestJS
but now we use @nestjs/sequelize
package.
Right now the only usage of it is to configure sequelize
in a standard way.
Installation:
npm install @alphaapps/nestjs-db
import { databaseConfig } from '@alphaapps/nestjs-db';
@Module({
imports: [SequelizeModule.forRoot(databaseConfig)]
})
export default class AppModule {}
This config by default uses the following env vars:
DB_URL
: The whole database connection url and this has the highest priority.postgres://user:password@localhost/db
DB_HOST
: The hostname where the database is hostedDB_PORT
: The port of the databaseDB_USERNAME
: The username of the databaseDB_PASS
: The password of the databaseDB_DATABASE
: The name of the database For each one of the previous vars if it wasn't supplied then we take the value from config. Also by default the logging is using thedebug
lib with${packageName}:database
prefix.