mirror of
https://github.com/KUlishevgeniy/c22712.git
synced 2026-09-23 23:50:21 +00:00
11 lines
258 B
Python
11 lines
258 B
Python
import psycopg2 as ps
|
|
import config
|
|
|
|
|
|
def exec_query(query: str) -> list:
|
|
with ps.connect(dbname=config.db_name, user=config.user) as conn:
|
|
with conn.cursor() as cur:
|
|
cur.execute(query)
|
|
res = cur.fetchall()
|
|
return res
|