(self, sql)
return should_run
check to see if the guard SQL returns a single column containing 0 or 1
        We return true if 1, else False
check to see if the guard SQL returns a single column containing 0 or 1
        We return true if 1, else False
check to see if the guard SQL returns a single column containing 0 or 1 We return true if 1 else False
def proc_check_guard(self, sql):
        """
        check to see if the guard SQL returns a single column containing 0 or 1
        We return true if 1, else False
        """
        self.connection.open_db_connections(self.connection.PROC_GUARD_DB_KEY)
        cursor = self.connection.get_cursor(self.connection.PROC_GUARD_DB_KEY)

        should_run = False
        try:
            cursor.execute(sql, ())
            result = cursor.fetchone()
            should_run = result[0] == 1
        except Exception as e:
            self.log.error("Failed to run proc_only_if sql %s : %s", sql, e)

        self.connection.close_cursor(cursor)
        self.connection.close_db_connections(self.connection.PROC_GUARD_DB_KEY)
        return should_run
def proc_check_guard ( self , sql ) : self . connection . open_db_connections ( self . connection . PROC_GUARD_DB_KEY ) cursor = self . connection . get_cursor ( self . connection . PROC_GUARD_DB_KEY ) should_run = False try : cursor . execute ( sql , ( ) ) result = cursor . fetchone ( ) should_run = result [ 0 ] == 1 except Exception as e : self . log . error ( "Failed to run proc_only_if sql %s : %s" , sql , e ) self . connection . close_cursor ( cursor ) self . connection . close_db_connections ( self . connection . PROC_GUARD_DB_KEY ) return should_run