prisma-client-py
prisma-client-py copied to clipboard
Incorrect naming convention on generated client
Bug description
Model names are not properly converted to snake_case according to python code styles. For example, a model "SnakeCase" should be accessible as "snake_case" in python using the prisma client.
How to reproduce
- Name a model consisting of two words (the same bug probably occurs when using more than two words).
In my case
OrganisationAffiliation
. - Run
prisma generate
- Try to access the same model in python code. The model is exposed as
prisma.organisationaffiliation
instead ofprisma.organisation_affiliation.
Expected behavior
Prisma information
model OrganisationAffiliation {
userId Int
user User @relation(fields: [userId], references: [id])
organisationId Int
organisation Organisation @relation(fields: [organisationId], references: [id])
is_owner Boolean @default(false)
hourly_rate Float?
@@unique([userId, organisationId], name: "affiliationId")
}
Environment & setup
- OS: Alpine Linux (inside a Docker Container).
- Database: Postgres
- Python version: 3.11.2
- Prisma version:
prisma : 4.10.1
prisma client python : 0.8.1
platform : linux-musl
expected engine version : aead147aa326ccb985dcfed5b065b4fdabd44b19
install path : /usr/local/lib/python3.11/site-packages/prisma
installed extras : []