This example demonstrates how to create a Prisma Client extension that adds an exists method to all your models.
This extension is provided as an example only. It is not intended to be used in production environments.
Please read the documentation on model extensions for more information.
- Install Node.js
Clone this repository:
git clone [email protected]:sbking/prisma-client-extensions.gitInstall dependencies:
cd exists-fn
npm installRun the following command. An SQLite database will be created automatically and seeded with data contained in seed.ts:
npx prisma migrate dev --name initTo run the script.ts file, run the following command:
npm run dev