Skip to content

Conversation

@jerrinot
Copy link
Contributor

depends on questdb/questdb#5720

disclosure: most of the code was generated by Claude Code

Copy link
Contributor

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

This PR adds support for views in the QuestDB web console schema explorer. The implementation introduces a new table_type field to differentiate between regular tables ('T'), materialized views ('M'), and views ('V'), providing backward compatibility with older servers that don't return this field.

Key Changes

  • Added TableType and View types, plus new API methods showViewDDL() and showViews()
  • Views are now categorized using the table_type field from the tables API instead of relying on separate state to distinguish materialized views from regular tables
  • Views display with a dedicated eye icon and exclude storage details (which are only relevant for physical tables)

Reviewed changes

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

Show a summary per file
File Description
src/utils/questdb/types.ts Added TableType and View type definitions, added optional table_type field to Table type for backward compatibility
src/utils/questdb/client.ts Added showViewDDL() and showViews() API methods
src/scenes/Schema/table-icon.tsx Added ViewIcon component and rendering logic with tooltip
src/scenes/Schema/localStorageUtils.ts Added VIEWS_GROUP_KEY constant for localStorage
src/scenes/Schema/index.tsx Integrated views fetching, DDL export support, and categorization logic based on table_type
src/scenes/Schema/VirtualTables/utils.ts Updated createTableNode() to handle views, conditionally hide storage details for views
src/scenes/Schema/VirtualTables/index.tsx Added views tree section, filtering logic, and context menu support
src/scenes/Schema/Row/index.tsx Updated TreeNodeKind type and rendering logic to include "view"
Comments suppressed due to low confidence (1)

src/scenes/Schema/VirtualTables/utils.ts:167

  • Views are being passed table properties (partitionBy, walEnabled, designatedTimestamp) from the Table object, but regular views typically don't have these physical storage properties since they're virtual. These properties should either be undefined/null for views or the Table type returned by the server for views should handle this. Verify that the backend API returns appropriate values for these fields when table_type is 'V'.
    partitionBy: table.partitionBy,
    walEnabled: table.walEnabled,
    designatedTimestamp: table.designatedTimestamp,

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

@jerrinot jerrinot requested a review from emrberk December 22, 2025 17:11
jerrinot and others added 2 commits December 26, 2025 18:10
depends on questdb/questdb#5720

disclosure: most of the code was generated by Claude Code
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