This library provides basic database functionality for the @sftech/nestjs-core library. It is a wrapper around the TypeORM library and provides a simple way to connect to different databases. This library actually supports MySQL and SQLite. It also provides a RESTApi for CRUD-Operations towards the registered entities/models.
npm install @sftech/nestjs-core @sftech/nestjs-db
To use the library in your nestjs application, you need to import the NestJsDbModule in your app.module.ts:
import { NestjsDbModule, DatabaseOptionsMapper } from '@sftech/nestjs-db';
@Module({
imports: [NestJsCoreModule.register(), NestjsDbModule.register(DatabaseOptionsMapper.map())],
providers: [],
...
})
export class AppModule {
}