class PG::BasicTypeMapForResults


to cast #get_copy_data fields. See also PG::BasicTypeMapBasedOnResult .
a result independent PG::TypeMapByColumn type map, which can subsequently be used
PG::TypeMapByOid#fit_to_result(result, false) can be used to generate
res.values # => [[5]]
# is done by PG::TextDecoder::Integer internally for all value retrieval methods.
# Retrieve and cast the result value. Value format is 0 (text) and OID is 20. Therefore typecasting
res = conn.exec_params( “SELECT $1::INT”, [‘5’] )
# Execute a query.
conn.type_mapping = PG::BasicTypeMapping.new(conn)
# Assign a default ruleset for type casts of input and output values.
conn = PG::Connection.new
Example:
own set of rules to choose suitable encoders and decoders.
Higher level libraries will most likely not make use of this class, but use their
Result values are type casted based on the type OID of the given result column.
PostgreSQL’s pg_type table in PG::BasicTypeMapForResults.new .
OIDs of supported type casts are not hard-coded in the sources, but are retrieved from the
Simple set of rules for type casting common PostgreSQL types to Ruby.

def initialize(connection)

def initialize(connection)
	@coder_maps = build_coder_maps(connection)
	# Populate TypeMapByOid hash with decoders
	@coder_maps.map{|f| f[:decoder].coders }.flatten.each do |coder|
		add_coder(coder)
	end
end