Skip to content

feat(linux-editor): move a PostgreSQL query tab to another database by opening its session there - #3899

Merged
datlechin merged 55 commits into
TableProApp:mainfrom
sedax90:feat/linux-editor-database-switch-reconnect
Oct 31, 2026
Merged

datlechin merged 55 commits into
TableProApp:mainfrom
sedax90:feat/linux-editor-database-switch-reconnect

Conversation

@sedax90

@sedax90 sedax90 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Follows #3898.

Summary

  • The editor bar's database menu moves a PostgreSQL tab. A PostgreSQL connection stays in the database it opened in, so its driver refuses use_database, and the tab gets an editor session opened in the other database (EditorSessionOptions::database) over its connection's transport and login.
  • The old session closes first, except one holding a transaction, which stays with the tab in its database and the run says why.
  • A restored tab, or one whose connection was lost, opens its session in its database directly.
  • PostgreSQL lists the databases the login may connect to; template1 and postgres are the server's own.

Test plan

  • ui::editor::editor_session_slot::tests::a_session_that_cannot_move_gives_way_unless_it_holds_a_transaction.
  • Requires docker, run by CI: tablepro-driver-postgres a_session_opened_in_another_database_runs_there.
  • verify.sh build, tablepro editor tests, the PostgreSQL unit tests, lint.

…or-database-switch

# Conflicts:
#	linux/crates/app/src/ui/editor/tab_scope.rs
#	linux/data/resources/ui/sql-editor.ui
…or-database-switch-more

# Conflicts:
#	linux/crates/app/src/ui/editor/editor_session_slot.rs
#	linux/crates/core/src/dialect/sql_dialect.rs
#	linux/crates/drivers/mongodb/src/dialect.rs
…-editor-database-switch-reconnect

# Conflicts:
#	linux/crates/app/src/ui/editor/editor_session_slot.rs
#	linux/crates/core/src/dialect/sql_dialect.rs
#	linux/crates/drivers/mongodb/src/dialect.rs
#	linux/crates/drivers/postgres/src/dialect.rs
… a name, and drop a MySQL session a USE lost
…wn database, and offer one when none is open
@datlechin
datlechin enabled auto-merge (squash) October 31, 2026 07:09
@datlechin
datlechin merged commit b937c1f into TableProApp:main Oct 31, 2026
37 of 38 checks passed
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.

2 participants