-
-
Notifications
You must be signed in to change notification settings - Fork 2
database.renameTable()
Oxford Harrison edited this page Nov 11, 2024
·
5 revisions
DOCS • API • Database API
Programmatically perform a RENAME TABLE
operation.
See ➞ ALTER TABLE
database.renameTable(
fromName: string,
toName: string,
options?: QueryOptions
): Promise<DDLResult>;
Param | Interfaces | Description |
---|---|---|
fromName |
- | An existing table name. |
toName |
- | The intended new table name. |
options |
QueryOptions |
Optional extra parameters for the query. |
Interface | Description |
---|---|
DDLResult | The result type for DDL operations. |
Rename a table:
const savepoint = await database.renameTable(
'table_1',
'table_1_new',
{ desc: 'Just testing table rename' }
);