Sha256: 1d8ffa31ef18ac9a9e17038741ac35c14dee37a7560146b038139f1333481714

Contents?: true

Size: 862 Bytes

Versions: 19

Compression:

Stored size: 862 Bytes

Contents

module RailsSqlViews
 module ConnectionAdapters
   module OciAdapter
     # Returns true as this adapter supports views.
     def supports_views?
       true
     end

     def base_tables(name = nil) #:nodoc:
       tables = []
       execute("SELECT TABLE_NAME FROM USER_TABLES", name).each { |row| tables << row[0]  }
       tables
     end
     alias nonview_tables base_tables

     def views(name = nil) #:nodoc:
       views = []
       execute("SELECT VIEW_NAME FROM USER_VIEWS", name).each { |row| views << row[0] }
       views
     end

     # Get the view select statement for the specified table.
     def view_select_statement(view, name=nil)
       row = execute("SELECT TEXT FROM USER_VIEWS WHERE VIEW_NAME = '#{view}'", name).each do |row|
         return row[0]
       end
       raise "No view called #{view} found"
     end


   end
 end
end

Version data entries

19 entries across 19 versions & 8 rubygems

Version Path
mereghost-rails_sql_views-0.8.6 lib/rails_sql_views/connection_adapters/oci_adapter.rb
robdimarco_rails_sql_views-0.9.0 lib/rails_sql_views/connection_adapters/oci_adapter.rb
qubole_rails_sql_views-0.10.0 lib/rails_sql_views/connection_adapters/oci_adapter.rb
mereghost-rails_sql_views-0.8.5 lib/rails_sql_views/connection_adapters/oci_adapter.rb
mereghost-rails_sql_views-0.8.3 lib/rails_sql_views/connection_adapters/oci_adapter.rb
mereghost-rails_sql_views-0.8.2 lib/rails_sql_views/connection_adapters/oci_adapter.rb
mereghost-rails_sql_views-0.8.1 lib/rails_sql_views/connection_adapters/oci_adapter.rb
lunks-rails_sql_views-0.9.2 lib/rails_sql_views/connection_adapters/oci_adapter.rb
ctreatma-rails_sql_views-0.9.1 lib/rails_sql_views/connection_adapters/oci_adapter.rb
ctreatma-rails_sql_views-0.9.0 lib/rails_sql_views/connection_adapters/oci_adapter.rb
molo-0.7.6 vendor/rails_sql_views/lib/rails_sql_views/connection_adapters/oci_adapter.rb
molo-0.7.5 vendor/rails_sql_views/lib/rails_sql_views/connection_adapters/oci_adapter.rb
molo-0.7.4 vendor/rails_sql_views/lib/rails_sql_views/connection_adapters/oci_adapter.rb
molo-0.7.3 vendor/rails_sql_views/lib/rails_sql_views/connection_adapters/oci_adapter.rb
molo-0.7.2 vendor/rails_sql_views/lib/rails_sql_views/connection_adapters/oci_adapter.rb
molo-0.7.1 vendor/rails_sql_views/lib/rails_sql_views/connection_adapters/oci_adapter.rb
molo-0.7.0 vendor/rails_sql_views/lib/rails_sql_views/connection_adapters/oci_adapter.rb
rails_sql_views-0.8.0 lib/rails_sql_views/connection_adapters/oci_adapter.rb
rubaidh-rails_sql_views-0.7.1 lib/rails_sql_views/connection_adapters/oci_adapter.rb