Skip to content

feat(connections): fetch server connections - #240

Merged
letstri merged 49 commits into
mainfrom
feat/server-databases
Mar 6, 2026
Merged

feat(connections): fetch server connections#240
letstri merged 49 commits into
mainfrom
feat/server-databases

Conversation

@Rudra-Sankha-Sinhamahapatra

@Rudra-Sankha-Sinhamahapatra Rudra-Sankha-Sinhamahapatra commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

Description of Changes

  • What was changed?
    added server databases fetching facility
  • Why was it changed?
    it will help to see other databses on main server
  • Any related issues or discussions?

Closes #237 (If applicable, delete this line if not)

Checklist

  • My changes are scoped and focused
  • I have tested the code locally

Notes to reviewer

  • Are there any specific things the reviewer should focus on?
Screen.Recording.2026-02-09.at.1.mp4

cc: @letstri @geekyharsh05

@railway-app

railway-app Bot commented Dec 19, 2025

Copy link
Copy Markdown

This PR was not deployed automatically as @Rudra-Sankha-Sinhamahapatra does not have access to the Railway project.

In order to get automatic PR deploys, please add @Rudra-Sankha-Sinhamahapatra to your workspace on Railway.

Comment thread apps/desktop/src/entities/database/hooks/use-server-databases.ts Outdated
Comment thread apps/desktop/src/entities/database/hooks/use-server-databases.ts Outdated
Comment thread apps/desktop/src/entities/database/utils/clone-connection.ts Outdated
Copilot AI review requested due to automatic review settings January 27, 2026 13:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the ability to fetch and display all databases from a database server, allowing users to view other databases on the same server and quickly create connections to them. This addresses issue #237 which requested the ability to fetch all databases from a server URL.

Changes:

  • Refactored databases-list.tsx by extracting ConnectionCard, LastOpenedConnections, and EmptyConnection into separate components
  • Added useServerDatabases hook to fetch databases from a server connection
  • Added cloneConnectionForDatabase utility to create new connections for different databases on the same server
  • Added SQL queries to list databases for Postgres, MySQL, MSSQL, and ClickHouse
  • Extended database schema type definitions to include system tables needed for listing databases

Reviewed changes

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

Show a summary per file
File Description
apps/desktop/src/routes/_protected/-components/connection-card.tsx New component extracted from databases-list.tsx with added expand/collapse functionality to show other databases on the same server
apps/desktop/src/routes/_protected/-components/last-opened-connections.tsx Extracted component for displaying recently opened connections
apps/desktop/src/routes/_protected/-components/empty-connection.tsx Extracted component for empty state display
apps/desktop/src/routes/_protected/-components/databases-list.tsx Refactored to use extracted components, now cleaner and more maintainable
apps/desktop/src/entities/connection/hooks/use-server-databases.ts New hook to fetch list of databases from a server connection
apps/desktop/src/entities/connection/hooks/index.ts Exports the new useServerDatabases hook
apps/desktop/src/entities/connection/utils/clone-connection.ts New utility function to clone a connection with a different database name
apps/desktop/src/entities/connection/utils/index.ts Exports the new clone-connection utility
apps/desktop/src/entities/connection/sql/list-databases.ts SQL queries to list databases for each supported database type
apps/desktop/src/entities/connection/dialects/postgres/schema/catalog.ts Added pg_database table type definition
apps/desktop/src/entities/connection/dialects/mysql/schema/information.ts Added SCHEMATA table type definition
apps/desktop/src/entities/connection/dialects/mssql/schema/sys.ts Added databases table type definition with comprehensive fields
apps/desktop/src/entities/connection/dialects/clickhouse/schema/system.ts Added databases table type definition

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

Comment thread apps/desktop/src/entities/connection/utils/clone-connection.ts Outdated
Comment thread apps/desktop/src/entities/connection/hooks/use-server-databases.ts Outdated
Comment thread apps/desktop/src/entities/connection/hooks/use-server-connections.ts Outdated
Comment thread apps/desktop/src/entities/connection/hooks/index.ts Outdated
Comment thread apps/desktop/src/routes/_protected/-components/connection-card.tsx Outdated
Comment thread apps/desktop/src/entities/connection/hooks/use-server-connections.ts Outdated
Comment thread apps/desktop/src/routes/_protected/-components/connection-card.tsx Outdated
Comment thread apps/desktop/src/routes/_protected/-components/connection-card.tsx Outdated
Comment thread apps/desktop/src/routes/_protected/-components/connection-card.tsx Outdated
Comment thread apps/desktop/src/routes/_protected/-components/connection-card.tsx Outdated
@Rudra-Sankha-Sinhamahapatra Rudra-Sankha-Sinhamahapatra changed the title feat: fetch server databases feat(connections): fetch server connections Jan 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 119 out of 150 changed files in this pull request and generated no new comments.


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

@letstri
letstri merged commit e333be8 into main Mar 6, 2026
2 checks passed
@letstri
letstri deleted the feat/server-databases branch March 6, 2026 13:32
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.

Add an ability to fetch all databases from server url

3 participants