Git Product home page Git Product logo

Comments (5)

iiian avatar iiian commented on July 2, 2024

Hi @ozum! It is currently not possible to do this with prisma-case-format. My gut (which may be wrong) is that this feature is a little bit out of scope.

Are you currently facing a situation where you have a large number (more than a dozen) of fields that are array types?

from prisma-case-format.

ozum avatar ozum commented on July 2, 2024

Hi @iiian. I mean one to many relations. They are array fields and I have hundreds of them. Below is just one example model. All foreign key fields are array.

Having plurals for array fields would be much more intuitive.

model Business {
  id                 String               @id(map: "BusinessId") @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  languageCode       String               @db.Char(2)
  currencyCode       String               @db.Char(3)
  createdAt          DateTime             @default(now()) @db.Timestamptz(0)
  name               String               @db.VarChar(64)
  languages          String[]             @default([]) @db.Char(2)
  phone              String               @db.VarChar(15)
  address            String?              @db.VarChar(250)
  billingName        String?              @db.VarChar(64)
  billingAddress     String?              @db.VarChar(250)
  taxOffice          String?              @db.VarChar(64)
  taxId              String?              @db.VarChar(64)
  defaultTaxRate     Decimal?             @db.Decimal(8, 6)
  isActive           Boolean              @default(true)
  batchOperation     BatchOperation[]
  currency           Currency             @relation(fields: [currencyCode], references: [code], onUpdate: Restrict, map: "BusinessCurrency")
  language           Language             @relation(fields: [languageCode], references: [code], onUpdate: Restrict, map: "BusinessLanguage")
  ingredientCategory IngredientCategory[]
  itemCategory       ItemCategory[]
  optionCategory     OptionCategory[]
  profile            Profile[]
  recipe             Recipe[]
  tab                Tab[]
  targetGroup        TargetGroup[]

  @@schema("public")
}

from prisma-case-format.

iiian avatar iiian commented on July 2, 2024

@ozum I see. While this is probably better raised with the prisma team itself, I get how getting small features fulfilled with them at this point is probably like pulling teeth because it's large project with a scheduled roadmap.

I can add a dep for pluralize.

from prisma-case-format.

iiian avatar iiian commented on July 2, 2024

v1.2.0 released with -p flag to support this

from prisma-case-format.

ozum avatar ozum commented on July 2, 2024

I get how getting small features fulfilled with them at this point is probably like pulling teeth because it's large project with a scheduled roadmap.

Exactly :). For the same reasons, I developed vuepress-bar. I prefer it was built-in.

v1.2.0 released with -p flag to support this

Thanks for fast response.

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.