@nest-batch/typeorm
v0.2.2
Published
TypeORM 1.0.0 adapter SLOT for @nest-batch/core — JobRepository and TransactionManager interface shape, paired with @nest-batch/postgresql (Postgres driver) or @nest-batch/mysql (MySQL driver).
Maintainers
Readme
@nest-batch/typeorm
TypeORM persistence adapter for @nest-batch/core.
Korean: README.ko.md
Install
pnpm add @nest-batch/core @nest-batch/typeorm typeormIf your Nest application uses @nestjs/typeorm, keep using your normal
TypeOrmModule.forRoot configuration.
Public Imports
import {
BATCH_META_ENTITIES,
TypeOrmAdapter,
TypeOrmJobRepository,
TypeOrmTransactionManager,
batchMetaEntities,
} from '@nest-batch/typeorm';Wiring
Register the batch metadata entities in your host-owned TypeORM data source.
import { TypeOrmModule } from '@nestjs/typeorm';
import { InProcessAdapter, NestBatchModule } from '@nest-batch/core';
import { BATCH_META_ENTITIES, TypeOrmAdapter } from '@nest-batch/typeorm';
@Module({
imports: [
TypeOrmModule.forRoot({
type: 'postgres',
entities: [ProductEntity, ...BATCH_META_ENTITIES],
url: process.env.DATABASE_URL,
}),
NestBatchModule.forRoot({
adapters: {
persistence: TypeOrmAdapter.forRoot(),
transport: InProcessAdapter.forRoot(),
},
}),
],
})
export class AppModule {}Generate migrations in the application repository after adding the metadata entities.
