/fastify-plugin-prisma

Prisma plugin for fastify

Primary LanguageJavaScriptApache License 2.0Apache-2.0

@joshuaavalon/fastify-plugin-prisma

Version npm License

Getting Started

npm i @joshuaavalon/fastify-plugin-prisma

Usage

import prismaPlugin from "@joshuaavalon/fastify-plugin-prisma";
await fastify.register(prismaPlugin, opts);

const user = await fastify.db.user.findFirst();

Options

url

  • Type: string | undefined
  • Default: undefined

Database connection string. undefined uses url defined in schema.prisma.

logLevel

  • Type: Prisma.LogLevel[] | undefined
  • Default: undefined

Control which event to log. Default log all level.

disableLogBindings

  • Type: boolean | undefined
  • Default: false

Disable plugin in log bindings