<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def execute(self, query):
 """ Execute a query directly on the database. """

        c = self.conn.cursor()
        result = c.execute(query)
        for i in result:
            yield i