This repository was archived by the owner on Apr 15, 2025. It is now read-only.
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
Uh oh!
There was an error while loading. Please reload this page.
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.tomlfileYou can now configure Prisma Client Python using an entry in your
pyproject.tomlfile 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
.envfiles overriding environment variablesPreviously any environment variables present in the
.envorprisma/.envfile 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.envfile 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
BytestypesYou can now generate JSON Schemas / OpenAPI Schemas for models that use the
Bytestype.{ "title": "MyModel", "type": "object", "properties": { "image": { "title": "Image", "type": "string", "format": "byte" } }, "required": [ "image" ] }Add support for using the
Base64type in custom pydantic modelsYou can now use the
Base64type in your own Pydantic models and benefit from all the advanced type coercion that Pydantic provides! Previously you would have to manually construct theBase64instances 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
Prismainstance 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
builtinsmodule, thanks @leejayhsu!*.pycand__pycache__files during client generation\excludeandexclude_relational_fieldsare 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.
All reactions