🚨 This release contains breaking changes 🚨
Removal of aiohttp and requests
Support for `aiohttp` and `requests` has been removed in favour of [httpx](https://github.com/encode/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:
prisma
generator client {
provider = "prisma-client-py"
interface = "asyncio"
}
If you used `requests` before you should use the following:
prisma
generator client {
provider = "prisma-client-py"
interface = "sync"
}
Changes
Support for Json types
You can now make use of Prisma's `Json` type.
prisma
model User {
id Int default(autoincrement())
meta Json
}
You can create and search for `Json` values like so:
py
from prisma import Json
user = await client.user.create(
data={
'meta': Json.keys(country='Scotland'),
}
)
py
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 `BigInt` types.
- Improves error message for unsupported types.
- Improves type safety for atomic updates.