Prisma: 2.30.0 Release

Release date:
August 24, 2021
Previous version:
2.29.1 (released August 13, 2021)
Magnitude:
418 Diff Delta
Contributors:
7 total committers
Data confidence:
Commits:

44 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored August 24, 2021
Authored August 10, 2021
Authored August 13, 2021
Authored August 18, 2021
Authored August 18, 2021
Authored August 11, 2021

Top Contributors in 2.30.0

Jolg42
millsp
janpio
williamluke4
saintmalik
renovate-bot
prisma-bot

Directory Browser for 2.30.0

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

Today, we are excited to share theย 2.30.0ย stable releaseย ๐ŸŽ‰

๐ŸŒŸย Help us spread the word about Prisma by starring the repoย orย tweetingย about the release. ๐ŸŒŸย 

New features & improvements

Full-Text Search for PostgreSQL is now in Preview ๐Ÿš€

We're excited to announce that Prisma Client now has preview support for Full-Text Search on PostgreSQL.

You can give this a whirl in 2.30.0 by enabling the fullTextSearch preview flag:

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

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

model Post {
  id     Int    @id @default(autoincrement())
  title  String @unique
  body   String
  status Status
}

enum Status {
  Draft
  Published
}

After you regenerate your client, you'll see a new search field on your String fields that you can query on. Here are a few examples:

// returns all posts that contain the words cat *or* dog.
const result = await prisma.post.findMany({
  where: {
    body: {
      search: 'cat | dog',
    },
  },
})

// All drafts that contain the words cat *and* dog.
const result = await prisma.posts.findMany({
  where: {
    status: "Draft",
    body: {
      search: 'cat & dog',
    },
  },
})

You can learn more about how the query format works in our documentation. We would love to know your feedback! If you have any comments or run into any problems we're available in this in this Github issue.

Validation errors for referential action cycles on Microsoft SQL Server โ„น

Microsoft SQL Server has validation rules for your schema migrations that reject schema changes that introduce referential action cycles. These scenarios tend to show up often for developers using the referentialActions preview feature, which will become the default. The database error you get is not really helpful, so to provide a better experience, Prisma now checks for referential cycle actions when it validates your schema file and shows you the exact location of the cycle in your schema.

To learn more, check out the documentation.

prisma introspect is being deprecated in favor of prisma db pull ๐Ÿ‘‹๐Ÿป

The prisma introspect command is an alias for prisma db pull so they are the same command. However, prisma db pull is more intuitive since it pulls the schema from the database into your local schema.prisma file. This naming also works as the counterpart of prisma db push.

Starting with this release, you will get a warning that encourages you to use prisma db pull instead of prisma introspect.

Prisma Adopts Semantic Versioning (SemVer)

As previously announced, we are adjusting our release policy to adhere more strictly to Semantic Versioning.

In the future, breaking changes in the stable development surface i.e. General Availability will only be rolled out with major version increments.

You can learn more about the change in the announcement blog post.

Fixes and improvements

Prisma Client

Prisma Migrate

Language tools (e.g. VS Code)

@prisma/engines npm package

Credits

Huge thanks to @saintmalik for helping!

๐Ÿ“บ Join us for another "What's new in Prisma" livestream

Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" livestream.

The stream takes place on Youtube on Thursday, August 26 at 5pm Berlin | 8am San Francisco.