https://github.com/akiomik/scenic-cascade

A scenic migration file generator that supports cascading view updates

https://github.com/akiomik/scenic-cascade

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.9%) to scientific vocabulary

Keywords

dependency-graph materialized-view rails ruby-on-rails scenic view
Last synced: 5 months ago · JSON representation

Repository

A scenic migration file generator that supports cascading view updates

Basic Info
  • Host: GitHub
  • Owner: akiomik
  • License: apache-2.0
  • Language: Ruby
  • Default Branch: main
  • Homepage:
  • Size: 169 KB
Statistics
  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
dependency-graph materialized-view rails ruby-on-rails scenic view
Created over 3 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License Code of conduct

README.md

scenic-cascade

Gem Version Ruby codecov

scenic-cascade is a scenic migration file generator that supports cascading view updates.

Installation

Add this line to your application's Gemfile:

ruby gem 'scenic-cascade'

And then execute:

shell-session $ bundle install

Or install it yourself as:

shell-session $ gem install scenic-cascade

Usage

To generate migration files, use scenic:view:cascade generator instead of scenic:view. The following example generates migration files for search_results view.

shell-session $ bin/rails generate scenic:view:cascade search_results create db/views/search_results_v01.sql create db/migrate/20220714233704_create_search_results.rb

How it works

Consider a situation where the following three views exist:

  • first_results is a parent view (version 1)
  • second_results is a materialized view that depends on first_results (version 3)
  • third_results is a view that depends on first_results and second_results (version 2)

```sql -- first_results SELECT 'foo' AS bar;

-- secondresults SELECT * FROM firstresults;

-- thirdresults SELECT * FROM firstresults UNION SELECT * FROM second_results; ```

Executing the scenic:view:cascade generator for first_results in this state will generate the following migration file:

shell-session $ bin/rails generate scenic:view:cascade first_results create db/views/first_results_v02.sql create db/migrate/20220714233704_update_first_results_to_version_2.rb

Since all dependencies are described, you can execute bin/rails db:migrate without changing the migration file.

[!WARNING] Currently, index re-creation is not supported. Please change a migration file to recreate indexes if it contains drop_view for materialized views.

ruby class UpdateSearchResultsToVersion2 < ActiveRecord::Migration def change drop_view :third_results, revert_to_version: 2, materialized: false drop_view :second_results, revert_to_version: 3, materialized: true replace_view :first_results, version: 2, revert_to_version: 1 create_view :second_results, version: 3, materialized: true create_view :third_results, version: 2, materialized: false end end

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/akiomik/scenic-cascade. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Code of Conduct

Everyone interacting in the `scenic-cascade' project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Owner

  • Name: Akiomi KAMAKURA
  • Login: akiomik
  • Kind: user
  • Location: Japan

Bird lover.

GitHub Events

Total
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 3
  • Pull request event: 5
  • Create event: 2
Last Year
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 3
  • Pull request event: 5
  • Create event: 2

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 21
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 months
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.57
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 13
Past Year
  • Issues: 0
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: about 17 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 4
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (20)
  • akiomik (6)
Top Labels
Issue Labels
Pull Request Labels
dependencies (20) ruby (1)

Packages

  • Total packages: 1
  • Total downloads:
    • rubygems 491 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
rubygems.org: scenic-cascade

A migration scenic file generator that supports cascading view updates

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 491 Total
Rankings
Dependent packages count: 15.8%
Dependent repos count: 49.0%
Average: 54.7%
Downloads: 99.4%
Maintainers (1)
omi
Last synced: 6 months ago

Dependencies

Dockerfile docker
  • ruby 3.1-alpine build
docker-compose.yml docker
  • postgres 14-alpine
Gemfile rubygems
  • ammeter ~> 1.1
  • database_cleaner-active_record ~> 2.0
  • pg ~> 1.0
  • rake ~> 13.0
  • rspec ~> 3.0
  • rubocop ~> 1.21
  • rubocop-performance ~> 1.14
  • rubocop-rake ~> 0.6
  • rubocop-rspec ~> 2.12
  • steep >= 0
Gemfile.lock rubygems
  • actionpack 7.0.3.1
  • actionview 7.0.3.1
  • activemodel 7.0.3.1
  • activerecord 7.0.3.1
  • activesupport 7.0.3.1
  • ammeter 1.1.5
  • ast 2.4.2
  • builder 3.2.4
  • bundler 2.3.7
  • concurrent-ruby 1.1.10
  • crass 1.0.6
  • database_cleaner-active_record 2.0.1
  • database_cleaner-core 2.0.1
  • diff-lcs 1.5.0
  • erubi 1.10.0
  • ffi 1.15.5
  • i18n 1.12.0
  • json 2.6.2
  • language_server-protocol 3.16.0.3
  • listen 3.7.1
  • loofah 2.18.0
  • method_source 1.0.0
  • minitest 5.16.2
  • nokogiri 1.13.7
  • parallel 1.22.1
  • parser 3.1.2.0
  • pg 1.4.1
  • racc 1.6.0
  • rack 2.2.4
  • rack-test 2.0.2
  • rails-dom-testing 2.0.3
  • rails-html-sanitizer 1.4.3
  • railties 7.0.3.1
  • rainbow 3.1.1
  • rake 13.0.6
  • rb-fsevent 0.11.1
  • rb-inotify 0.10.1
  • rbs 2.6.0
  • regexp_parser 2.5.0
  • rexml 3.2.5
  • rspec 3.11.0
  • rspec-core 3.11.0
  • rspec-expectations 3.11.0
  • rspec-mocks 3.11.1
  • rspec-rails 5.1.2
  • rspec-support 3.11.0
  • rubocop 1.31.2
  • rubocop-ast 1.19.1
  • rubocop-performance 1.14.2
  • rubocop-rake 0.6.0
  • rubocop-rspec 2.12.1
  • ruby-progressbar 1.11.0
  • scenic 1.6.0
  • scenic-dependencies 0.1.0
  • steep 1.0.1
  • terminal-table 3.0.2
  • thor 1.2.1
  • tzinfo 2.0.4
  • unicode-display_width 2.2.0
  • zeitwerk 2.6.0
scenic-dependencies.gemspec rubygems
  • scenic ~> 1.0
.github/workflows/ci.yml actions
  • actions/checkout v4 composite
  • ruby/setup-ruby v1 composite
  • postgres 14-alpine docker