Skip to content

Add plugin API for custom refresh strategies #32

@niteshpurohit

Description

@niteshpurohit

Feature Request

Description:

Create a plugin API that allows developers to define their own custom refresh strategies beyond the default REFRESH MATERIALIZED VIEW command.

Use Case:

This would enable support for other database systems (e.g., Redshift, BigQuery) or custom refresh logic (e.g., incremental updates via INSERT/DELETE) by allowing users to extend the gem's functionality.

Proposed Solution:

  • Define a base strategy class with a simple interface (e.g., a refresh method).
  • Allow a MatViewDefinition to specify a custom strategy class.
  • MatViewRefreshJob would then instantiate and call the specified strategy class instead of its default logic.

RSpec Tests:

  • Create a dummy custom refresh strategy class in the test suite.
  • Configure a view definition to use this custom strategy.
  • Trigger a refresh and verify that the custom strategy's refresh method was called, not the default one.

Checklist:

  • I have searched for a similar feature request and didn't find any duplicates.
  • I have included all the required information.
  • I have tagged the issue with the label "enhancement".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions