Example #1
0
 def delete(self, key, value):
     self.create_db_if_needed()
     with self.cursor() as cursor:
         cursor.execute("""
             delete from hypothesis_data_mapping
             where key = ? and value = ?
         """, (b64encode(key), b64encode(value)))
Example #2
0
 def delete(self, key, value):
     self.create_db_if_needed()
     with self.cursor() as cursor:
         cursor.execute("""
             delete from hypothesis_data_mapping
             where key = ? and value = ?
         """, (b64encode(key), b64encode(value)))
Example #3
0
 def save(self, key, value):
     self.create_db_if_needed()
     with self.cursor() as cursor:
         try:
             cursor.execute("""
                 insert into hypothesis_data_mapping(key, value)
                 values(?, ?)
             """, (b64encode(key), b64encode(value)))
         except sqlite3.IntegrityError:
             pass
Example #4
0
 def save(self, key, value):
     self.create_db_if_needed()
     with self.cursor() as cursor:
         try:
             cursor.execute("""
                 insert into hypothesis_data_mapping(key, value)
                 values(?, ?)
             """, (b64encode(key), b64encode(value)))
         except sqlite3.IntegrityError:
             pass
Example #5
0
 def fetch(self, key):
     self.create_db_if_needed()
     with self.cursor() as cursor:
         cursor.execute("""
             select value from hypothesis_data_mapping
             where key = ?
         """, (b64encode(key),))
         for (value,) in cursor:
             try:
                 yield b64decode(value)
             except (binascii.Error, TypeError):
                 pass
Example #6
0
 def fetch(self, key):
     self.create_db_if_needed()
     with self.cursor() as cursor:
         cursor.execute("""
             select value from hypothesis_data_mapping
             where key = ?
         """, (b64encode(key),))
         for (value,) in cursor:
             try:
                 yield b64decode(value)
             except (binascii.Error, TypeError):
                 pass