Add demand api and test

This commit is contained in:
WQY\qiong
2022-10-21 23:25:13 +08:00
parent 9254427915
commit b15348f857
6 changed files with 146 additions and 1 deletions

View File

@@ -51,6 +51,12 @@ def read(name: str, sql: str) -> Row:
return row
def read_all(name: str, sql: str) -> list[Row]:
with conn[name].cursor(row_factory=dict_row) as cur:
cur.execute(sql)
return cur.fetchall()
def write(name: str, sql: str) -> None:
with conn[name].cursor() as cur:
cur.execute(sql)