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

Instance Method Details

#tables(name = nil) ⇒ Object

:nodoc:



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

def tables(name = nil) #:nodoc:
  tables = tables_without_views(name)
  views = views(name)
  tables | views
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:



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

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