Skip to content

client.renameDatabase()

Oxford Harrison edited this page Nov 15, 2024 · 5 revisions

DOCSAPIClient API


Programmatically perform a RENAME DATABASE operation.

See related ➞ ALTER DATABASE

Syntax

client.renameDatabase(
    fromName: string,
    toName: string,
    options?: AlterDatabaseOptions
): Promise<AlterDatabaseResult>;
Param Interfaces Description
fromName - An existing database name.
toName - The intended new database name.
options? AlterDatabaseOptions Optional extra parameters for the operation.
Interface Description
AlterDatabaseResult The result type for an ALTER DATABASE operation.

Usage

Rename a database:

await client.renameDatabase(
    'database_1',
    'database_1_new',
    { desc: 'Alter description' }
);
Clone this wiki locally