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