Class: ActiveRecord::ConnectionAdapters::SQLServerAdapter

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

Instance Method Summary collapse

Methods inherited from AbstractAdapter

#ordinary_table_exists?, #view_exists?

Instance Method Details

#tables(name = nil) ⇒ Object



16
17
18
# File 'lib/empty_eye/active_record/connection_adapters/sqlserver_adapter.rb', line 16

def tables(name = nil)
  tables_without_views(name) | views(name)
end

#tables_without_views(name = nil) ⇒ Object

Get all of the non-view tables from the currently connected schema



6
7
8
9
# File 'lib/empty_eye/active_record/connection_adapters/sqlserver_adapter.rb', line 6

def tables_without_views(name = nil)
  # this is untested
  select_values("SELECT table_name FROM information_schema.tables", name)
end

#views(name = nil) ⇒ Object

Returns all the view names from the currently connected schema.



12
13
14
# File 'lib/empty_eye/active_record/connection_adapters/sqlserver_adapter.rb', line 12

def views(name = nil)
  select_values("SELECT table_name FROM information_schema.views", name)
end