Skip to content

v0.15.0

Latest
Compare
Choose a tag to compare
@RobertCraigie RobertCraigie released this 16 Aug 02:54
· 7 commits to main since this release
b579e0d

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!

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:

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!

Preview support for full text search

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:

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

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.