Skip to content

3.8.0

Compare
Choose a tag to compare
@Jolg42 Jolg42 released this 11 Jan 15:23
· 3510 commits to main since this release
e423f38

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 ObjectIds 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

Prisma Client

Language tools (e.g. VS Code)

Prisma Studio

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.