Sha256: 18b5fb63c16a34b3984cdf4dfb724137ec6dcbbb7a2e4dd850d5de1c40e1bd65

Contents?: true

Size: 1.06 KB

Versions: 265

Compression:

Stored size: 1.06 KB

Contents

module ActiveRecord
  module ConnectionAdapters
    class PostgreSQLAdapter < AbstractAdapter
      private
        def load_additional_types(type_map, oids = nil)
          initializer = OID::TypeMapInitializer.new(type_map)
          if supports_ranges?
            query = <<-SQL
              SELECT DISTINCT on (t.typname) t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
              FROM pg_type as t
              LEFT JOIN pg_range as r ON oid = rngtypid
            SQL
          else
            query = <<-SQL
              SELECT DISTINCT on (t.typname) t.oid, t.typname, t.typelem, t.typdelim, t.typinput, t.typtype, t.typbasetype
              FROM pg_type as t
            SQL
          end

          if oids
            query += "WHERE t.oid::integer IN (%s)" % oids.join(", ")
          else
            query += initializer.query_conditions_for_initial_load(type_map)
          end

          execute_and_clear(query, "SCHEMA", []) do |records|
            initializer.run(records)
          end
        end
    end
  end
end

Version data entries

265 entries across 265 versions & 2 rubygems

Version Path
zuora_connect-2.1.1 config/initializers/postgresql_adapter.rb
zuora_connect-2.0.60e config/initializers/postgresql_adapter.rb
zuora_connect-2.0.60d config/initializers/postgresql_adapter.rb
zuora_connect-2.0.60c config/initializers/postgresql_adapter.rb
zuora_connect-2.0.60b config/initializers/postgresql_adapter.rb
zuora_connect-2.0.60a config/initializers/postgresql_adapter.rb
zuora_connect-2.0.60 config/initializers/postgresql_adapter.rb
zuora_connect-2.0.59a config/initializers/postgresql_adapter.rb
zuora_connect-2.0.59 config/initializers/postgresql_adapter.rb
zuora_connect-2.0.58a config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57zc config/initializers/postgresql_adapter.rb
zuora_connect-2.0.58 config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57zb config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57za config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57z config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57y config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57x config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57w config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57v config/initializers/postgresql_adapter.rb
zuora_connect-2.0.57u config/initializers/postgresql_adapter.rb