Skip to content

feat(desktop): adds indexes and constraints page - #269

Merged
letstri merged 58 commits into
mainfrom
feat/index-page
Jan 26, 2026
Merged

feat(desktop): adds indexes and constraints page#269
letstri merged 58 commits into
mainfrom
feat/index-page

Conversation

@Rudra-Sankha-Sinhamahapatra

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

Copy link
Copy Markdown
Contributor

Description of Changes

Added index and constraints page

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

Checklist

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

Notes to reviewer

Screen.Recording.2025-12-27.at.6.1.mp4
  • Are there any specific things the reviewer should focus on?

cc: @letstri @geekyharsh05

@railway-app

railway-app Bot commented Dec 27, 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.

@geekyharsh05

Copy link
Copy Markdown
Contributor

@Rudra-Sankha-Sinhamahapatra Great addition.

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 two new database management pages for viewing indexes and constraints across different database systems (PostgreSQL, MySQL, MSSQL, and ClickHouse). The implementation includes sidebar navigation, SQL query generation for each database dialect, and filtering/search capabilities.

Key Changes:

  • New pages for browsing database indexes and constraints with schema filtering and search functionality
  • SQL query implementations supporting multiple database dialects with appropriate system table queries
  • Sidebar navigation updates with new icon-based links for quick access to indexes and constraints

Reviewed changes

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

Show a summary per file
File Description
apps/desktop/src/routes/(protected)/_protected/database/-components/database-sidebar.tsx Adds navigation links for indexes and constraints pages, applies consistent formatting to className attributes using template literals
apps/desktop/src/routes/(protected)/_protected/database/$id/indexes/index.tsx Implements indexes page with grouping, filtering, and search functionality
apps/desktop/src/routes/(protected)/_protected/database/$id/constraints/index.tsx Implements constraints page with filtering, search, and foreign key reference display
apps/desktop/src/routeTree.gen.ts Auto-generated route tree updates to register new pages
apps/desktop/src/entities/database/sql/indexes.ts SQL query implementations for fetching indexes from PostgreSQL, MySQL, MSSQL, and ClickHouse
apps/desktop/src/entities/database/queries/indexes.ts React Query hooks for indexes data fetching
apps/desktop/src/entities/database/index.ts Exports new indexes query functions
apps/desktop/src/entities/database/dialects/postgres/schema/indexes.ts PostgreSQL system table type definitions for index queries
apps/desktop/src/entities/database/dialects/postgres/schema/catalog.ts Refactors PgNamespace type to shared location
apps/desktop/src/entities/database/dialects/mysql/schema/indexes.ts MySQL information_schema.STATISTICS type definitions
apps/desktop/src/entities/database/dialects/mssql/schema/indexes.ts MSSQL sys.indexes and related system table type definitions
apps/desktop/src/entities/database/dialects/clickhouse/schema/system.ts Exports Columns interface for use in indexes queries

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

Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/indexes/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/constraints/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/indexes/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/constraints/index.tsx Outdated
Comment thread apps/desktop/src/routes/_protected/database/$id/definitions/indexes/index.tsx Outdated
Comment thread apps/desktop/src/routes/_protected/database/$id/definitions/constraints/index.tsx Outdated
@letstri

letstri commented Dec 28, 2025

Copy link
Copy Markdown
Member

@Rudra-Sankha-Sinhamahapatra please add some tabs or buttons, for example if I wanna see only primary keys

Comment thread apps/desktop/src/entities/database/sql/indexes.ts Outdated
Comment thread apps/desktop/src/entities/database/sql/indexes.ts Outdated
Comment thread apps/desktop/src/entities/database/dialects/mysql/schema/information.ts Outdated
Comment thread apps/desktop/src/entities/database/sql/indexes.ts Outdated
@Rudra-Sankha-Sinhamahapatra

Copy link
Copy Markdown
Contributor Author

Added filters & refresh button @letstri

Comment thread apps/desktop/src/entities/database/sql/indexes.ts Outdated
Comment thread apps/desktop/src/routes/_protected/database/$id/definitions/constraints/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/constraints/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/constraints/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/enums/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/indexes/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/indexes/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/indexes/index.tsx Outdated
Comment thread apps/desktop/src/routes/(protected)/_protected/database/$id/indexes/index.tsx Outdated
Comment thread apps/desktop/src/entities/database/dialects/clickhouse/schema/system.ts Outdated
Comment thread apps/desktop/src/entities/database/dialects/mssql/schema/sys.ts Outdated
Comment thread apps/desktop/src/entities/database/dialects/postgres/schema/catalog.ts Outdated
Comment thread apps/desktop/src/entities/database/sql/indexes.ts Outdated
Comment thread apps/desktop/src/entities/database/index.ts Outdated
Comment thread apps/desktop/src/routes/_protected/database/$id/constraint-index-tabs.tsx Outdated
Comment thread apps/desktop/src/routes/_protected/database/-components/database-sidebar.tsx Outdated
@Rudra-Sankha-Sinhamahapatra Rudra-Sankha-Sinhamahapatra changed the title feat: adds indexes and constraints page feat(desktop): adds indexes and constraints page Jan 23, 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 31 out of 32 changed files in this pull request and generated 3 comments.


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

Comment on lines +17 to +25
<button
type="button"
className="
absolute top-1/2 right-2 -translate-y-1/2 cursor-pointer p-1
"
onClick={onClear}
>
<RiCloseLine className="size-4 text-muted-foreground" />
</button>

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

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

The clear button is rendered as an icon-only <button> without an accessible label, so screen readers will not announce its purpose ("clear search") and keyboard users have no textual affordance. Consider adding an aria-label (and optionally title) to describe the action, or rendering visible text alongside the icon, to align this control with accessibility best practices.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +30
<ScrollArea className="h-full flex-1 rounded-lg border bg-background">
<ScrollViewport>
<div className="mx-auto flex max-w-3xl flex-col px-4 py-6">
<Outlet />
</div>
<ScrollBar />
</ScrollViewport>

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

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

ScrollBar is rendered inside ScrollViewport, which diverges from how the shared scroll-area component is used elsewhere (e.g. table/-components/tabs.tsx:342-372 renders ScrollViewport and ScrollBar as siblings under ScrollArea). Nesting the scrollbar inside the viewport can lead to incorrect layout or scrollbar behavior with the underlying @base-ui/react/scroll-area primitives; consider moving <ScrollBar /> to be a sibling of <ScrollViewport> within <ScrollArea> for consistency and correct structure.

Copilot uses AI. Check for mistakes.
Comment on lines 30 to 35
export const connectionStoreType = type({
lastOpenedPage: 'string | null' as type.cast<(Extract<keyof FileRoutesById, `/_protected/database/$id/${string}`> | null)>,
lastOpenedChatId: 'string | null',
lastOpenedDefinition: '"enums" | "constraints" | "indexes" | null',
definitionTabs: definitionTabType.array(),
lastOpenedTable: type({

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

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

lastOpenedDefinition and definitionTabs are added to the connection store type but are not read or updated anywhere else in the codebase yet, so they introduce persisted state that is currently unused. If these are intended for a future feature, consider either wiring them into the new definitions UI in this PR or deferring their addition to keep the store schema minimal.

Copilot uses AI. Check for mistakes.
@letstri
letstri merged commit 74347aa into main Jan 26, 2026
1 check passed
@letstri
letstri deleted the feat/index-page branch January 26, 2026 09:33
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 constraints page Add enums and indexes pages

4 participants