Skip to content
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

[feat]: Right Click on Table - Create Materialized View #546

Open
millerjp opened this issue Nov 3, 2024 · 0 comments
Open

[feat]: Right Click on Table - Create Materialized View #546

millerjp opened this issue Nov 3, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request right click schema schema management issues

Comments

@millerjp
Copy link
Contributor

millerjp commented Nov 3, 2024

Description

Add functionality to create a materialized view through a right-click context menu on tables, with a guided dialog for view definition and CQL execution.

User Flow

  1. User right-clicks on a table in the tree view
  2. Selects "Create Materialized View" from context menu
  3. Dialog opens with the following steps:
    • View name input
    • Column selection from parent table
    • Primary key definition
    • WHERE clause definition
    • CQL review and execution

Technical Requirements

View Name Validation

  • Must validate materialized view name:
    • Check for existing view names in keyspace
    • No spaces allowed
    • No special characters (quotes, etc.)
    • Show validation errors in real-time
    • Disable "Next" button until valid name entered

Column Selection UI

  • Display all columns from parent table in selectable format
  • Require at least one column selection
  • For selected columns:
    • Primary key selection (must include all parent table primary key columns)
    • Clustering key order selection
    • Display data types (read-only) next to column names
  • Clear indication of which columns are part of parent table's primary key

WHERE Clause Builder

  • Allow filtering conditions on non-primary key columns
  • Support basic comparison operators (=, >, <, >=, <=)
  • Visual builder for WHERE clause conditions
  • Validate that WHERE clause includes IS NOT NULL for all primary key columns

CQL Preview & Execution

  • Show generated CQL in editable text area
  • Include CONSISTENCY ALL; by default
  • Allow manual CQL editing
  • Add "Execute" button
  • Show execution results/errors

Error Handling

  • Display appropriate error messages for:
    • Invalid view names
    • Invalid primary key selections
    • Missing required primary key columns
    • Invalid WHERE clause conditions
    • CQL execution failures
    • Network/connection issues

UI/UX Considerations

  • Modal dialog with clear step progression
  • Responsive validation feedback
  • Visual distinction for required primary key columns
  • Intuitive column selection interface
  • Syntax highlighting in CQL preview

Acceptance Criteria

  • Right-click context menu implemented with "Create Materialized View" option
  • View name validation working correctly
  • Column selection UI with proper primary key handling
  • WHERE clause builder implemented
  • CQL preview with syntax highlighting
  • Execution functionality with proper error handling
  • All validation rules enforced
  • Proper error messages displayed
  • Consistent styling with existing UI
  • All parent table primary key columns automatically included
  • IS NOT NULL conditions automatically added for primary key columns

Technical Notes

  • Need to fetch parent table metadata for column information
  • Consider using existing validation utilities
  • Reuse existing CQL execution components
  • Maintain consistent error handling patterns
  • Ensure proper handling of compound primary keys

Related Issues

  • #544 (Similar dialog implementation reference)
@millerjp millerjp added enhancement New feature or request Needs Triage bugs which are not yet confirmed right click labels Nov 3, 2024
@millerjp millerjp added this to the v1.0.0-release milestone Nov 3, 2024
@millerjp millerjp added schema schema management issues and removed Needs Triage bugs which are not yet confirmed labels Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request right click schema schema management issues
Projects
None yet
Development

No branches or pull requests

2 participants