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

Support for database native type info in DMMF #1069

Open
idiodoneo-chris opened this issue Mar 8, 2025 · 0 comments
Open

Support for database native type info in DMMF #1069

idiodoneo-chris opened this issue Mar 8, 2025 · 0 comments

Comments

@idiodoneo-chris
Copy link

Problem

The database type annotations in the Prisma schema, like @db.Uuid, are not being included in the DMMF that is passed to the generators. However, as of the 5.23.0 timeframe, this information is available from the Prisma CLI. It's quite useful for certain custom generators.

Suggested solution

Add this line in class Field in generator/models.py:

native_type: Optional[Tuple[str, List[str]]] = FieldInfo(alias='nativeType', default=None)

Additional context

This does require setting PRISMA_VERSION to 6.0.0 or later to get the native type information, but does not cause problems with the default version of 5.17.0. The native_type field is simply absent. Using 6.0.0 for custom generators appears to cause no issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant