https://github.com/akiomik/scenic-cascade
A scenic migration file generator that supports cascading view updates
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
Repository
A scenic migration file generator that supports cascading view updates
Basic Info
Statistics
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
scenic-cascade
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_resultsis a parent view (version 1)second_resultsis a materialized view that depends onfirst_results(version 3)third_resultsis a view that depends onfirst_resultsandsecond_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_viewfor 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
- Website: https://0m1.io
- Repositories: 226
- Profile: https://github.com/akiomik
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
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
- Homepage: https://github.com/akiomik/scenic-cascade
- Documentation: http://www.rubydoc.info/gems/scenic-cascade/
- License: Apache-2.0
-
Latest release: 0.1.0
published about 2 years ago
Rankings
Maintainers (1)
Dependencies
- ruby 3.1-alpine build
- postgres 14-alpine
- 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
- 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 ~> 1.0
- actions/checkout v4 composite
- ruby/setup-ruby v1 composite
- postgres 14-alpine docker