Alex Ruheni
3.8.0
prisma rainbow
๐ Full-text search support for MySQL is now in Preview
Prisma now supports full-text search in MySQL. You can enable full-text support by adding the fullTextIndex
and fullTextSearch
Preview flags in your Prisma schema and defining @@fulltext()
index on fields youโd like to use full-text search on.
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextIndex", "fullTextSearch"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model Post {
id Int @id @default(autoincrement())
title String @unique
@@fulltext([title])
}
Run prisma db push
or prisma migrate dev
to update your database schema. Prisma Client will also be re-generated, enabling you to use full-text search in your application.
// search for titles that contain cat, but not fox
await prisma.post.findMany({
where: {
title: {
search: "+cat -fox",
},
},
})
Learn more in our documentation.
๐ง dataProxy
and interactiveTransactions
are now mutually exclusive
Before Prisma 3.8.0
, Prisma queries would fail whenever the Data Proxy and interactive transactions Preview features were used together. The interactiveTransactions and dataProxy Preview flags cannot be used together in this release. Generating the Prisma Client when both Preview features are enabled will throw an error.
๐ง Fixed support for push
when adding an element to an array in MongoDB
Prisma 3.8.0
fixed push
support for `ObjectId`s on MongoDB. Given the following schema:
model Course {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
title String
students String[] @db.Array(ObjectId)
}
You can now run the following query:
// Add a new student to the course
await prisma.course.update({
where: {
id: 1
},
data: {
students: {
push: new ObjectID("...")
}
}
})
๐ Learn more in the release notes
For more info and links to documentation, you can read the release notes.
๐ Help us spread the word about Prisma ๐
To help spread the word about Prisma, weโd very much appreciate it if you would star the repo ๐ And if youโre excited about the features in this weekโs release, then help us and share your excitement on Twitter.
๐ฐ Join us on Thursday for the โWhatโs new in Prismaโ livestream
This week, I will discuss the latest release and other news from the Prisma ecosystem in a on Thursday at 5 pm Berlin | 8 am San Francisco