Today, we are excited to share the `3.5.0` stable release 🎉
🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20prisma%20release%20v3.5.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.5.0) about the release.** 🌟
Major improvements & new features
Order by relevance in full text search (PostgreSQL)
In `3.5.0`, we've added support for ordering full text search results by _relevance_. Ordering by relevance gives you a way to order search results by the best match. You can enable order by relevance and full-text search with the `fullTextSearch` feature flag:
prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model People {
id Int id default(autoincrement())
bio String
}
While this feature is useful standalone, it's most commonly used in combination with the full text `search` field in the `where` clause:
tsx
const query = "node.js developer"
const developers = await prisma.people.findMany({
where: {
bio: {
// Only select people whose bio's contain "node.js developer"
search: query,
},
},
orderBy: {
// Order that selection by query relevance.
_relevance: {
fields: ["bio"],
search: query,
sort: "desc",
},
},
})
Learn more in [our documentation](https://prisma.io/docs/concepts/components/prisma-client/filtering-and-sorting#sort-by-relevance-postgresql) and if you run into any issues or have feedback for us, you can reach us in [this issue](https://github.com/prisma/prisma/issues/8877).
More configuration options for indexes and constraints in the Prisma schema (Preview)
We are extending the syntax in the Prisma schema to add support for _configuration of length_ and _sort order_. This applies to:
- indexes
- unique constraints
- primary key constraints
These new configuration options come with full support for the `prisma db pull`, `prisma db push` and `prisma migrate dev` commands, so index configuration can now be managed, evolved and deployed using Prisma's schema management tooling.
Two new arguments can now be specified per field:
- `length` (the maximum length of items in the index)
- `sort` (how an index is sorted)
In order to use these new capabilities, add the `extendedIndexes` feature flag in the generator block:
prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["extendedIndexes"]
}
The change affects the `id`, `id`, `unique`, `unique` and `index` fields in certain databases:
- The `length` argument is available on MySQL on the `id`, `id`, `unique`, `unique` and `index` fields. It allows Prisma to now support indexes and constraints on `String` with a `TEXT` native type and `Bytes` types.
- The `sort` argument is available for all databases on the `unique`, `unique` and `index` fields. Additionally, SQL Server also allows it on `id` and `id`.
The following example demonstrates the use of the `sort` and `length` arguments:
prisma
model Post {
title String db.VarChar(300)
abstract String db.VarChar(3000)
slug String db.VarChar(3000) unique(sort: Desc, length: 42)
author String
created_at DateTime
id([title(length: 100, sort: Desc), abstract(length: 10)])
index([author, created_at(sort: Desc)])
}
> ⚠️ **Warning:** This might be a _breaking change_ for some users. To learn how to mitigate that, please read the documentation linked below.
Learn more in the documentation on [index configuration](https://www.prisma.io/docs/concepts/components/prisma-schema/index-configuration).
Case insensitive filtering for Prisma Client Go
We've had this feature in the Prisma Client JS for awhile, but in this release, we've added case-insensitive query support to the Go Client as well. Now you can worry a bit less about what kind of data the user is going to send your way.
go
users, err := client.User.FindMany(
User.Email.Equals("prisMa"),
User.Email.Mode(QueryModeInsensitive), // sets case insensitivity
).Exec(ctx)
Learn more in [our documentation](https://github.com/prisma/prisma-client-go/blob/main/docs/features/casing.md).
Fixes and improvements
Prisma Client
- [Postgres Native Types: Improve error when `uuid` is invalid](https://github.com/prisma/prisma/issues/4060)
- [Implement missing Mongo referential actions emulation](https://github.com/prisma/prisma/issues/9014)
- [Type of `_count` key of relation count is nullable](https://github.com/prisma/prisma/issues/9416)
- [CFW: Add E2E tests](https://github.com/prisma/prisma/issues/9596)
- [Improve Connection Pool Timeout error message](https://github.com/prisma/prisma/issues/9662)
- [Prisma Client: Query Engine `engineType=binary` incompatible with Node.js v17?](https://github.com/prisma/prisma/issues/9903)
- [CI: Test on Node.js Active LTS v16](https://github.com/prisma/prisma/issues/10022)
- [After upgrading from 3.2.1 to 3.3.0 I get a 'Error: Cannot find module 'os''](https://github.com/prisma/prisma/issues/10058)
- [Data Proxy client fails when multi-byte chars are used](https://github.com/prisma/prisma/issues/10152)
Prisma Migrate
- [Commented out env var values from `.env` are logged via `DEBUG=*`](https://github.com/prisma/prisma/issues/9428)
- [`db push` crashes on SQL Server because of `Error: There is already an object named 'Post_authorId_fkey' in the database.`](https://github.com/prisma/prisma/issues/9537)
- [[PSL] Expanded Index Capabilities](https://github.com/prisma/prisma/issues/9577)
- [MongoDB: Cannot create m-n relations](https://github.com/prisma/prisma/issues/10071)
- [Implement a new `cockroachdb` provider in the Schema Parser](https://github.com/prisma/prisma/issues/10079)
Prisma Engines
- [Update prisma-engines README](https://github.com/prisma/prisma-engines/issues/2295)
Language tools (e.g. VS Code)
- [Auto completion support for `engineType = "dataproxy"` or similar](https://github.com/prisma/language-tools/issues/886)
- ["before all" hook in "Completions": Error: Timeout of 2000ms exceeded.](https://github.com/prisma/language-tools/issues/924)
- [Decide on and prototype provider aware auto completion](https://github.com/prisma/language-tools/issues/927)
🎉 The Serverless Data Conference is happening on Thursday (Nov 18)
Join us for the first [Prisma Serverless Data Conference](https://www.prisma.io/serverless) about all things **databases and serverless**. Here's an overview of the speakers at the conference:
- Kevin Jernigan, **MongoDB**
- Greg McKeon, **Cloudflare**
- Jason Lengstorf, **Netlify**
- Sugu Sougoumarane and Taylor Barnett, **PlanetScale**
- Aydrian Howard, **CockroachDB**
- Hassan El Mghari, **Vercel**
In addition to these fantastic talks, you can look forward to the **Prisma keynote** with a lot of information about the current status and upcoming plans for the [Prisma Data Platform](https://www.prisma.io/docs/concepts/components/prisma-data-platform).
📺 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"](https://www.youtube.com/watch?v=2uOzqjFBSEQ&ab_channel=Prisma) livestream.
The stream takes place [on Youtube](https://www.youtube.com/watch?v=2uOzqjFBSEQ&ab_channel=Prisma) on **Wednesday, November 17** at **5pm Berlin | 9am San Francisco**.
> **Note**: We usually stream on Thursdays, but **this week we have moved the stream to Wednesday** to leave space for the Serverless Data Conference on Thursday.