Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add option to pascal case model names #71

Open
capaj opened this issue Aug 7, 2022 · 3 comments
Open

Feature request: add option to pascal case model names #71

capaj opened this issue Aug 7, 2022 · 3 comments
Assignees
Labels
Feature Request New feature or request help wanted Extra attention is needed working on it The bug or the feature request is accepted and the maintainer is working on it

Comments

@capaj
Copy link
Contributor

capaj commented Aug 7, 2022

Is your feature request related to a problem? Please describe.

Sometimes I want to use this with a database which has very ugly snake cased table names

Describe the solution you'd like

I wish I could set pascalCaseModelNames=true and the generator would rename all models to be pascal cased

Describe alternatives you've considered

none

Additional context

@capaj capaj added Feature Request New feature or request help wanted Extra attention is needed labels Aug 7, 2022
@capaj capaj changed the title Feature request: pascal case model names Feature request: add option to pascal case model names Aug 7, 2022
@YassinEldeeb
Copy link
Owner

Yeah, that'd be cool

@YassinEldeeb YassinEldeeb added the working on it The bug or the feature request is accepted and the maintainer is working on it label Aug 7, 2022
@YassinEldeeb
Copy link
Owner

YassinEldeeb commented Aug 7, 2022

What do you think the filename should be?

  1. very_ugly_name.ts or
  2. VeryUglyName.ts

I think it should follow the DB name as that's probably the one that'll be used when searching for it using CTRL + P on VSC to find the file, but I want to hear your opinion too.

@YassinEldeeb
Copy link
Owner

Now that I've implemented it. I think that mapping a table name should fix that problem. What do you think?

model PrettyName {
  id  Int   @id @default(autoincrement())
  something Bytes

  @@map("very_ugly_name")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request help wanted Extra attention is needed working on it The bug or the feature request is accepted and the maintainer is working on it
Projects
None yet
Development

No branches or pull requests

2 participants