@nestjs-yalc/database
v1.3.4
Published
Database helpers for TypeORM-based YALC applications.
Readme
@nestjs-yalc/database
Database helpers for TypeORM-based YALC applications.
The package contains configuration builders, migration and operation services, global migration registration helpers, repository utilities, JSON field helpers, and query builder helpers.
Installation
npm install @nestjs-yalc/databaseInstall the TypeORM driver package required by your application, such as
mysql2, pg, or sqlite3.
Main Exports
buildDbConfigObjectfor building TypeORM connection options from environment-style configuration.DbMigrateServiceandDbMigrationServiceFactoryfor migration execution.DbOpsServiceandDbOpsServiceFactoryfor database operations.- TypeORM migration registration helpers such as
setGlobalMigrationClasses. yalcTypeOrmPostgresOptionsfor Postgres option normalization.
Example
import { buildDbConfigObject } from '@nestjs-yalc/database';
const dbConfig = buildDbConfigObject({
dbName: 'app',
entities: [UserEntity],
migrationsDir: 'dist/database/migrations',
});Documentation
- Backend blueprint: https://github.com/NestDevLab/nestjs-yalc/blob/dev/docs/backend-blueprint.md
- Integration guide: https://github.com/NestDevLab/nestjs-yalc/blob/dev/docs/how-to-integrate-nestjs-yalc.md
