Alex Ruheni
db pull+
, db push
and migrate
commands for MySQL and MongoDB databases as a Preview feature. For now, we do not enable the full-text search commands in the Prisma Client. They will be implemented separately. You can follow the progress in the MongoDB and MySQL issues.
Add the Preview feature fullTextIndex
to the Prisma schema, after which the @@fulltext
attribute is allowed in the Prisma schema:
generator js {
provider = "prisma-client-js"
previewFeatures = ["fullTextIndex"]
}
model A {
id Int @id
title String @db.VarChar(255)
content String @db.Text
@@fulltext([title, content])
}
Note: It is mandatory to do db pull
with the Preview feature enabled before using Prisma Migrate on existing MySQL databases, so the index types can be converted and will not get overwritten in the next migration.
For more details checkout our documentation.
💥 Hash index support for PostgreSQL (Preview)
With the extendedIndexes
Preview feature, it is now possible to use Hash
instead of the default BTree
as the index algorithm on PostgreSQL databases. A hash index can be much faster for inserts, but it only supports equals operation in the database. Here’s an example of using a hash index:
generator js {
provider = "prisma-client-js"
previewFeatures = ["extendedIndexes"]
}
model A {
id Int @id
value Int
@@index([value], type: Hash)
}
For more details checkout our documentation.
🚀 VS Code extension now uses a Wasm module
Starting with 3.6.0
, the language server and the VS Code extension use logic compiled to WebAssembly and distributed through npm. If you have any feedback, please leave an issue in the `prisma/language-tools` repository.
✨ Bytes
can now be filtered with in
and notIn
You can now use in
and notIn
operations on the Bytes
type:
const audioTracks = raws.map(raw => {
return Buffer.from(raw)
})
const result = await prisma.audio.find({
where: {
track:
in: audioTracks
}
}
})
👀 Json
fields now accept read-only types
You can now pass immutable values into Json
fields. In the following example, audit
is a Json
field that accepts a read-only array:
const trail = [
{ event: "signup" },
{ event: "subscribe" },
{ event: "invite friend" }
] as const
await prisma.user.create({
data: {
audit: trail
}
})
Learn more in this issue.
📚 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 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, @nikolasburk and @Daniel Norman will discuss the latest release and other news from the Prisma ecosystem in a on Wednesday at 5 pm Berlin | 8 am San Francisco