Ejemplo n.º 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)))
Ejemplo n.º 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)))
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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