- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2
client.renameDatabase()
        Oxford Harrison edited this page Nov 9, 2024 
        ·
        5 revisions
      
    Programmatically perform a RENAME DATABASE operation.
client.renameDatabase(
    fromName: string,
    toName: string,
    options?: QueryOptions
): Promise<Savepoint | boolean>;| Param | Type | Description | 
|---|---|---|
| fromName | string | An existing database name. | 
| toName | string | The intended new database name. | 
| options | QueryOptions | Standard QueryOptions. | 
- 
Savepoint | boolean: a Savepoint instance (See ➞Savepoint) or the booleantruewhen savepoint creation has been disabled viaoptions.noCreateSavepoint; (Compare ➞ Query Return Value)
Rename a database:
const savepoint = await client.renameDatabase(
    'database_1',
    'database_1_new',
    { desc: 'Just testing database rename' }
);