studio
studio copied to clipboard
Provide easy way to reset all data in database
Here's an initial design proposal. It's not clear to me yet where the best location for this feature would be but this should get the ball rolling and unblock users. As part of #265 we should rethink this further.

Important: When clicking the button, the user should be prompted with a confirmation pop up.
@madebysid can you implement the functionality for this yourself or does this depend on some (missing) SDK functionality?
It is possible, I'll run a deleteMany on all models.
Please make sure that the need to put this somewhere more safe and hidden is tracked. Super scary, even if it needs 5 confirmations.
Personally, I'd prefer if we handle this in the CLI today with a workflow like prisma truncate <models...>
Then when we go for it, we have the following UI:

Something to improve Soren's workflow is exporting the models from @prisma/client:
import { PrismaClient, models } from "@prisma/client"
const prisma = new PrismaClient()
for (let model of models) {
await prisma[model].deleteMany()
}
I also think with Migrate will cover this use case better.
I'd very much prefer to leave this until post-Beta given that we have so many other fish to fry related to the databrowser.
This still open!!! We need a clearAllTables method.
Hey :wave:
Prisma ORM 7 introduces a brand new standalone Studio, built from the ground up to work everywhere, with or without Prisma ORM. Consequently, all "old Studio" issues are being closed as there won't be any further work on it. :mega:
The new Studio is also available in the Prisma VS Code extension and in the Prisma Console application. :electric_plug:
Help shape, improve and fix the new Studio with us in this repository by submitting bug reports and feature requests. :construction_worker: