https://github.com/broisnischal/prisma-fns
a revolutionary utility extension for seamless Prisma integration.
https://github.com/broisnischal/prisma-fns
prisma prisma-extension prisma-orm
Last synced: about 1 year ago
JSON representation
a revolutionary utility extension for seamless Prisma integration.
- Host: GitHub
- URL: https://github.com/broisnischal/prisma-fns
- Owner: broisnischal
- License: mit
- Created: 2024-01-25T15:37:14.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-06T02:14:48.000Z (about 2 years ago)
- Last Synced: 2025-04-06T12:12:07.199Z (about 1 year ago)
- Topics: prisma, prisma-extension, prisma-orm
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/prisma-fns
- Size: 371 KB
- Stars: 39
- Watchers: 1
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Roadmap: roadmap.md
Awesome Lists containing this project
README
# Prisma-Fns
[](https://www.npmjs.com/package/prisma-fns)


[](https://opensource.org/licenses/MIT)
Prisma-Fns is a revolutionary utility extension for seamless Prisma integration. It enhances your workflow, simplifies common tasks and functions, and boosts the efficiency of your Prisma-powered applications.
## Installation
```bash
npm install prisma-fns
```
## Basic Usage
#### Get Values
```ts
// getValues (field, where)
const prisma = new PrismaClient().$extends(getValues);
const user = await prisma.user.getValues("email", {
email: {
contains: "@",
},
});
```
#### Log
```ts
// console.log
const prisma = new PrismaClient().$extends(log);
const user = await prisma.user.findFirst();
prisma.$log(user);
```
#### Exists
```ts
const prisma = new PrismaClient().$extends(exists);
// returns boolean
const user = await prisma.user.exists({
id: 1,
});
```
#### logPerf
```ts
const prisma = new PrismaClient().$extends(logPerf);
const user = await prisma.user.findFirst();
// logs in console
{
model: 'User',
operation: 'findFirst',
args: {},
time: 25.3997129797935
}
```
#### remember
```ts
// creates singleton
const prisma = new PrismaClient().$extends(remember);
```
#### save
```ts
// saves object
const prisma = new PrismaClient().$extends(save);
```
#### generate slug
```ts
const prisma = new PrismaClient().$extends(generateSlug);
const user = await prisma.user.findFirst();
// returns slug
user.slug;
```
## Progress
- [ ] Custom Generators
- [x] Extensions
- [x] Generate Singleton client
- [ ] Fuzzy search feature for specified model
- [ ] Increase Decrease Math Operations for field in provided model
- [ ] Pagination utils
- [ ] Luxon for date time fields
- [ ] Query Optimization Extension
- [ ] Toggle via slug
- [ ] Compare and Update
- [ ] Auto select field/model
- [ ] auto generate slug in provided model
- [ ] deselect password when querying
- [ ] more coming soon...
- [ ] Extras
- [x] log perf logger
- [ ] coming up
- [ ] Docs website
- [ ] Create docs website
- [ ] Example Implementation
- [ ] Tests
- [ ] Unit tests
- [ ] extensions
- [x] Deploy to production
- [x] Set up hosting environment
- [x] Configure CI/CD pipeline
- [x] Deploy package
### Contributing
If you'd like to contribute, please follow our contribution guidelines.
## Support
If you like the project, please consider supporting us by giving a ⭐️ on Github.
### Bugs
If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/broisnischal/prisma-fns/issues)
### License
prisma-fns is open-source software licensed under the MIT [license](LICENSE).