0.23.0 • Published 3 months ago

nestjs-prisma v0.23.0

Weekly downloads
237
License
MIT
Repository
github
Last release
3 months ago

NestJS Prisma Schematics

npm version

Add Prisma support to your NestJS application.

Installation

nest add nestjs-prisma

Example output

▹▹▹▹▸ Package installation in progress... ☕
Starting library setup...
CREATE src/prisma/prisma.module.ts (192 bytes)
CREATE src/prisma/prisma.service.spec.ts (460 bytes)
CREATE src/prisma/prisma.service.ts (389 bytes)
UPDATE package.json (2260 bytes)
✔ Packages installed successfully.
✔ Packages installed successfully.
    Initialized Prisma

Add PrismaModule to the imports section in your AppModule or other modules to gain access to PrismaService.

import { Module } from '@nestjs/common';
import { PrismaModule } from './prisma/prisma.module';

@Module({
  imports: [PrismaModule],
})
export class AppModule {}

Additional options

All available flags:

Flag DescriptionType Default
 addPrismaServiceCreate a Prisma service extending the Prisma Client and module.booleanPrompted
 addDockerCreate a Dockerfile and docker-compose.yaml.booleanfalse
 dockerNodeImageVersionNode version for the builder and runner image.string12
 nameThe name for the Prisma service extending the Prisma Client and module.stringPrisma
 prismaVersionThe Prisma version to be installed.stringlatest
 skipInstallSkip installing dependency packages.booleanfalse
 skipPrismaInitSkip initializing Prisma.booleanfalse

You can pass additional flags to customize the schematic. For example, if you want to install a different version for Prisma use --prismaVersion flag:

nest add nestjs-prisma --prismaVersion 2.5.1

If you want to skip installing dependencies use --skipInstall flag:

nest add nestjs-prisma --skipInstall

Add Dockerfile and docker-compose.yaml, you can even use a different node version (12-alpine or 14).

Currently uses to PostgreSQL as a default database in docker-compose.yaml.

nest add nestjs-prisma --addDocker --dockerNodeImageVersion 12-alpine

Developing

Install @angular-devkit/schematics-cli to be able to use schematics command

npm i -g @angular-devkit/schematics-cli

Now build the schematics and run the schematic.

npm run build:schematics
# or
npm run dev:schematics

# dry-run
schematics .:nest-add

# execute schematics
schematics .:nest-add --debug false
# or
schematics .:nest-add --dry-run false

Helpful

Helpful article about Custom Angular Schematics which also applies to Nest.

0.23.0

3 months ago

0.23.0-dev.0

6 months ago

0.21.0-dev.2

11 months ago

0.21.0-dev.3

10 months ago

0.20.1

11 months ago

0.21.0

10 months ago

0.22.0-dev.0

10 months ago

0.22.0

9 months ago

0.21.0-dev.1

1 year ago

0.21.0-dev.0

1 year ago

0.20.0

1 year ago

0.20.0-dev.3

1 year ago

0.19.0

2 years ago

0.19.0-dev.1

2 years ago

0.20.0-dev.2

1 year ago

0.20.0-dev.1

1 year ago

0.20.0-dev.0

1 year ago

0.19.0-dev.0

2 years ago

0.18.0-dev.0

2 years ago

0.18.0-dev.1

2 years ago

0.17.0-dev.2

2 years ago

0.17.0-dev.3

2 years ago

0.17.0-dev.0

2 years ago

0.17.0-dev.1

2 years ago

0.16.0

2 years ago

0.17.0

2 years ago

0.18.0

2 years ago

0.15.0

2 years ago

0.15.1

2 years ago

0.15.0-dev.1

2 years ago

0.15.0-dev.0

2 years ago

0.15.0-dev.3

2 years ago

0.15.0-dev.2

2 years ago

0.14.3

3 years ago

0.14.2

3 years ago

0.14.0

3 years ago

0.14.1

3 years ago

0.13.2

3 years ago

0.13.1

3 years ago

0.13.0

3 years ago

0.13.0-dev.1

3 years ago

0.13.0-dev.2

3 years ago

0.13.0-dev.0

3 years ago

0.12.0

3 years ago

0.12.0-dev.0

3 years ago

0.12.0-dev.1

3 years ago

0.12.0-dev.2

3 years ago

0.10.0

3 years ago

0.11.0

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.6.0-dev.1

4 years ago

0.6.0-dev.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.4.1

4 years ago