Skip to content

feat: add context menu for Structure tab#561

Merged
datlechin merged 5 commits intomainfrom
feat/structure-context-menu
Apr 3, 2026
Merged

feat: add context menu for Structure tab#561
datlechin merged 5 commits intomainfrom
feat/structure-context-menu

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Add dedicated context menu for the Structure tab, replacing the inherited Results-tab menu that showed irrelevant actions (Copy as INSERT, Export Results, Set Value)
  • New StructureRowViewWithMenu (NSTableRowView subclass) with schema-appropriate actions
  • Add rowViewProvider to DataGridView so callers can inject custom row views
  • Add generateColumnDefinitionSQL, generateIndexDefinitionSQL, generateForeignKeyDefinitionSQL to plugin protocol for SQL definition generation
  • Implement in MySQL and PostgreSQL plugins (other databases gracefully degrade)

Context menu per tab

Columns / Indexes:

  • Copy Name
  • Copy Definition (database-specific SQL syntax)
  • Duplicate / Delete

Foreign Keys:

  • Copy Name
  • Copy Definition (SQL syntax)
  • Open referenced table (navigates to FK target)
  • Duplicate / Delete

DDL / Parts: No context menu

Test plan

  • MySQL/PostgreSQL: Structure tab → Columns → right-click → verify menu shows Copy Name, Copy Definition, Duplicate, Delete
  • Copy Name → paste → verify column name copied
  • Copy Definition → paste → verify SQL syntax (e.g., name VARCHAR(255) NOT NULL DEFAULT '')
  • Indexes tab → right-click → Copy Definition → verify index SQL
  • Foreign Keys tab → right-click → "Open {table}" → navigates to referenced table
  • DDL tab → right-click → no context menu appears
  • Read-only view → right-click → Duplicate/Delete not shown, Copy Name/Definition still work
  • Deleted row → right-click → only "Undo Delete" shown
  • Multi-select rows → right-click → actions apply to all selected

@datlechin datlechin merged commit 1e64430 into main Apr 3, 2026
2 checks passed
@datlechin datlechin deleted the feat/structure-context-menu branch April 3, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant