12 lines
394 B
Python
12 lines
394 B
Python
from psycopg.rows import dict_row
|
|
from connection import g_conn_dict as conn
|
|
|
|
def set_title(name: str, value: str) -> None:
|
|
with conn[name].cursor() as cur:
|
|
cur.execute(f"update title set value = '{value}'")
|
|
|
|
def get_title(name: str) -> str:
|
|
with conn[name].cursor(row_factory=dict_row) as cur:
|
|
cur.execute(f"select * from title")
|
|
return cur.fetchone()['value']
|