This repository was archived by the owner on Apr 15, 2025. It is now read-only.
v0.0.4
🚨 This release contains breaking changes 🚨
Removal of aiohttp and requests
Support for aiohttp and requests has been removed in favour of httpx, as httpx supports both asynchronous and synchronous clients within the same library there is no reason to use aiohttp or requests anymore.
This means that the way you install Prisma Client Python will change. You now no longer need to specify an extra, for example
pip install prisma-client[aiohttp]
turns into
pip install prisma-client
Config changes
The http option has been replaced with the interface option. The new interface option is used to control whether or not the generated client is asynchronous.
Migrating
If you used aiohttp before you should use the following:
generator client {
provider = "prisma-client-py"
interface = "asyncio"
}If you used requests before you should use the following:
generator client {
provider = "prisma-client-py"
interface = "sync"
}Changes
Support for Json types
You can now make use of Prisma's Json type.
model User {
id Int @default(autoincrement())
meta Json
}You can create and search for Json values like so:
from prisma import Json
user = await client.user.create(
data={
'meta': Json.keys(country='Scotland'),
}
)from prisma import Json
user = await client.user.find_first(
where={
'meta': Json({'country': 'Scotland'})
# or
'meta': {
'equals': Json.keys(country='Scotland'),
'NOT': Json(['foo']),
}
}
)Other changes
- Adds support for
BigInttypes. - Improves error message for unsupported types.
- Improves type safety for atomic updates.