Skip to content

Rename a table and rename a database #2482

Description

@datlechin

Problem

TablePro can rename a column but not a table or a database. There is no Rename item on the sidebar row and no field for it in the structure editor, so a rename means writing the statement by hand and refreshing.

Proposed solution

  • Rename on the table's right-click menu and on a slow double-click of the row label, staged like a drop or a truncate so Preview SQL and Save Changes cover it.
  • Per engine: ALTER TABLE ... RENAME TO on PostgreSQL, SQLite and Oracle, RENAME TABLE on MySQL and MariaDB, sp_rename on SQL Server.
  • Rename database where the engine has it. Where it does not, say so in the disabled item rather than offering something that cannot work.
  • Open tabs pointing at the renamed object follow the new name instead of going stale.

Alternatives considered

Run the statement in a query tab and refresh the sidebar.

Related database type

MySQL / MariaDB

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions