Materialize Documentation
s
Join the Community github/materialize

DROP DATABASE

DROP DATABASE removes a database from your Materialize instances.

WARNING! DROP DATABASE immediately removes all objects within the database without confirmation. Use with care!

Syntax

DROP DATABASE IF EXISTS database_name CASCADE RESTRICT
Field Use
IF EXISTS Do not return an error if the specified database does not exist.
database_name The database you want to drop. For available databases, see SHOW DATABASES.
CASCADE Remove the database and its dependent objects. (Default)
RESTRICT Do not remove this database if it contains any schemas.

Example

Remove a database containing schemas

You can use either of the following commands:

Remove a database only if it contains no schemas

DROP DATABASE my_db RESTRICT;

Do not issue an error if attempting to remove a nonexistent database

DROP DATABASE IF EXISTS my_db;