202 karma · joined October 25, 2021
```py
from typing import TYPE_CHECKING
if TYPE_CHECKING:
Foo = "expression that mypy can understand"
else:
Foo = "dynamic expression"
```SQLAlchemy on the other hand provides very little (if any) type hints for their query API.
> Prisma Python
I originally decided to go with Prisma Client Python however I found this to be too verbose and have recently used Prisma Python. I do need to decide on one and stick with that. Thanks for pointing that out
Yeah that is understandable, it is being successfully used in production but it is safer to use a more stable ORM for mission critical products.
If you don't want to have to duplicate your model definitions you could write a custom Prisma Generator to generate models for a different Python ORM.
https://prisma-client-py.readthedocs.io/en/stable/reference/...
The biggest blockers in terms of performance are:
- Communication with the internal Rust engine is performed over HTTP instead of FFI.
- You cannot select a subset of fields (every scalar field in a model is selected)
- You cannot skip pydantic validation which while fast is unnecessary in some cases
With that said Prisma Python should be reasonably fast but I would expect it to be on the lower end of the spectrum compared to other Python ORMs. I have ran some load tests locally and creating 500,000 records took about 90 seconds.
Happy to answer any questions!
Happy to answer any questions!