-
Notifications
You must be signed in to change notification settings - Fork 34
feat: views support #512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: views support #512
Conversation
There was a problem hiding this 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
TableTypeandViewtypes, plus new API methodsshowViewDDL()andshowViews() - Views are now categorized using the
table_typefield 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.
depends on questdb/questdb#5720 disclosure: most of the code was generated by Claude Code
depends on questdb/questdb#5720
disclosure: most of the code was generated by Claude Code