nikolasburk
3.3.0
, we're releasing Early Access support for Prisma Client connection pooling using the Prisma Data Proxy. The Data Proxy feature of the Prisma Data Platform is now accessible to all users of the Prisma Data Platform (no need to request access). For detailed documentation and instructions about the Data Proxy, check out pris.ly/data-proxy.
Using this new feature in Prisma Client and leveraging the Data Proxy, developers can now also deploy Prisma applications on Cloudflare Workers. Here's what it looks like to use Prisma Client inside of this environment:
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request: Request): Promise<Response> {
await prisma.log.create({
data: {
level: 'Info',
message: `${request.method} ${request.url}`,
},
})
return new Response(`request method: ${request.method}!`)
}
Follow this deployment guide to learn how to use Prisma Client with your own Cloudflare Workers.
🔀 Support for ordering by relation fields in MongoDB
In 2.16.0
, we first introduced ordering by a relation for relational databases. As of today's release, you can now order by a relation field in MongoDB as well:
ts
// Return a list of posts ordered by the author's email address
// in ascending order.
await prisma.post.findMany({
orderBy: {
author: {
email: "asc",
},
},
})
5️⃣ MongoDB 5 is now supported
Prisma now supports connecting to MongoDB 5 databases. Take advantage of the latest and greatest from the fine folks at MongoDB HQ and share your feedback in the #mongodb channel here on Slack!
🦦 Prisma Client Go now supports scalar list operations
With 3.3.0
, you can now filter and atomically update scalar lists with Prisma Client Go.
Given the following Prisma schema:
model User {
id Int @id @default(autoincrement())
name String
pets String[]
}
You can filter pets with the following code:
user, err := client.User.FindFirst(
db.User.Pets.HasSome([]string{"Fido", "Scooby"}),
).Exec(ctx)
And when you add a new furry addition to your family, you can update your list with `Push`:
user, err := client.User.FindUnique(
db.User.Name.Equals(1),
).Update(
db.User.Items.Push([]string{"Charlemagne"}),
).Exec(ctx)
Learn more about how to use this new feature in our documentation and share your feedback in the #prisma-client-go channel here on Slack!
📚 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, my colleague @Daniel Norman and I will discuss the latest release and other news from the Prisma ecosystem in a on Thursday at 5pm Berlin | 8am San Francisco.