deleteDatabase - Delete a database
The deleteDatabase() method is used to delete a database.
This API can only be used when connected with SeekdbAdminClient. For more information about SeekdbAdminClient, see SeekdbAdminClient.
Prerequisites
-
You have installed seekdb-js. For more information, see Quick start.
-
You have installed the server mode of seekdb. For more information, see Deploy seekdb by using yum install.
-
You are connected to the database. For more information, see SeekdbAdminClient.
-
The user to which you are connected 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 this privilege, contact the administrator to grant it. For more information about how to directly grant privileges, see Directly grant privileges.
Request parameters
deleteDatabase(name: string, tenant?: string)
| 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 to be deleted belongs. | test_tenant |
Request example
import { SeekdbAdminClient } from "seekdb";
// Remote server mode - database management (seekdb Server)
const admin = new SeekdbAdminClient({
host: "127.0.0.1",
port: 2881,
user: "root",
password: ""
});
await admin.deleteDatabase("my_database");
Response parameters
None