1.0.0-dev.3 • Published 3 years ago
@socfony/prisma v1.0.0-dev.3
@socfony/prisma
Prisma ORM binding for NestJS.
Installation
npm i @socfony/prisma
If you are using Yarn:
yarn add @socfony/prisma
Usage
import { PrismaModule } from '@socfony/prisma';
@Module({
imports: [PrismaModule.forRoot()],
})
export class AppModule {}
Options
client
: If you customize the Prisma output, you can customize the import PrismaClient class, which is imported from@prisma/client
by default.{...options}
, see PrismaClient optionsCustom PrismaClient
import { PrismaClient } from './prisma-client'; @Module({ imports: [PrismaModule.forRoot({ client: PrismaClient, /// More Prisma client options })], }) export class AppModule {}
PrismaClient options in
forRoot
/forAsyncRoot
import { PrismaModule } from '@socfony/prisma'; @Module({ imports: [ PrismaModule.forRoot({ // client: PrismaClient, // If you custom Prisma ouput, you can customize the import PrismaClient class, which is imported from `@prisma/client` by default.` log: ['info', 'error'], // Other Prisma client options }), ], }) export class AppModule {}
Async
import { PrismaModule } from '@socfony/prisma'; @Module({ imports: [PrismaModule.forRootAsync({ useFactory: async () => { // Custom code. return {/* ...Options */} }, })], }) export class AppModule {}
License
BSD 3-Clause License.
Copyright (c) 2021, Odroe Inc. All rights reserved.
1.0.0-dev.3
3 years ago
1.0.0-dev.1
3 years ago
1.0.0-dev.0
3 years ago
0.0.1
3 years ago
0.0.3
3 years ago
0.0.4
3 years ago
0.0.1-alpha.197
3 years ago