Skip to content

feat: show all databases in sidebar tree #139

@datlechin

Description

@datlechin

Summary

Add a "Show all databases" feature to the sidebar, displaying all databases on the server as a tree structure (similar to DBeaver).

Currently, the sidebar only shows tables for the connected database. Users (especially testers) need to access multiple databases at once to check permissions — if not authorized, it shows a permission error; if authorized, they can access and work with the data.

Motivation

From community feedback: testers need to quickly switch between databases to verify access permissions. The existing Cmd+K shortcut only opens schemas within the current database, not other databases on the server.

Proposed Approach

Replace the flat table list in the sidebar with a hierarchical database tree:

▼ my_app_db (current) users orders products ▸ analytics_db ▸ test_db ▸ staging_db 
  • The current database is auto-expanded showing its tables
  • Other databases show as collapsed nodes
  • Expanding a database lazy-loads its tables (via existing fetchDatabases() / switchDatabase() infrastructure)
  • Clicking a database switches the active context

Implementation Notes

  • All drivers already implement fetchDatabases() (SHOW DATABASES for MySQL, pg_database query for PostgreSQL, listDatabases() for MongoDB)
  • switchDatabase(to:) in MainContentCoordinator+Navigation.swift handles the context switch
  • PostgreSQL is special: should show schemas (switchable via SET search_path) rather than databases (which require full reconnection)
  • SQLite is file-based, so this feature would be a no-op for SQLite connections

Reference

DBeaver's "Show all databases" UI:

DBeaver reference

Metadata

Metadata

Assignees

No one assigned

    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