Sha256: 886f1912811ef9b04a4f351d90f0df45aa8f02bc5aec0f1adaecb09997870058

Contents?: true

Size: 1.34 KB

Versions: 127

Compression:

Stored size: 1.34 KB

Contents

require 'arel/visitors/visitor'
require 'arel/visitors/depth_first'
require 'arel/visitors/to_sql'
require 'arel/visitors/sqlite'
require 'arel/visitors/postgresql'
require 'arel/visitors/mysql'
require 'arel/visitors/mssql'
require 'arel/visitors/oracle'
require 'arel/visitors/join_sql'
require 'arel/visitors/where_sql'
require 'arel/visitors/order_clauses'
require 'arel/visitors/dot'
require 'arel/visitors/ibm_db'
require 'arel/visitors/informix'

module Arel
  module Visitors
    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

    def self.visitor_for engine
      ENGINE_VISITORS[engine]
    end
    class << self; alias :for :visitor_for; end
  end
end

Version data entries

127 entries across 109 versions & 15 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/arel-3.0.3/lib/arel/visitors.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/lib/arel/visitors.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/lib/arel/visitors.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/lib/arel/visitors.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/visitors.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/arel-3.0.2/lib/arel/visitors.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/lib/arel/visitors.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/arel-3.0.3/lib/arel/visitors.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/arel-3.0.3/lib/arel/visitors.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/lib/arel/visitors.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/lib/arel/visitors.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/lib/arel/visitors.rb
arel-5.0.1.20140414130214 lib/arel/visitors.rb
arel-4.0.2 lib/arel/visitors.rb
arel-5.0.0 lib/arel/visitors.rb
arel-3.0.3 lib/arel/visitors.rb
arel-4.0.1 lib/arel/visitors.rb
challah-1.0.0 vendor/bundle/gems/arel-4.0.0/lib/arel/visitors.rb
swipe-rails-0.0.5 vendor/bundle/gems/arel-3.0.2/lib/arel/visitors.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/visitors.rb