apps/blog/content/blog/orm-v6-11-0-embedded-prisma-studio-rust-free-orm-for-mysql-in-preview-and-more/index.mdx
Check out what’s new: Prisma ORM without Rust in Preview for MySQL, Neon & CockroachDB, embedded Prisma Studio for your React apps, new region for Prisma Postgres & more.
If you're using Prisma Postgres (yourself or by offering it to your own users), you can now embed Prisma Studio to offer an amazing data editing experience to your users!
Check out the demo site to see how Studio can be integrated in a React app with Vite and Hono on the server-side.
Here's a high-level overview for how you can integrate Prisma Studio in your own app (check the docs for details). First, install the @prisma/studio-core package via npm. Then, in your frontend, you can include the Studio component.
function App() { const adapter = useMemo(() => { // 1. Create a client that points to your backend endpoint const executor = createStudioBFFClient({ url: "http://localhost:4242/studio", });
// 2. Create a Postgres adapter with the executor
const adapter = createPostgresAdapter({ executor });
return adapter;
}, []);
return ( <Layout> <Studio adapter={adapter} /> </Layout> ); }
</Accordion>
</Accordions>
On the server-side, you need to expose a `/studio` endpoint that accepts the requests from the `Studio` component on frontend.
<Accordions type="single">
<Accordion title="Expand to view the backend code">
```ts
import { Hono } from "hono";
import { createPrismaPostgresHttpClient } from "@prisma/studio-core/data/ppg";
import { serializeError } from "@prisma/studio-core/data/bff";
const app = new Hono().use("*", cors());
app.post("/studio", async (c) => {
// 1. Extract the query and custom data from the request
const { query } = await c.req.json();
// 2. Read DB URL from env vars
const url = process.env.DATABASE_URL;
// 3. Execute the query against Prisma Postgres
const [error, results] = await createPrismaPostgresHttpClient({ url }).execute(query);
// 4. Return results or errors
if (error) {
return c.json([serializeError(error)]);
}
return c.json([null, results]);
});
Note that you can also pass extra headers and a custom payload for each request sent from the frontend, that way you can add an authentication layer or serve multi-tenant use cases where each of your users has access to their own database.
Try the demo and let us know what you think!
Prisma Postgres comes with a pricing model that seems too simple to be true: You're charged based on storage and operations—not CPU, compute hours or any other resource-based metrics.
While it's simple, it may feel unfamiliar because it's so different from existing pricing models. To understand how much you'd pay for Prisma Postgres running your app, you can now use our Pricing Calculator. Put in the predicted storage and number of operations to see how much you're going to be charged on each plan.
On vercel.com/templates, you can find lots of one-click-deploy application templates! We worked with the Vercel team to get Prisma Postgres working with all templates requiring a PostgreSQL database, for example:
eu-central-1)We keep expanding Prisma Postgres availability across the globe! After having added San Francisco just a few weeks ago, we're now adding Frankfurt based on another poll we ran on X. Here are all the regions where you can spin up Prisma Postgres instances today:
eu-central-1: Frankfurt (new!)eu-west-3: Parisus-west-1: San Franciscous-east-1: North Virginiaap-northeast-1: Tokyoap-southeast-1: SingaporeKeep an eye on our X account to take part in the poll and vote for the next availability zone of Prisma Postgres!
We just released Prisma ORM v6.11.0, so read on to learn about the newly added features!
In this release, we are excited to move the “Rust-free version of Prisma ORM” into Preview for our remaining first-class SQL databases: MySQL/MariaDB, Neon and CockroachDB.
If you want to try this, you can configure your generator like this:
generator client {
provider = "prisma-client-js" // or `prisma-client`
previewFeatures = ["queryCompiler", "driverAdapters"]
output = "../generated/prisma"
}
To use the Rust-free Prisma ORM version, you can use the following driver adapters:
@prisma/adapter-mariadb@prisma/adapter-neon (or @prisma/adapter-pg)@prisma/adapter-pgNote: The
mariadbdriver is compatible with all MySQL databases. It's the recommended option to use MySQL with Prisma ORM when using driver adapters.
Here's how to use it with MySQL. First, make sure to re-generate Prisma Client for the changes on your generator to take effect:
npx prisma generate
Then, install the required driver adapter:
npm install @prisma/adapter-mariadb
Once installed, you can instantiate PrismaClient as follows:
import { PrismaMariaDb } from '@prisma/adapter-mariadb';
import { PrismaClient } from './generated/prisma';
const adapter = new PrismaMariaDb({
host: "localhost",
port: 3306,
connectionLimit: 5
});
const prisma = new PrismaClient({ adapter });
No more hassle with query engines, binary targets and an even smoother experience in serverless and edge environments!
prisma-client generatorOur new prisma-client generator is more flexible, provides more control about the generated code, works with various JS runtimes and comes with ESM support out-of-the-box.
To make it easier for you to try it out, we created a few ready-to-run example projects so you can see the new generator in action:
nextjs-starter-webpacknextjs-starter-turbopackneextjs-starter-webpack-monoreponextjs-starter-webpack-with-middlewareYou can start a local Prisma Postgres instance using the prisma dev --name mydb command or via the Prisma VS Code extension UI.
If you start a local instance via the Prisma CLI, you can simply kill the process to stop the instance. However, when you start instances via the VS Code extension UI, you could also only stop them via the UI—not via the CLI.
This changes in this release: You can now also stop local Prisma Postgres instances and remove them from your file system via the Prisma CLI:
prisma dev stop <globs>: Stops one or more local Prisma Postgres instancesprisma dev rm <globs>: Removes one or more local Prisma Postgres instances from your file systemLearn more about these new commands in the docs.
We recently enabled the option to connect to Prisma Postgres with any tool via direct connections. In this release, we have reduced the connection latency so your first request is now even faster.
This week released a bunch of new features for Prisma ORM and Prisma Postgres! We're especially excited about letting you integrate Prisma Studio in your own React apps and are excited to see what you're going to build with it. We also released a new navigation UI for the Prisma Console, Rust-free Prisma ORM for MySQL/MariaDB in Preview and the ability to stop and remove local Prisma Postgres instances.
If you're using any of these features, we want to know what you think! Join the discussion on Discord, and ping us on X.