Module: RailsSqlViews::ConnectionAdapters::OracleAdapter
- Defined in:
- lib/rails_sql_views/connection_adapters/oracle_adapter.rb
Instance Method Summary collapse
-
#base_tables(name = nil) ⇒ Object
(also: #nonview_tables)
:nodoc:.
-
#supports_views? ⇒ Boolean
Returns true as this adapter supports views.
-
#view_select_statement(view, name = nil) ⇒ Object
Get the view select statement for the specified table.
-
#views(name = nil) ⇒ Object
:nodoc:.
Instance Method Details
#base_tables(name = nil) ⇒ Object Also known as: nonview_tables
:nodoc:
9 10 11 12 13 |
# File 'lib/rails_sql_views/connection_adapters/oracle_adapter.rb', line 9 def base_tables(name = nil) #:nodoc: tables = [] execute("SELECT TABLE_NAME FROM USER_TABLES", name).each { |row| tables << row[0] } tables end |
#supports_views? ⇒ Boolean
Returns true as this adapter supports views.
5 6 7 |
# File 'lib/rails_sql_views/connection_adapters/oracle_adapter.rb', line 5 def supports_views? true end |
#view_select_statement(view, name = nil) ⇒ Object
Get the view select statement for the specified table.
23 24 25 26 27 28 |
# File 'lib/rails_sql_views/connection_adapters/oracle_adapter.rb', line 23 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 |
#views(name = nil) ⇒ Object
:nodoc:
16 17 18 19 20 |
# File 'lib/rails_sql_views/connection_adapters/oracle_adapter.rb', line 16 def views(name = nil) #:nodoc: views = [] execute("SELECT VIEW_NAME FROM USER_VIEWS", name).each { |row| views << row[0] } views end |