Download Latest Version v0.15.0 source code.tar.gz (3.2 MB)
Email in envelope

Get an email when there's a new version of Prisma Client Python

Home / v0.15.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2024-08-16 2.7 kB
v0.15.0 source code.tar.gz 2024-08-16 3.2 MB
v0.15.0 source code.zip 2024-08-16 3.5 MB
Totals: 3 Items   6.7 MB 0

What's Changed

Fixed regression with optional raw query fields

The last release, v0.14.0, included a regression with the handling of optional values for BigInt, Decimal & Json fields where an error would be raised if the value was None.

Massive thank you to @AstreaTSS for a very detailed bug report and contributing a fix!

Support for .create_many() for SQLite

The create_many() method is now supported in SQLite!

:::py
total = await client.user.create_many([{'name': 'Robert'}, {'name': 'Tegan'}])
# 2

However the skip_duplicates argument is unfortunately not supported yet.

Massive thank you to @AdeelK93 for contributing this feature!

Support for connect_or_create

You can now connect or create a relational record through the .create() method, for example:

:::py
post = await client.post.create(
     data={
         'title': 'Post 1',
         'published': True,
         'author': {
             'connect_or_create': {
                 'where': {
                     'id': user.id,
                 },
                 'create': {
                     'name': 'Robert',
                 },
             },
         },
     },
     include={
         'author': True,
     },
 )

Thanks to @AdeelK93 for contributing this feature!

A new search parameter has been added for string field filters in PostgreSQL and MySQL. The syntax within the string is entirely dependent on the underlying database.

For example, in PostgreSQL, a filter for all posts where the title contains "cat" or "dog" would look like this:

:::py
posts = await client.post.find_many(
     where={
         'title': {
             'search': 'cats | dogs',
         },
     }
 )

To use full text search you'll need to add it as a preview feature

:::prisma
generator client {
  provider        = "prisma-client-py"
  previewFeatures = ["fullTextSearch"]
}

See these docs for more details on full text search.

Massive thank you again(!) to @AdeelK93 for contirbuting this feature.

Source: README.md, updated 2024-08-16