GithubHelp home page GithubHelp logo

broisnischal / prisma-fns Goto Github PK

View Code? Open in Web Editor NEW
35.0 1.0 1.0 429 KB

a revolutionary utility extension for seamless Prisma integration.

Home Page: https://www.npmjs.com/package/prisma-fns

License: MIT License

TypeScript 99.39% Shell 0.61%
prisma prisma-extension prisma-orm

prisma-fns's Introduction

Prisma-Fns

npm version GitHub Repo stars GitHub top language License

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

npm install prisma-fns

Basic Usage

Get Values

// getValues (field, where)
const prisma = new PrismaClient().$extends(getValues);

const user = await prisma.user.getValues("email", {
  email: {
    contains: "@",
  },
});

Log

// console.log
const prisma = new PrismaClient().$extends(log);

const user = await prisma.user.findFirst();

prisma.$log(user);

Exists

const prisma = new PrismaClient().$extends(exists);

// returns boolean
const user = await prisma.user.exists({
  id: 1,
});

logPerf

const prisma = new PrismaClient().$extends(logPerf);

const user = await prisma.user.findFirst();


// logs in console
{
  model: 'User',
  operation: 'findFirst',
  args: {},
  time: 25.3997129797935
}

remember

// creates singleton
const prisma = new PrismaClient().$extends(remember);

save

// saves object
const prisma = new PrismaClient().$extends(save);

generate slug

const prisma = new PrismaClient().$extends(generateSlug);

const user = await prisma.user.findFirst();

// returns slug
user.slug;

Progress

  • Custom Generators
  • Extensions
    • 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
      • log perf logger
      • coming up
  • Docs website
    • Create docs website
    • Example Implementation
  • Tests
    • Unit tests
      • extensions
  • Deploy to production
    • Set up hosting environment
    • Configure CI/CD pipeline
    • 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

License

prisma-fns is open-source software licensed under the MIT license.

prisma-fns's People

Contributors

broisnischal avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rojanmagar2001

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.