Skip to content

Add scanning materialised views and grants#40

Merged
realkarych merged 2 commits intomasterfrom
scan-matviews_and_grants
Jun 14, 2025
Merged

Add scanning materialised views and grants#40
realkarych merged 2 commits intomasterfrom
scan-matviews_and_grants

Conversation

@realkarych
Copy link
Copy Markdown
Owner

No description provided.

@realkarych realkarych self-assigned this Jun 14, 2025
@realkarych realkarych added the enhancement New feature or request label Jun 14, 2025
@realkarych realkarych requested a review from Copilot June 14, 2025 10:29
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 70 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/seqwall/staircase.go 0.00% 70 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

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 extends the schema snapshotter to include materialized views and table privilege grants.

  • Introduces new MatViews and Privileges fields in the snapshot model
  • Implements scanMatViews and scanPrivileges to populate those fields
  • Updates driver entity definitions to support the new types

Reviewed Changes

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

File Description
pkg/seqwall/staircase.go Added MatViews/Privileges fields, plus scanMatViews and scanPrivileges methods
pkg/driver/entities.go Defined MatViewDefinition and PrivilegeDefinition, and updated SchemaSnapshot
Comments suppressed due to low confidence (3)

pkg/seqwall/staircase.go:728

  • There are no tests covering the new scanMatViews and scanPrivileges functions. Please add unit or integration tests to verify that materialized views and privileges are being correctly retrieved and stored.
func (s *StaircaseWorker) scanMatViews(snapshot *driver.SchemaSnapshot) error {

pkg/driver/entities.go:95

  • [nitpick] Add a doc comment above MatViewDefinition (and similarly for PrivilegeDefinition) to explain what each type represents and how its fields are used.
type MatViewDefinition struct {

pkg/seqwall/staircase.go:202

  • [nitpick] Consider initializing Privileges to an empty slice in the SchemaSnapshot literal (e.g. Privileges: []driver.PrivilegeDefinition{},) so JSON marshalling always produces [] instead of null when no grants are found.
snap := &driver.SchemaSnapshot{

@realkarych realkarych merged commit 2f9a273 into master Jun 14, 2025
10 checks passed
@realkarych realkarych deleted the scan-matviews_and_grants branch June 14, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants