You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(workspace): extract SqlWorkspaceToolbar and introduce BaseSqlExecutionDelegate #1363
lib/features/workspace/generic_sql_workspace.dart is 1,546 lines long and combines:
A complex 350+ line toolbar with 10+ controls (Execute, Explain, Cancel, session options, autocommit, timeouts).
Session lifecycle and tab management.
DML preview dialogs, destructive query guards, and staged save flows.
Across postgres_sql_workspace.dart, mysql_sql_workspace.dart, and sqlite_sql_workspace.dart, the SQL execution delegates repeat boilerplate logic:
injectSqlLimit and truncated row checks.
Autocommit check with automatic BEGIN transaction initiation.
Status message formatting (Showing first $cap row(s)... , Command completed., $n row(s).).
This redundancy complicates maintenance and conflicts with single-responsibility design (related to Epic #1151).
Proposed Solution
Extract the toolbar into lib/features/workspace/sql_workspace_toolbar.dart.
Introduce an abstract BaseSqlExecutionDelegate in lib/features/workspace/sql_execution_delegate.dart that centralizes limit injection, transaction handling, and status message resolution.
Have PostgreSQL, MySQL, and SQLite delegates extend BaseSqlExecutionDelegate and implement only driver-specific socket execution.
Acceptance Criteria
GenericSqlWorkspace delegates toolbar rendering to SqlWorkspaceToolbar.
Common execution boilerplate (limit injection, transaction state check, status line) is shared via BaseSqlExecutionDelegate.
All database workspace unit and widget tests pass.
Activity
ZhuchkaTriplesix commentedon Oct 11, 2026
Done in #1392 (merged into
dev).