Some headway on database stuff
This commit is contained in:
1 parent
a30961f884
commit
16dc75a57d
7 files changed
+34
-4
No files matched your search
@@ -35,13 +35,13 @@ class Database():
|
||||
|
||||
return self.query(query_string, values)[0]
|
||||
|
||||
def delete(self, table: str, where: list[dict]=None) -> int:
|
||||
def delete(self, table: str, values: list, where: list[dict]=None) -> int:
|
||||
query_string = "DELETE FROM {table}{where}".format(
|
||||
table = table,
|
||||
where = self.__generate_basic_where_clause(where) if not where is None else ""
|
||||
)
|
||||
|
||||
return self.query(query_string)[0]
|
||||
return self.query(query_string, values)[0]
|
||||
|
||||
def __generate_basic_where_clause(self, where: list[dict]):
|
||||
return " WHERE {clauses}".format(
|
||||
|
||||
Reference in new issue
Block a user