Skip to content

feat: add postgres support to switch between databases and schemas#173

Merged
datlechin merged 4 commits intodatlechin:mainfrom
json-nan:feat/postgres-databases-and-schemas-support
Mar 6, 2026
Merged

feat: add postgres support to switch between databases and schemas#173
datlechin merged 4 commits intodatlechin:mainfrom
json-nan:feat/postgres-databases-and-schemas-support

Conversation

@json-nan
Copy link
Contributor

@json-nan json-nan commented Mar 5, 2026

Summary

Adds support to change between databases and schemas using postgres engine

image image

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@datlechin
Copy link
Owner

@json-nan Hi, please resolve conflict

Signed-off-by: Jasson López <30847798+json-nan@users.noreply.github.com>
@json-nan
Copy link
Contributor Author

json-nan commented Mar 5, 2026

@datlechin check again please

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds PostgreSQL support for switching databases (via reconnect) and schemas (via search_path/driver schema switch) from the Cmd+K switcher, updating UI/state handling and documentation accordingly.

Changes:

  • Add a Postgres “Databases / Schemas” mode toggle to the database switcher and wire schema-selection callback.
  • Update Postgres switching behavior to reconnect the session when changing databases; add a dedicated switchSchema path.
  • Refresh docs, localization catalog entries, and changelog to reflect the new switching behavior.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
docs/vi/databases/postgresql.mdx Updates Vietnamese Postgres switching docs from schema-only to database switching.
docs/databases/postgresql.mdx Updates English Postgres switching docs; now describes database switching.
TablePro/Views/Toolbar/ConnectionStatusView.swift Simplifies help text to always show “Current database …” for Cmd+K switching.
TablePro/Views/MainContentView.swift Passes active database + schema into switcher and adds schema-selection callback.
TablePro/Views/Main/Extensions/MainContentCoordinator+URLFilter.swift Routes URL-driven “schema” selection to schema switch for Postgres, database switch otherwise.
TablePro/Views/Main/Extensions/MainContentCoordinator+Navigation.swift Implements Postgres DB switching via session reconnect; adds switchSchema(to:).
TablePro/Views/DatabaseSwitcher/DatabaseSwitcherSheet.swift Adds segmented toggle for Postgres and routes selection to DB vs schema callback.
TablePro/ViewModels/DatabaseSwitcherViewModel.swift Introduces Mode (database/schema) and adjusts fetching/preselection logic.
TablePro/Resources/Localizable.xcstrings Removes “Current schema …” strings and adds new switcher/alert strings.
TablePro/Models/ConnectionToolbarState.swift For Postgres, prefers showing session.currentDatabase instead of schema.
CHANGELOG.md Notes updated Postgres Cmd+K switcher behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@datlechin
Copy link
Owner

Hi @json-nan check the Copilot's reviews :d

@json-nan
Copy link
Contributor Author

json-nan commented Mar 5, 2026

@datlechin changes implemented, check again please

@datlechin datlechin merged commit fbbc5ec into datlechin:main Mar 6, 2026
1 check 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.

3 participants