Class: ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter

Inherits:
AbstractAdapter
  • Object
show all
Defined in:
lib/empty_eye/active_record/connection_adapters/oracleenhanced_adapter.rb

Instance Method Summary collapse

Methods inherited from AbstractAdapter

#ordinary_table_exists?, #view_exists?

Instance Method Details

#tables(name = nil) ⇒ Object

:nodoc:



14
15
16
# File 'lib/empty_eye/active_record/connection_adapters/oracleenhanced_adapter.rb', line 14

def tables(name = nil) #:nodoc:
  tables_without_views(name) | views(name)
end

#tables_without_views(name = nil) ⇒ Object

:nodoc:



5
6
7
8
9
10
11
12
# File 'lib/empty_eye/active_record/connection_adapters/oracleenhanced_adapter.rb', line 5

def tables_without_views(name = nil) #:nodoc:
  tables = []
  cursor = execute("SELECT TABLE_NAME FROM USER_TABLES", name)
  while row = cursor.fetch
    tables << row[0]
  end
  tables
end

#views(name = nil) ⇒ Object

:nodoc:



18
19
20
21
22
23
24
25
# File 'lib/empty_eye/active_record/connection_adapters/oracleenhanced_adapter.rb', line 18

def views(name = nil) #:nodoc:
  views = []
  cursor = execute("SELECT VIEW_NAME FROM USER_VIEWS", name)
  while row = cursor.fetch
    views << row[0]
  end
  views
end