v0.7.0 #503
RobertCraigie
started this conversation in
General
v0.7.0
#503
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Breaking Changes
Path resolution for relative SQLite databases fixed
Previously there was a mismatch between the resolution algorithm for relative SQLite paths which could cause the Client and the CLI to point to different databases.
The mismatch is caused by the CLI using the path to the Prisma Schema file as the base path whereas the Client used the current working directory as the base path.
The Client will now use the path to the Prisma Schema file as the base path for all relative SQLite paths, absolute paths are unchanged.
What's Changed
Add support for configuration through the
pyproject.toml
fileYou can now configure Prisma Client Python using an entry in your
pyproject.toml
file instead of having to set environment variables, e.g.It should be noted that you can still use environment variables if you so desire, e.g.
PRISMA_BINARY_CACHE_DIR=".binaries"
This will also be useful as a workaround for #413 until the default behaviour is changed in the next release.
See the documentation for more information.
Fix
.env
files overriding environment variablesPreviously any environment variables present in the
.env
orprisma/.env
file would take precedence over the environment variables set at the system level. This behaviour was not correct as it does not match what the Prisma CLI does. This has now been changed such that any environment variables in the.env
file will only be set if there is not an environment variable already present.Add support for Python 3.11
Python 3.11 is now officially supported and tested!
It should be noted that you may encounter some deprecation warnings from the transitive dependencies we use.
Add support for generating JSON Schema for
Bytes
typesYou can now generate JSON Schemas / OpenAPI Schemas for models that use the
Bytes
type.Add support for using the
Base64
type in custom pydantic modelsYou can now use the
Base64
type in your own Pydantic models and benefit from all the advanced type coercion that Pydantic provides! Previously you would have to manually construct theBase64
instances yourself, now Pydantic will do that for you!It should be noted that this assumes that the data you pass is a valid base64 string, it does not do any conversion or validation for you.
Add support for unregistering a client instance
You can now unregister a client instance, this can be very useful for writing tests that interface with Prisma Client Python. However, you shouldn't ever have to use this outside of a testing context as you should only be creating a single
Prisma
instance for each Python process unless you are supporting multi-tenancy. Thanks @leejayhsu for this!Access the location of the Prisma Schema file
You can now access the location of the Prisma Schema file used to generate Prisma Client Python.
Other Changes
builtins
module, thanks @leejayhsu!*.pyc
and__pycache__
files during client generation\
exclude
andexclude_relational_fields
are givenContributors
Many thanks to @leejayhsu, @lewoudar, @tyteen4a03 and @nesb1 for contributing to this release!
Sponsors
A massive thank you to @prisma and @techied for their continued support! It is incredibly appreciated 💜
I'd also like to thank GitHub themselves for sponsoring me as part of Maintainer Month!
This discussion was created from the release v0.7.0.
Beta Was this translation helpful? Give feedback.
All reactions