-
-
Notifications
You must be signed in to change notification settings - Fork 2
database.renameTable()
Oxford Harrison edited this page Nov 9, 2024
·
5 revisions
Programmatically perform a RENAME TABLE
operation.
database.renameTable(
fromName: string,
toName: string,
options?: QueryOptions
): Promise<Savepoint | boolean>;
Param | Type | Description |
---|---|---|
fromName |
string |
An existing table name. |
toName |
string |
The intended new table name. |
options |
QueryOptions |
Standard QueryOptions . |
-
Savepoint | boolean
: a Savepoint instance (See ➞Savepoint
) or the booleantrue
when 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' }
);