Skip to content

feat(linux-editor): switch a query tab's database on SQL Server, ClickHouse, Cassandra and MongoDB - #3898

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

datlechin merged 37 commits into
TableProApp:mainfrom
sedax90:feat/linux-editor-database-switch-more

Conversation

@sedax90

@sedax90 sedax90 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The editor bar's database menu moves a tab on SQL Server, ClickHouse, Cassandra, ScyllaDB and MongoDB, each by its own means behind EditorSession::use_database:
    • SQL Server: USE [name], a ] doubled, on the tab's own session.
    • ClickHouse: the database the session's requests name, once a request there answers.
    • Cassandra and ScyllaDB: the driver's use_keyspace, which refuses a name CQL cannot carry. A move that does not finish ends the session, since the driver records the keyspace before the server confirms it.
    • MongoDB: the shell's current database.
  • Each lists its databases: SQL Server the online ones the login may open, the others the schemas their catalog already lists.
  • On ClickHouse a USE in the editor now applies to the statements after it: every request names its database, which overrode the session's USE.

Test plan

  • Requires docker, run by CI: tablepro-driver-mssql a_session_moves_to_a_database_by_its_name and the_servers_databases_are_listed_for_a_query_tab; tablepro-driver-clickhouse a_session_runs_in_the_database_it_moved_to.
  • sql_syntax::catalog_change::tests::a_use_names_its_database, mssql dialect::tests::a_bracket_in_a_name_is_doubled.
  • verify.sh build, the driver unit tests, tablepro editor 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
… a name, and drop a MySQL session a USE lost
@datlechin
datlechin enabled auto-merge (squash) October 31, 2026 04:30
@datlechin
datlechin merged commit 56c39b6 into TableProApp:main Oct 31, 2026
50 of 53 checks passed
datlechin added a commit to sedax90/TablePro that referenced this pull request Oct 31, 2026
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