cdinger / scenic-oracle_adapter Goto Github PK
View Code? Open in Web Editor NEWAn Oracle adapter for Thoughtbot's scenic gem
License: MIT License
An Oracle adapter for Thoughtbot's scenic gem
License: MIT License
when you download https://rubygems.org/downloads/scenic-oracle_adapter-1.2.1.gem the data.tar.gz within the gemfile is far too small.
who can fix this?
thanks in advance!
@cdinger I was looking to include this gem in one of my projects, but it requires the OCI8 gem. We use JRuby w/ our application so we cannot use OCI8.
Is it possible to have that dependency removed?
On some Oracle databases the following query:
create view "entries" as SELECT 'posting' as type,
FROM postings
UNION ALL
SELECT 'reservation' as type,
FROM reservations
returns the error in subject.
Should this work as a migration?
update_view :my_mview,
version: 2,
revert_to_version: 1,
materialized: true
When we tried it we got errors from Oracle about a syntax problem. But switching to a drop_view
followed by create_view
worked fine.
When a materialized view is updated to a new version any existing indexes are lost due to the drop/create cycle. We should look at caching the indexes and re-applying them like the postgres adapter does.
Oracle will fail to build a view/mview if the sql
file contains a trailing ;
.
Usually we write our queries in a SQL client that requires the ;
. Then we copy the query over to Scenic only to have the deploy fail.
Should we update the gem to strip any trailing ;
when reading the sql file?
Migrations that update materialized views via update_view
are failing because the no_data
keyword argument is not being passed to scenic:
rails db:migrate --trace
Warning: NLS_LANG is not set. fallback to US7ASCII.
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
== 20230419145611 UpdateMatvwInvoiceableEntriesToVersion3: migrating ==========
-- update_view(:matvw_invoiceable_entries, {:version=>3, :revert_to_version=>2, :materialized=>true})
rails aborted!
StandardError: An error has occurred, all later migrations canceled:
wrong number of arguments (given 3, expected 2)
/usr/local/bundle/gems/scenic-oracle_adapter-1.2.0/lib/scenic/adapters/oracle.rb:39:in `update_materialized_view'
/usr/local/bundle/gems/scenic-1.7.0/lib/scenic/statements.rb:109:in `update_view'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:932:in `block in method_missing'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:900:in `block in say_with_time'
/usr/local/lib/ruby/3.1.0/benchmark.rb:296:in `measure'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:900:in `say_with_time'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:921:in `method_missing'
/app/db/migrate/20230419145611_update_matvw_invoiceable_entries_to_version_3.rb:4:in `change'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:870:in `exec_migration'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:854:in `block (2 levels) in migrate'
/usr/local/lib/ruby/3.1.0/benchmark.rb:296:in `measure'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:853:in `block in migrate'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:852:in `migrate'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1046:in `migrate'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1360:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1413:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1359:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1333:in `each'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1333:in `migrate_without_lock'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1284:in `migrate'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1117:in `up'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/migration.rb:1092:in `migrate'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/usr/local/bundle/gems/activerecord-7.0.4/lib/active_record/railties/databases.rake:92:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/usr/local/bundle/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/bundle/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/usr/local/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
/usr/local/bundle/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/usr/local/bundle/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'
/usr/local/bundle/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.