Skip to content

Show DDL in an editor, not one truncated grid cell #800

Closed

Description

@EVWorth

Severity: P2

What happens

  1. Open ?mock=connected and expand shop > Tables.
  2. Right-click customers and pick Show DDL. A new dirty "Untitled Query" tab opens containing SHOW CREATE TABLE \shop`.`customers`. The result grid has two columns, and the DDL sits in one ellipsized cell: CREATE TABLE `customers` ( `id` int unsigned NOT NU…`.
  3. Views (Show DDL) and procedures and functions (View DDL) behave the same way.
  4. Expand Triggers and single-click orders_before_update twice. Each click opens another identical "Untitled Query" tab, and the trigger body is split across grid columns. A single click on an event does the same.

Cause

src/components/schema/SchemaTree.tsx:242-246 (openDdlTab) runs SHOW CREATE … as a query. It is called at :629, :781, :855, :931, :986, :1000, :1058 and :1072. api.getViewDdl and api.getTriggerDdl already exist and are never called.

Fix

  • Open a read-only DDL view, one tab per object and reused on repeat, filled from getTableDdl, getViewDdl, getTriggerDdl and getRoutineDdl.
  • Give it Copy and "Open in editor".
  • Name the tab after the object.

Part of #783.

Activity

  1. added
    bug
    on Oct 21, 2026
  2. added a commit that references this issue on Oct 23, 2026
    c661c74
  3. added a commit that references this issue on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions