Class: ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter

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

Instance Method Summary collapse

Methods inherited from AbstractAdapter

#ordinary_table_exists?, #view_exists?

Instance Method Details

#tables_without_views(name = nil, database = nil, like = nil) ⇒ Object

:nodoc:



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

def tables_without_views(name = nil, database = nil, like = nil) #:nodoc:
  sql = "SHOW FULL TABLES WHERE table_type = 'BASE TABLE'"

  execute_and_free(sql, 'SCHEMA') do |result|
    result.collect { |field| field.first }
  end
end

#views(name = nil, database = nil, like = nil) ⇒ Object

:nodoc:



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

def views(name = nil, database = nil, like = nil) #:nodoc:
  sql = "SHOW FULL TABLES WHERE table_type = 'VIEW'"

  execute_and_free(sql, 'SCHEMA') do |result|
    result.collect { |field| field.first }
  end
end