method

new_client

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
new_client(conn_params) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 77
        def new_client(conn_params)
          PG.connect(conn_params)
        rescue ::PG::Error => error
          if conn_params && conn_params[:dbname] && error.message.include?(conn_params[:dbname])
            raise ActiveRecord::NoDatabaseError.db_error(conn_params[:dbname])
          elsif conn_params && conn_params[:user] && error.message.include?(conn_params[:user])
            raise ActiveRecord::DatabaseConnectionError.username_error(conn_params[:user])
          elsif conn_params && conn_params[:hostname] && error.message.include?(conn_params[:hostname])
            raise ActiveRecord::DatabaseConnectionError.hostname_error(conn_params[:hostname])
          else
            raise ActiveRecord::ConnectionNotEstablished, error.message
          end
        end
Register or log in to add new notes.