Skip to content

feat: split materialized view from view#72

Merged
tianzhou merged 1 commit intomainfrom
materialized_view
Oct 12, 2025
Merged

feat: split materialized view from view#72
tianzhou merged 1 commit intomainfrom
materialized_view

Conversation

@tianzhou
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 12, 2025 10:53
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 splits materialized view handling from regular view handling, introducing distinct diff types for materialized views and their associated operations. The change provides better type safety and clearer differentiation between regular views and materialized views in migration plans and dump output.

  • Introduces new diff types for materialized views (DiffTypeMaterializedView, DiffTypeMaterializedViewComment, etc.)
  • Updates test data files to reflect the separation of materialized views from regular views in plan output
  • Modifies plan formatting to handle materialized views as a separate category with their own section

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testdata files Update expected plan output to show materialized views separately from regular views
internal/plan/rewrite.go Update parameter names and logic to handle materialized view indexes separately
internal/plan/plan.go Add materialized view types and implement separate tracking/formatting for materialized views
internal/dump/formatter.go Update directory structure and formatting to handle materialized views separately
internal/diff/view.go Refactor view creation/modification logic to use appropriate diff types based on materialization
internal/diff/index.go Remove deprecated function for view indexes
internal/diff/diff.go Add new diff types for materialized views and update string mappings

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

// Track materialized views that have sub-resource changes
materializedViewsWithSubResources := make(map[string]bool) // materialized_view_path -> true

// Track non-table/non-view operations
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

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

The comment should be updated to reflect that materialized views are now tracked separately: 'Track non-table/non-view/non-materialized-view operations'

Suggested change
// Track non-table/non-view operations
// Track non-table/non-view/non-materialized-view operations

Copilot uses AI. Check for mistakes.
summary.ByType["materialized views"] = stats
}

// Count non-table/non-view operations (each operation counted individually)
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

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

This comment should be updated to reflect that materialized views are now handled separately: 'Count non-table/non-view/non-materialized-view operations'

Suggested change
// Count non-table/non-view operations (each operation counted individually)
// Count non-table/non-view/non-materialized-view operations (each operation counted individually)

Copilot uses AI. Check for mistakes.
@tianzhou tianzhou merged commit 03cb023 into main Oct 12, 2025
2 checks passed
@tianzhou tianzhou deleted the materialized_view branch October 23, 2025 06:34
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.

1 participant