GithubHelp home page GithubHelp logo

clayrisser / nestjs-crud-prisma Goto Github PK

View Code? Open in Web Editor NEW
59.0 2.0 13.0 1.06 MB

crud for restful apis built with nestjs and prisma

License: MIT License

Makefile 31.44% TypeScript 66.28% Dockerfile 1.39% Shell 0.89%

nestjs-crud-prisma's People

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  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  avatar

nestjs-crud-prisma's Issues

Library does not follow prisma naming schema anymore

As per their docs, the new naming convention for table names use PascalCase. This library, on the other hand, uses camelCase as per:

this.tableName = camelcase(entity.name);
this.client = this.prisma[this.tableName];

This causes the whole library to break. Would it be possible to either use PascalCase instead or, at the very least, make the table name configurable? (maybe have a passed in options parameter or something?)

Add support for upsert?

Prisma supports upserting. I'm not sure which REST endpoint would be responsible for upserting but it could be super useful.

`client.findOne` is not a function

I'm getting this error requesting a single entity, /users/1 for example.

[Nest] 47207   - 06/20/2021, 6:27:47 AM   [ExceptionsHandler] _this6.client.findOne is not a function +17556ms
TypeError: _this6.client.findOne is not a function
    at /Users/sebas/Sites/ponty.app/node_modules/nestjs-crud-prisma/src/prismaCrudService.ts:389:24
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/sebas/Sites/ponty.app/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _next (/Users/sebas/Sites/ponty.app/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
    at /Users/sebas/Sites/ponty.app/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
    at new Promise (<anonymous>)
    at /Users/sebas/Sites/ponty.app/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12
    at UsersService.getOne (/Users/sebas/Sites/ponty.app/node_modules/nestjs-crud-prisma/src/prismaCrudService.ts:387:46)
    at UsersController.getOneBase (/Users/sebas/Sites/ponty.app/node_modules/@nestjsx/crud/src/crud/crud-routes.factory.ts:211:27)
    at /Users/sebas/Sites/ponty.app/node_modules/@nestjs/core/router/router-execution-context.js:38:29

On the master branch the PrismaCrudService is using the findUnique method but in the npm package it's using findOne.

Enforce only filter/or/search

I think filter, or and search cannot be used with eachother in the same query. I just need to make sure this is correctly enforced.

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.