import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs";
DROP TABLE
Dropping a table deletes all of the data in the table as well as the table definition, thus we must exercise extreme caution while doing this operation. The DROP TABLE
statement is used to delete a table, and only the table's owner
has the authorization to perform this operation. Table deletion is supported in tables that utilize both the standard
engine and the full_text
engine.
Access Control
You must be the owner
of the table being operated on in order to do this operation.
SQL Example
DROP TABLE bookshop.book;
Using SDK
<Tabs defaultValue="Python" values={[ { label: "Python", value: "Python" }, { label: "JavaScript", value: "JavaScript" }, { label: "Golang", value: "Golang" }, ]}
Python SDK provides the drop_table()
method to delete tables.
db = client.db(mk)
db.drop_table('bookshop', 'book')
JavaScript SDK provides the dropTable()
method to delete tables.
const db = client.db(mk);
await db.dropTable('bookshop', 'book');
Golang SDK provides the DropTable()
method to delete tables.
resp, err := glitterClient.DropTable(ctx, "bookshop", "book")