update 0.1

This commit is contained in:
ada-dmitry
2023-08-22 14:32:09 +03:00
parent ad034254ca
commit 6b33df6081
3 changed files with 48 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import psycopg2
db_params = {
'host': '51.250.68.42',
'database': 'test',
'user': 'curator',
'password': '4oumQk'
}
try:
connection = psycopg2.connect(**db_params)
cursor = connection.cursor()
# Ваш код выполнения запросов
cursor.execute("SELECT * FROM chats")
rows = cursor.fetchall()
for row in rows:
print(row)
cursor.close()
connection.close()
except Exception as e:
print("Ошибка:", e)