From 651515eb88cb5675434ff068ad19edd0c4c0e858 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 29 Jul 2021 16:30:31 +0300 Subject: Delete "update_raw" and it's test-cases --- gn3/db/__init__.py | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'gn3/db') diff --git a/gn3/db/__init__.py b/gn3/db/__init__.py index 24ae8f1..149a344 100644 --- a/gn3/db/__init__.py +++ b/gn3/db/__init__.py @@ -64,20 +64,6 @@ def update(conn: Any, return cursor.rowcount -def update_raw(conn: Any, table: str, - set_: List[Tuple[str, Any]], - where: Tuple[str, Tuple]): - """Run a generic raw statement""" - sql = f"UPDATE {table} SET " - sql += ", ".join([f"{k} = '%s'" for k, v in set_]) - sql += f" WHERE {where[0]}" - with conn.cursor() as cursor: - cursor.execute(sql, - tuple(v for _, v in set_) + where[1]) - conn.commit() - return cursor.rowcount - - def fetchone(conn: Any, table: str, where: Optional[Dataclass], -- cgit v1.2.3