Ian Ray
03/29/2021, 1:30 AMprisma introspect
. I wanted to double check this doesn’t already exist.
raw introspect output might yield
...
model table_name {
field_name Int @annotations(for()) @days
}
...
prettified output (specifically with snake_case
table/field names improved)
...
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
Ryan
03/29/2021, 7:21 AMprisma format
that does this. If you need to run it as a post introspect script then you could run this command.Ian Ray
03/29/2021, 8:22 AMprisma 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-formatRyan
03/29/2021, 8:32 AM