@alphaapps/nestjs-db
TypeScript icon, indicating that this package has built-in type declarations

3.0.31 • Public • Published

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 hosted
  • DB_PORT: The port of the database
  • DB_USERNAME: The username of the database
  • DB_PASS: The password of the database
  • DB_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 the debug lib with ${packageName}:database prefix.

Package Sidebar

Install

npm i @alphaapps/nestjs-db

Weekly Downloads

13

Version

3.0.31

License

MIT

Unpacked Size

22.3 kB

Total Files

27

Last publish

Collaborators

  • sami.sammour