delete_database - Delete a database
The delete_database() method is used to delete a database.
This method is only available when using the AdminClient. For more information about the AdminClient, see Admin Client.
Prerequisites
-
You have installed pyseekdb. For more information about how to install pyseekdb, see Quick Start.
-
You have connected to the database. For more information about how to connect to the database, see Admin Client.
-
If you are using server mode of seekdb or OceanBase Database, ensure that the user has the
DROPprivilege. For more information about how to view the privileges of the current user, see View User Privileges. If the user does not have the privilege, contact the administrator to grant the privilege. For more information about how to directly grant privileges, see Directly Grant Privileges.
Request parameters
delete_database(name,tenant=DEFAULT_TENANT)
| Parameter | Type | Required | Description | Example Value |
|---|---|---|---|---|
name | string | Yes | The name of the database to be deleted. | my_database |
tenant | string | No
| The tenant to which the database belongs. | test_tenant |
Request example
import pyseekdb
# Embedded mode
admin = pyseekdb.AdminClient(path="./seekdb")
# Delete database
admin.delete_database("my_database")
Response parameters
None