(self)
return args
Get the params to pass to psycopg2.connect() based on passed-in vals
        from yaml settings file
Get the params to pass to psycopg2.connect() based on passed-in vals
        from yaml settings file
Get the params to pass to psycopg2 . connect () based on passed - in vals from yaml settings file
def _get_connect_kwargs(self):
        """
        Get the params to pass to psycopg2.connect() based on passed-in vals
        from yaml settings file
        """
        if self.database_url:
            return {'dsn': self.database_url}

        if self.host in ('localhost', '127.0.0.1') and self.password == '':
            # Use ident method
            return {'dsn': "user={} dbname={}".format(self.user, self.DB_NAME)}

        args = {
            'host': self.host,
            'user': self.user,
            'password': self.password,
            'database': self.DB_NAME,
        }
        if self.port:
            args['port'] = self.port

        return args
def _get_connect_kwargs ( self ) : if self . database_url : return { 'dsn' : self . database_url } if self . host in ( 'localhost' , '127.0.0.1' ) and self . password == '' : # Use ident method return { 'dsn' : "user={} dbname={}" . format ( self . user , self . DB_NAME ) } args = { 'host' : self . host , 'user' : self . user , 'password' : self . password , 'database' : self . DB_NAME , } if self . port : args [ 'port' ] = self . port return args