Create read/write functions to fill later
This commit is contained in:
parent
20648ed295
commit
997dc064e6
13
database.py
13
database.py
@ -25,3 +25,16 @@ class DBConnector:
|
|||||||
|
|
||||||
def _query(self, sql):
|
def _query(self, sql):
|
||||||
self.cur.execute(sql)
|
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
|
Loading…
x
Reference in New Issue
Block a user