Question: Can instrospection change table names to something else? like camelCased? #1925
-
Hi, I'm wondering specifically about tableNames -> modelNames. I'd prefer pascal case or camel case to snake case (what i write table names in). I'd also extend this to column names as well. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Yes, you can change the introspected table names using the Example: model User {
id String @id @default(cuid())
name String
@@map("user")
} |
Beta Was this translation helpful? Give feedback.
-
@Charlex we have a dedicated docs page for that in the new docs (which will be published soon) |
Beta Was this translation helpful? Give feedback.
-
I see, thank you! I'm wondering how hard it would be to transform the model names to pascal case automatically as part of the introspection. Part of my goal is to simply have the Prisma2 schema be an always-generated output of the database. I suppose I could write a script that would just help me do what the docs suggest to do manually. I almost wonder if introspection should do this by default to help users conform to Prisma's naming conventions. |
Beta Was this translation helpful? Give feedback.
Yes, you can change the introspected table names using the
@@map
directive.Example: