def _run_rethinkdb_action(self, action):

        # try to connect
        try:

            conn = r.connect(host=self.host, port=self.port, db=self.database, auth_key=self.auth_key)

        except Exception, e:

            log_to_postgres('Connection Falure:  %s' % e, ERROR)


        # Now try to run the action:
        try:

            log_to_postgres('RethinkDB Action:  %s' % action, DEBUG)
            result = action.run(conn)

        except Exception, e:

            conn.close()
            log_to_postgres('RethinkDB error:  %s' %e, ERROR)


        return result


    # SQL SELECT:
dataset/ETHPy150Open rotten/rethinkdb-multicorn-postgresql-fdw/rethinkdb_fdw/rethinkdb_fdw.py/RethinkDBFDW._run_rethinkdb_action/original