Lines Matching refs:cursor
117 def insert_table(cursor, table, data, on_conflict): argument
131 prevrowid = cursor.lastrowid
132 cursor.execute(query, data)
139 return (cursor.lastrowid, cursor.lastrowid != prevrowid)
141 def insert_unihash(cursor, data, on_conflict): argument
142 return insert_table(cursor, "unihashes_v2", data, on_conflict)
144 def insert_outhash(cursor, data, on_conflict): argument
145 return insert_table(cursor, "outhashes_v2", data, on_conflict)
150 with closing(db.cursor()) as cursor:
152 cursor,
161 def __init__(self, db, cursor, upstream): argument
163 self.cursor = cursor
224 with closing(self.db.cursor()) as cursor:
225 d = await self.get_unihash(cursor, method, taskhash, fetch_all)
229 async def get_unihash(self, cursor, method, taskhash, fetch_all=False): argument
233 cursor.execute(
247 row = cursor.fetchone()
253 self.update_unified(cursor, d)
256 row = self.query_equivalent(cursor, method, taskhash)
263 insert_unihash(cursor, d, Resolve.IGNORE)
273 with closing(self.db.cursor()) as cursor:
274 d = await self.get_outhash(cursor, method, outhash, taskhash)
278 async def get_outhash(self, cursor, method, outhash, taskhash): argument
280 cursor.execute(
293 row = cursor.fetchone()
299 self.update_unified(cursor, d)
304 def update_unified(self, cursor, data): argument
309 cursor,
314 cursor,
345 cursor = self.db.cursor()
347 row = self.query_equivalent(cursor, method, taskhash)
349 cursor.close()
376 with closing(self.db.cursor()) as cursor:
389 (rowid, inserted) = insert_outhash(cursor, outhash_data, Resolve.IGNORE)
394 cursor.execute(
410 row = cursor.fetchone()
431 cursor,
440 unihash_data = await self.get_unihash(cursor, data['method'], data['taskhash'])
457 with closing(self.db.cursor()) as cursor:
463 insert_unihash(cursor, insert_data, Resolve.IGNORE)
469 row = self.query_equivalent(cursor, data['method'], data['taskhash'])
502 def query_equivalent(self, cursor, method, taskhash): argument
504 cursor.execute(
511 return cursor.fetchone()