mirror of
https://github.com/KUlishevgeniy/c22712.git
synced 2026-09-24 08:00:22 +00:00
django test by perfecto
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
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
|
||||
Reference in New Issue
Block a user