-
-
Notifications
You must be signed in to change notification settings - Fork 1
database.renameTable()
Oxford Harrison edited this page Nov 15, 2024
·
5 revisions
DOCS • API • Database API
Programmatically perform a RENAME TABLE
operation.
See related ➞ ALTER TABLE
database.renameTable(
fromName: string,
toName: string,
options?: AlterTableOptions
): Promise<AlterTableResult>;
Param | Interfaces | Description |
---|---|---|
fromName |
- | An existing table name. |
toName |
- | The intended new table name. |
options? |
AlterTableOptions |
Optional extra parameters for the operation. |
Interface | Description |
---|---|
AlterTableResult |
The result type for an ALTER TABLE operation. |
Rename a table:
await database.renameTable(
'table_1',
'table_1_new',
{ desc: 'Alter description' }
);