Skip to content

v0.10.0

Compare
Choose a tag to compare
@RobertCraigie RobertCraigie released this 28 Aug 10:13
· 161 commits to main since this release
823bad9

What's Changed

This release adds support for Pydantic v2 while maintaining backwards compatibility with Pydantic v1.

This should be a completely transparent change for the majority of users with one exception regarding prisma.validate.

Due to this bug we can't use the new TypeAdapter concept in v2 and instead rely on the v1 re-exports, this has the implication that any errors raised by the validator will need to be caught using the v1 ValidationError type instead, e.g.

from pydantic.v1 import ValidationError
import prisma

try:
    prisma.validate(...)
except ValidationError:
    ...

Improved timeouts inputs

All timeout arguments now accept a datetime.timedelta instance as well as the previously accepted int / float types, however support for int / float has been deprecated and will be removed in a future release.

The previous values were used inconsistently, sometimes it meant seconds and sometimes it meant milliseconds. This new structure is more flexible and allows you to specify the time in whatever format you'd like. Thanks @jonathanblade!

from datetime import timedelta
from prisma import Prisma

db = Prisma(
  connect_timeout=timedelta(seconds=20),
)

Misc Changes

Thanks @zspine and @jonathanblade for contributing!

sponsors