From 997dc064e6815c54e3baa5e9a675c21ecd239116 Mon Sep 17 00:00:00 2001 From: Dustin Thomas Date: Tue, 9 Jan 2024 14:57:42 -0600 Subject: [PATCH] Create read/write functions to fill later --- database.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/database.py b/database.py index 267c87a..f68e7c0 100644 --- a/database.py +++ b/database.py @@ -24,4 +24,17 @@ class DBConnector: self.conn.close() def _query(self, sql): - self.cur.execute(sql) \ No newline at end of file + self.cur.execute(sql) + + def read(self, **kwargs): + """Read rows from a database that match the specified filters. + + :param kwargs: Column constraints; i.e. what value to filter by in what column. + :returns: A list of dictionaries of all matching rows, or an empty list if no match.""" + pass + + def write(self, **kwargs): + """Write a row to the database. + + :param kwargs: Values to write for each database; specify each column separately!""" + pass \ No newline at end of file