-
-
Notifications
You must be signed in to change notification settings - Fork 2
database.renameTable()
Oxford Harrison edited this page Nov 10, 2024
·
5 revisions
Programmatically perform a RENAME TABLE operation.
database.renameTable(
fromName: string,
toName: string,
options?: QueryOptions
): Promise<Savepoint | boolean>;| Param | Description |
|---|---|
fromName |
An existing table name. |
toName |
The intended new table name. |
options |
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 table:
const savepoint = await database.renameTable(
'table_1',
'table_1_new',
{ desc: 'Just testing table rename' }
);