Drop
Drop a table
Dropping a table removes the table and all its data from the database.
For example, consider the following database:
Consider that you try to directly drop the User
node table without first dropping the associated
relationship tables.
This will raise the following exception:
You can first delete the Follows
rel table, and subsequently the User
table as follows:
Drop if exists
If the given table does not exist in the database, Kùzu throws an exception when you try to drop it.
To avoid the exception being raised, use the IF EXISTS
clause. This instructs Kùzu to do nothing when
the given table name does not exist in the database.
Example:
This query tells Kùzu to drop the UW
table only if it exists.