Git Product home page Git Product logo

Comments (8)

fullstackzach avatar fullstackzach commented on July 20, 2024 1

a followup thought, since renaming enums isn't compulsory, should prisma-case-format leave them alone? And/or provide another CLI option to provide a mapping directive and use @@map too? e.g. something like --map-enum-case PascalCase

from prisma-case-format.

iiian avatar iiian commented on July 20, 2024 1

a followup thought, since renaming enums isn't compulsory, should prisma-case-format leave them alone? And/or provide another CLI option to provide a mapping directive and use @@map too? e.g. something like --map-enum-case PascalCase

Could be. I may have more time to look into this issue this weekend or next, will keep you posted once I can immerse my head back in this project

from prisma-case-format.

fullstackzach avatar fullstackzach commented on July 20, 2024 1

Hey @iiian - sorry for the late response here, got caught up with other things. I am using the new version and it is working great, thanks for your efforts!

from prisma-case-format.

iiian avatar iiian commented on July 20, 2024

Hey Zach, I'm glad it's of some value!

I think @@map('enum_name') makes sense too, and I was debating inserting it at one point because it wasn't quite compulsory. For my testing purposes, how are you using the command? Are you using --map-table-case at all?

from prisma-case-format.

fullstackzach avatar fullstackzach commented on July 20, 2024

Here's the command string I use.
npx prisma-case-format --file ./prisma/schema.prisma

I had not tried using --map-table-case yet.

I actually manually went through and added @@map to every enum and that kept them from being changed back to snake_case by Prisma.

from prisma-case-format.

shellscape avatar shellscape commented on July 20, 2024

Another big thanks for putting this together, and another vote for enum handling.

from prisma-case-format.

iiian avatar iiian commented on July 20, 2024

@fullstackzach, I plan to house the behavior of a flag like --map-enum-case under --map-table-case. I don't think it will hurt for the tool to start outputting @@map on all of the schemas for either db-first or model-first. Similarly, I think that for the time-being, I would think people want to have their models views and enums all have the same case convention, which is controlled by --map-table-case. But who knows! Do you have any further strong opinions on the matter? Feel free to share if applicable.

from prisma-case-format.

iiian avatar iiian commented on July 20, 2024

I've released v1.4.0 implementing this feature, if you could pull that version, give it a quick spin and see how it works, that would be appreciated!

https://www.npmjs.com/package/prisma-case-format

from prisma-case-format.

Related Issues (20)

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.