3.8.0
Today, we are excited to share the 3.8.0
stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements and new features
Full-text search support for MySQL is now in Preview 🚀
We're back from the holidays with a special treat for you.
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()
indexes 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
Preview Features are now mutually exclusive
Before Prisma 3.8.0
, Prisma $transaction
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
In 3.8.0
, we 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("...")
}
}
})
A special thanks to Anthony Luzquiños for raising this issue!
Fixes and improvements
Prisma Migrate
- @map field name swap causes "Field is already defined on model" error
generator.engineType
is not validated- Migrate creates unnecessary migration with SQL syntax error
- Using datasource property that requires preview feature, highlights only value and not property in validation error
- Index
name
validations - Postgres - 63 chars limit for index name
- IE: Not recognizing string type
previewFeatures = []
gets lost after Introspection- Prisma format adds invalid fragments to schema if composites are present on a model
migrate dev
fails on second run with specific schema- Error: [C:\.cargo\registry\src\github.com-1ecc6299db9ec823\tiberius-0.6.4\src\tds\codec\pre_login.rs:129:22] unsupported prelogin token: 2
Prisma Client
- MDBE: Design document for adding
type
support to the Query Engine - Changing prisma query params using middleware doesn't work
- Implement Mysql Fulltext Querying Capabilities
- MongoDB referentialActions in m-n relationships
Error querying the database: db error: ERROR: unsupported startup parameter: options
- How to push a new ObjectId to an array?
@prisma/client
intermittently added and removed fromtransitivePeerDependencies
in lockfile
Language tools (e.g. VS Code)
- Provider-aware auto-completion is not applied to all auto completions
- Add configuration option to turn off file watcher
- VSCode plugin formatting no longer uses editor
tabSize
configuration when indenting blocks
Prisma Studio
- warn(prisma-client) Already 10 Prisma Clients are actively running.
BigInt
breaks studio- Model named "@@id"
Credits
Huge thanks to @hyochan, @cesconix 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, January 13 at 5 pm Berlin | 8 am San Francisco.