DROP DATABASE
See original GitHub issueProblem
Sometimes the database just has to go, to be recreated from nothing. Would be nice if Prisma CLI would help me with that.
Suggested solution
prisma db drop
or similar. Probably with a lot of checks that you are dropping the correct one and really, really understand what you are doing.
(On the other hand, normal credentials should not be able to do this anyway, but who knows… better safe than sorry.)
Alternatives
- Use another tool
- Maybe
$executeRaw
?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
SQL DROP DATABASE Statement - W3Schools
The DROP DATABASE statement is used to drop an existing SQL database. Syntax. DROP DATABASE databasename;. Note: Be careful before dropping a database....
Read more >SQL - DROP or DELETE Database - Tutorialspoint
The SQL DROP DATABASE statement is used to drop an existing database in SQL schema. Syntax. The basic syntax of DROP DATABASE statement...
Read more >MySQL 8.0 Reference Manual :: 13.1.24 DROP DATABASE ...
DROP DATABASE drops all tables in the database and deletes the database. Be very careful with this statement! To use DROP DATABASE ,...
Read more >DROP DATABASE (Transact-SQL) - Microsoft Learn
Dropping a database deletes the database from an instance of SQL Server and deletes the physical disk files used by the database. If...
Read more >MySQL DROP DATABASE - How to Delete a Database in ...
DROP DATABASE using MySQL Workbench ... First, launch the MySQL workbench and log in to the MySQL Server. Second, right-click the database that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jagged3dge Why the first one doesn’t work is actually documented here: https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#using-variables
@Jolg42 Yes, sir. This is defnitely defined. This is part of a startup script for Jest testing-rig.
For completeness, here’s the script in itself:
For now, I’ve manually changed the
DATABASE_URL
in the project’s.env
file to match thedbURL
as in the above code. So, the shell command has access to the same DATABASE_URL value to push the prisma schema and run seeds.