Skip to content

refactor(architecture): elevate SqlExecutionDelegate to core/database and unify SQL connection contracts #1504

Open

Description

@ZhuchkaTriplesix

Problem

Currently, the contract for executing SQL queries, transactions, and mutations (SqlExecutionDelegate) is located in lib/features/workspace/sql_execution_delegate.dart instead of lib/core/database/.

Because architectural guard tests (test/guards/core_does_not_import_features_test.dart) prohibit core/ from importing features/:

  1. Core database drivers (PostgresConnection, MySqlConnection, SqliteConnectionPool) cannot implement the query execution delegate contract directly.
  2. The codebase must maintain duplicate adapter classes in feature folders (e.g. PostgresSqlExecutionDelegate, MySqlExecutionDelegate, SqliteSqlExecutionDelegate) that merely proxy calls between the workspace and the core connections.
  3. There is no unified SqlConnection or DatabaseConnection abstraction in core/database/.

Scope

  • Elevate or merge SqlExecutionDelegate into lib/core/database/ (alongside or unifying with SqlQueryRunner).
  • Define a unified SqlConnection contract in core/database/ that standardizes execution, transaction lifecycle (begin, commit, rollback), and table schema resolution.
  • Refactor GenericSqlWorkspace to consume the core execution contract directly, eliminating boilerplate adapter classes across features/postgresql/, features/mysql/, and features/sqlite/.

Acceptance

  • No database execution delegate contracts defined inside features/.
  • Core connection classes implement a unified execution contract directly.
  • Architectural guard core_does_not_import_features_test.dart passes without exceptions.

Activity

  1. added
    editorCode/SQL editor
    coreCore library logic and services
    backendBackend database driver execution and queries
    P2Medium priority / Parity & Refactoring
    on Oct 12, 2026
  2. added this to the 0.5.0 milestone on Oct 12, 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

    P2Medium priority / Parity & RefactoringbackendBackend database driver execution and queriescoreCore library logic and serviceseditorCode/SQL editor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions