This example creates a client that only allows read operations like findMany and count, not write operations like create or update. Calling write operations will result in an error at runtime and at compile time with TypeScript.
This extension is provided as an example only. It is not intended to be used in production environments.
Please read the documentation on query extensions for more information.
- Install Node.js
Clone this repository:
git clone git@github.com:sbking/prisma-client-extensions.gitInstall dependencies:
cd readonly-client
npm installRun the following command. An SQLite database will be created automatically:
npx prisma migrate deployRun the following command to add seed data to the database:
npx prisma db seedTo run the script.ts file, run the following command:
npm run dev