Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prisma/prisma-client-extensions
Examples of Prisma Client extensions.
https://github.com/prisma/prisma-client-extensions
Last synced: 5 days ago
JSON representation
Examples of Prisma Client extensions.
- Host: GitHub
- URL: https://github.com/prisma/prisma-client-extensions
- Owner: prisma
- License: apache-2.0
- Created: 2022-12-06T18:58:50.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-17T20:06:18.000Z (16 days ago)
- Last Synced: 2024-12-20T14:55:56.859Z (13 days ago)
- Language: TypeScript
- Homepage: https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions/extension-examples
- Size: 280 KB
- Stars: 183
- Watchers: 8
- Forks: 15
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Audit: audit-log-context/.env.example
Awesome Lists containing this project
README
Prisma Client Extension Examples
This repository contains a number of examples of [Prisma Client extensions](https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions).
> The extensions in this repository are provided as examples only, and without warranty. They are not intended to be used in production environments.
## Examples
| Example | Description |
|---|---|
| [`audit-log-context`](audit-log-context) | Provides the current user's ID as context to Postgres audit log triggers |
| [`callback-free-itx`](callback-free-itx) | Adds a method to start interactive transactions without callbacks |
| [`computed-fields`](computed-fields) | Adds virtual / computed fields to result objects |
| [`input-transformation`](input-transformation) | Transforms the input arguments passed to Prisma Client queries to filter the result set |
| [`input-validation`](input-validation) | Runs custom validation logic on input arguments passed to mutation methods |
| [`instance-methods`](instance-methods) | Adds Active Record-like methods like `save()` and `delete()` to result objects |
| [`json-field-types`](json-field-types) | Uses strongly-typed runtime parsing for data stored in JSON columns |
| [`model-filters`](model-filters) | Adds reusable filters that can composed into complex `where` conditions for a model |
| [`obfuscated-fields`](obfuscated-fields) | Prevents sensitive data (e.g. `password` fields) from being included in results |
| [`query-logging`](query-logging) | Wraps Prisma Client queries with simple query timing and logging |
| [`readonly-client`](readonly-client) | Creates a client that only allows read operations |
| [`retry-transactions`](retry-transactions) | Adds a retry mechanism to transactions with exponential backoff and jitter |
| [`row-level-security`](row-level-security) | Uses Postgres row-level security policies to isolate data in a multi-tenant application |
| [`static-methods`](static-methods) | Adds custom query methods to Prisma Client models |
| [`transformed-fields`](transformed-fields) | Demonstrates how to use result extensions to transform query results and add i18n to an app |
| [`exists-fn`](exists-fn) | Adds an `exists` function to all your models |
| [`update-delete-ignore-not-found`](./update-delete-ignore-not-found/) | Adds `updateIgnoreOnNotFound` and `deleteIgnoreOnNotFound` function to all your models |## Authoring extensions
If you're interested in building an extension you want to share as a package, we recommend using the following [starter repository](https://github.com/prisma/prisma-client-extension-starter).
Refer to our [documentation](https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions/shared-extensions) to learn more about how to create and publish extensions.