connect()
private
Connects to a PostgreSQL server and sets up the adapter depending on the
connected server’s characteristics.
Show source
def connect
@connection = PGconn.connect(*@connection_parameters)
PGconn.translate_results = false if PGconn.respond_to?(:translate_results=)
@async = @config[:allow_concurrency] && @connection.respond_to?(:async_exec)
money_precision = (postgresql_version >= 80300) ? 19 : 10
PostgreSQLColumn.module_eval("def extract_precision(sql_type) # def extract_precision(sql_type)\nif sql_type =~ /^money$/ # if sql_type =~ /^money$/\n\#{money_precision} # 19\nelse # else\nsuper # super\nend # end\nend # end\n")
configure_connection
end