Skip to content

Implement export/import of view definitions as JSON/YAML #34

@niteshpurohit

Description

@niteshpurohit

Feature Request

Description:

Add functionality to export all materialized view definitions to a JSON or YAML file, and to import them from such a file.

Use Case:

This is useful for backing up definitions, migrating them between environments (e.g., staging to production), and keeping them in version control.

Proposed Solution:

  • Create two new rake tasks: mat_views:export[format] and mat_views:import[file_path].
  • The export task will serialize all MatViewDefinition records.
  • The import task will read the file, and then create or update definitions in the database.

RSpec Tests:

  • Create several view definitions.
  • Run mat_views:export and verify the output file is created and has the correct content.
  • Delete the definitions from the database.
  • Run mat_views:import with the exported file.
  • Verify that all definitions are restored correctly in the database.

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