<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def retrieve_all(self):
 """ A generator that iterates over each card in the library database. This is best used in for loops as it will only load a card from the library as needed rather then all at once. """

        with sqlite3.connect(self.dbname) as carddb:
            for row in carddb.execute("SELECT code FROM CARDS"):
                yield self.load_card(row[0])