Hey, I started marching down the route of writing ...
# orm-help
i
Hey, I started marching down the route of writing a “prettify models” tool that would be a step after
prisma introspect
. I wanted to double check this doesn’t already exist. raw introspect output might yield
Copy code
...
model table_name {
  field_name Int @annotations(for()) @days
}
...
prettified output (specifically with
snake_case
table/field names improved)
Copy code
...
model TableName {
  fieldName Int @annotations(for()) @days @map("field_name")

  @@map("table_name")
}
...
Before I go any further, does this already exist in the ecosystem? I couldn’t find anything in
@prisma/sdk
r
@Ian Ray 👋 We have a command
prisma format
that does this. If you need to run it as a post introspect script then you could run this command.
i
Hey @Ryan, thanks for the response. I took a look at the command options for 
prisma format
 , and I think I miscommunicated, sorry about that! I’m looking for something that will take 
snake_case
 db conventions (or lack-thereof db conventions) and reorient them to be 
PascalCase
 models with 
camelCase
 properties. In any case, here’s the command I ended up building: https://www.npmjs.com/package/prisma-case-format
r
Ohh yes, currently this would be the best way to do this simple smile