feat(connections): fetch server connections - #240
Conversation
|
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. |
…t/server-databases
…t/server-databases refactor: merge with main
…t/server-databases
…t/server-databases chore: merge with main
…t/server-databases refactor: merge with main
There was a problem hiding this comment.
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.tsxby extractingConnectionCard,LastOpenedConnections, andEmptyConnectioninto separate components - Added
useServerDatabaseshook to fetch databases from a server connection - Added
cloneConnectionForDatabaseutility 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.
…ce/conar into feat/server-databases
…t/server-databases
…t/server-databases
…t/server-databases
…t/server-databases
…t/server-databases
…t/server-databases
There was a problem hiding this comment.
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.
Description of Changes
added server databases fetching facility
it will help to see other databses on main server
Closes #237 (If applicable, delete this line if not)
Checklist
Notes to reviewer
Screen.Recording.2026-02-09.at.1.mp4
cc: @letstri @geekyharsh05