Skip to content

feat(connections): edit existing connection (host, auth, SSL, …) #510

Description

@ZhuchkaTriplesix

Problem

Once a connection is saved, the sidebar context menu only offers Refresh (databases / tree) and Remove connection. There is no Edit / Properties path to change host, port, user, password, database, SSL, display name, or URL-derived fields.

Workaround today: delete the connection and create it again — loses tree expand state, recent usage, and is error-prone for password/SSL tweaks.

Current state

  • Create flows exist: New Connection dialog, URL dialog, SQLite form (connection_creation_flow.dart, new_connection_*.dart, sqlite_connection_form.dart).
  • Storage already supports updates: LocalDb.updateConnection (+ secure-store secret sync, covered by tests).
  • UI never calls updateConnection for an existing row — connection tiles only wire onRemove / refresh.

Proposal

  1. Add Edit connection… to the connection context menu (all drivers + extension tiles + plain _ConnectionTile).
  2. Open a pre-filled edit dialog (reuse create forms where practical; keep type read-only or disallow driver change in v1).
  3. On save: LocalDb.updateConnection, refresh sidebar label/metadata, reconnect or invalidate the live pool if the connection is active.
  4. Optional later: “Duplicate connection…”, edit-from-URL paste.

Files (starting points)

  • lib/features/connections/connections_panel_*.dart (context menus)
  • lib/features/connections/connection_creation_flow.dart / form dialogs
  • lib/core/storage/local_db.dart (updateConnection — already present)
  • lib/core/storage/connection_secrets_store.dart

Acceptance

  • Context menu: Edit connection… on saved connections
  • Dialog opens with current values (secrets: show empty / “unchanged” pattern — don’t leak stored password into UI unless user replaces it)
  • Save persists via updateConnection and updates the sidebar without requiring delete+recreate
  • Active connection: safe reconnect or clear stale session after credential/host change
  • Cancel leaves connection unchanged
  • Works for built-in drivers (PG/MySQL/Redis/Mongo/SQLite) and extension driver connections where a form exists

Out of scope (v1)

  • Changing connection type/driver in place
  • Bulk edit

Metadata

Metadata

Labels

connectionsDatabase connections, URI parsing, poolsenhancementNew feature or requestuiUser interface components and widgets

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions