gadasin/UI/src/requests/connection.py

12 lines
268 B
Python
Raw Normal View History

2024-12-19 12:42:46 +03:00
import psycopg2
connection = None
def get_cursor():
global connection
if connection is None:
connection = psycopg2.connect(database="postgres", user="postgres", password="not_admin", host="serafimdev.com", port=6000)
return connection.cursor()