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/oracle.rb,
lib/arel/visitors/sqlite.rb,
lib/arel/visitors/to_sql.rb,
lib/arel/visitors/visitor.rb,
lib/arel/visitors/join_sql.rb,
lib/arel/visitors/where_sql.rb,
lib/arel/visitors/postgresql.rb,
lib/arel/visitors/depth_first.rb,
lib/arel/visitors/order_clauses.rb

Defined Under Namespace

Classes: DepthFirst, Dot, JoinSql, MSSQL, MySQL, Oracle, OrderClauses, PostgreSQL, 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,
}
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



33
34
35
# File 'lib/arel/visitors.rb', line 33

def self.visitor_for engine
  ENGINE_VISITORS[engine]
end