Module: Arel::Visitors

Defined in:
lib/arel/visitors.rb,
lib/arel/visitors/dot.rb,
lib/arel/visitors/mssql.rb,
lib/arel/visitors/mysql.rb,
lib/arel/visitors/ibm_db.rb,
lib/arel/visitors/oracle.rb,
lib/arel/visitors/reduce.rb,
lib/arel/visitors/sqlite.rb,
lib/arel/visitors/to_sql.rb,
lib/arel/visitors/visitor.rb,
lib/arel/visitors/informix.rb,
lib/arel/visitors/where_sql.rb,
lib/arel/visitors/postgresql.rb,
lib/arel/visitors/depth_first.rb,
lib/arel/visitors/bind_visitor.rb,
lib/arel/visitors/bind_substitute.rb

Defined Under Namespace

Modules: BindVisitor Classes: BindSubstitute, DepthFirst, Dot, IBM_DB, Informix, MSSQL, MySQL, Oracle, PostgreSQL, Reduce, SQLite, ToSql, Visitor, WhereSql

Constant Summary collapse

VISITORS =
{
  'postgresql'      => Arel::Visitors::PostgreSQL,
  'mysql'           => Arel::Visitors::MySQL,
  'mysql2'          => Arel::Visitors::MySQL,
  'mssql'           => Arel::Visitors::MSSQL,
  'sqlserver'       => Arel::Visitors::MSSQL,
  'oracle_enhanced' => Arel::Visitors::Oracle,
  'sqlite'          => Arel::Visitors::SQLite,
  'sqlite3'         => Arel::Visitors::SQLite,
  'ibm_db'          => Arel::Visitors::IBM_DB,
  'informix'        => Arel::Visitors::Informix,
}
ENGINE_VISITORS =
Hash.new do |hash, engine|
  pool         = engine.connection_pool
  adapter      = pool.spec.config[:adapter]
  hash[engine] = (VISITORS[adapter] || Visitors::ToSql).new(engine)
end

Class Method Summary collapse

Class Method Details

.visitor_for(engine) ⇒ Object Also known as: for



35
36
37
# File 'lib/arel/visitors.rb', line 35

def self.visitor_for engine
  ENGINE_VISITORS[engine]
end