Module: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID
- Defined in:
- lib/active_record/connection_adapters/postgresql/oid.rb
Defined Under Namespace
Classes: Array, Bit, Boolean, Bytea, Cidr, Date, Decimal, Float, Hstore, Identity, Integer, Json, Money, Point, Range, Time, Timestamp, Type, TypeMap, Vector
Constant Summary collapse
- TYPE_MAP =
:nodoc:
TypeMap.new
- NAMES =
When the PG adapter connects, the pg_type table is queried. The key of this hash maps to the ‘typname` column from the table. TYPE_MAP is then dynamically built with oids as the key and type objects as values.
Hash.new { |h,k| # :nodoc: h[k] = OID::Identity.new }
Class Method Summary collapse
-
.alias_type(new, old) ⇒ Object
Alias the
old
type to thenew
type. -
.register_type(name, type) ⇒ Object
Register an OID type named
name
with a typcasting object intype
. -
.registered_type?(name) ⇒ Boolean
Is
name
a registered type?.
Class Method Details
.alias_type(new, old) ⇒ Object
Alias the old
type to the new
type.
310 311 312 |
# File 'lib/active_record/connection_adapters/postgresql/oid.rb', line 310 def self.alias_type(new, old) NAMES[new] = NAMES[old] end |
.register_type(name, type) ⇒ Object
Register an OID type named name
with a typcasting object in type
. name
should correspond to the ‘typname` column in the `pg_type` table.
305 306 307 |
# File 'lib/active_record/connection_adapters/postgresql/oid.rb', line 305 def self.register_type(name, type) NAMES[name] = type end |