Comments (5)
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.
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.
@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.
v1.2.0 released with -p
flag to support this
from prisma-case-format.
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)
- `Unsupported` fields are parsed incorrectly HOT 5
- Enums are not mapped HOT 5
- Add a LICENSE file HOT 4
- Ignore Command & Excluding Enums HOT 4
- Any way to keep enums singular when table names are plural? HOT 3
- Broken output for pascal case HOT 4
- New version of package have old content HOT 1
- No @@map created for enums HOT 5
- Possibility to skip some models HOT 23
- Q. How to use this tool ? HOT 8
- Retain @map annotations for fields with distinct DB column names HOT 6
- Add option to ignore pluralize option per field HOT 8
- [Feature request] Obtain default schema location from package.json
- [Feature request] Enable configuration via package.json HOT 1
- Allow programmatic usage of library (example: vscode formatter extension) HOT 2
- Run Prisma's `formatSchema` before AND after the case formatting to automatically add missing relations HOT 2
- MongoDB ID field issue HOT 4
- Invalid `--uses-next-auth` cli option HOT 1
- Config file does not load before `tryGetFileContents` HOT 2
- Camel case not working as expected for fields with numbers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma-case-format.