new(...)
public
Initializes and connects a PostgreSQL adapter.
Show source
def initialize(...)
super
conn_params = @config.compact
conn_params[:user] = conn_params.delete(:username) if conn_params[:username]
conn_params[:dbname] = conn_params.delete(:database) if conn_params[:database]
valid_conn_param_keys = PG::Connection.conndefaults_hash.keys + [:requiressl]
conn_params.slice!(*valid_conn_param_keys)
@connection_parameters = conn_params
@max_identifier_length = nil
@type_map = nil
@raw_connection = nil
@notice_receiver_sql_warnings = []
@use_insert_returning = @config.key?(:insert_returning) ? self.class.type_cast_config_to_boolean(@config[:insert_returning]) : true
end