From a76982e581d4627cebb8db8d1b25e42c282032da Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 22 Mar 2022 22:16:26 -0700 Subject: [PATCH] Add type annotation sqlite3.Cursor. --- voussoirkit/worms.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/voussoirkit/worms.py b/voussoirkit/worms.py index ed633cc..332232c 100644 --- a/voussoirkit/worms.py +++ b/voussoirkit/worms.py @@ -163,7 +163,7 @@ class Database(metaclass=abc.ABCMeta): self.sql.commit() self.last_commit_id = RNG.getrandbits(32) - def delete(self, table, pairs) -> None: + def delete(self, table, pairs) -> sqlite3.Cursor: if isinstance(table, type) and issubclass(table, Object): table = table.table self.assert_table_exists(table) @@ -276,13 +276,12 @@ class Database(metaclass=abc.ABCMeta): tables = set(self.select_column(query)) return tables - def insert(self, table, data) -> None: + def insert(self, table, data) -> sqlite3.Cursor: if isinstance(table, type) and issubclass(table, Object): table = table.table self.assert_table_exists(table) column_names = self.COLUMNS[table] (qmarks, bindings) = sqlhelpers.insert_filler(column_names, data) - query = f'INSERT INTO {table} VALUES({qmarks})' return self.execute(query, bindings) @@ -434,7 +433,7 @@ class Database(metaclass=abc.ABCMeta): else: return None - def update(self, table, pairs, where_key) -> None: + def update(self, table, pairs, where_key) -> sqlite3.Cursor: if isinstance(table, type) and issubclass(table, Object): table = table.table self.assert_table_exists(table)