You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Experimental support for the Decimal type has been added. The reason that support for this type is experimental is due to a missing internal feature in Prisma that means we cannot provide the same guarantees when working with the Decimal API as we can with the API for other types. For example, we cannot:
Raise an error if you attempt to pass a Decimal value with a greater precision than the database supports, leading to implicit truncation which may cause confusing errors
Set the precision level on the returned decimal.Decimal objects to match the database level, potentially leading to even more confusing errors.
If you need to use Decimal and are happy to work around these potential footguns then you must explicitly specify that you are aware of the limitations by setting a flag in the Prisma Schema:
Updates on the status of support for Decimal will be posted in #106.
Add triple-slash comments to generated models
You can now add comments to your Prisma Schema and have them appear in the docstring for models and fields! For example:
/// The User modelmodelUser {/// The user's email addressemailString}
Will generate a model that looks like this:
classUser(BaseModel):
"""The User model"""email: str"""The user's email address"""
Improved import error message if the client has not been generated
If you try to import Prisma or Client before you've run prisma generate then instead of getting an opaque error message:
>>> from prisma import Prisma
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Prisma' from 'prisma' (/prisma/__init__.py)
you will now get an error like this:
>>> from prisma import Prisma
Traceback (most recent call last):
...
RuntimeError: The Client hasn't been generated yet, you must run `prisma generate` before you can use the client.
See https://prisma-client-py.readthedocs.io/en/stable/reference/troubleshooting/#client-has-not-been-generated-yet
The query batcher is now publicly exposed
You can now import the query batcher directly from the root package, making it much easier to type hint and providing support for an alternative API style:
The internal Prisma binaries that Prisma Python makes use of have been upgraded from v3.10.0 to v3.11.1. For a full changelog see the v3.11.0 release notes and v3.11.1 release notes.
Sponsors
This project is now being sponsored by @prisma and @techied. I am so incredibly grateful to both for supporting Prisma Client Python 💜
This discussion was created from the release v0.6.4.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What's Changed
Experimental support for the
Decimal
typeExperimental support for the Decimal type has been added. The reason that support for this type is experimental is due to a missing internal feature in Prisma that means we cannot provide the same guarantees when working with the Decimal API as we can with the API for other types. For example, we cannot:
Decimal
value with a greater precision than the database supports, leading to implicit truncation which may cause confusing errorsdecimal.Decimal
objects to match the database level, potentially leading to even more confusing errors.If you need to use Decimal and are happy to work around these potential footguns then you must explicitly specify that you are aware of the limitations by setting a flag in the Prisma Schema:
The
Decimal
type maps to the standard library's Decimal class. All available query operations can be found below:Updates on the status of support for
Decimal
will be posted in #106.Add triple-slash comments to generated models
You can now add comments to your Prisma Schema and have them appear in the docstring for models and fields! For example:
Will generate a model that looks like this:
Improved import error message if the client has not been generated
If you try to import
Prisma
orClient
before you've runprisma generate
then instead of getting an opaque error message:you will now get an error like this:
The query batcher is now publicly exposed
You can now import the query batcher directly from the root package, making it much easier to type hint and providing support for an alternative API style:
Prisma upgrade
The internal Prisma binaries that Prisma Python makes use of have been upgraded from v3.10.0 to v3.11.1. For a full changelog see the v3.11.0 release notes and v3.11.1 release notes.
Sponsors
This project is now being sponsored by @prisma and @techied. I am so incredibly grateful to both for supporting Prisma Client Python 💜
This discussion was created from the release v0.6.4.
Beta Was this translation helpful? Give feedback.
All reactions