adding validated services? patching forcad_local.py

This commit is contained in:
Your Name
2026-08-13 08:32:35 +07:00
parent d485f61169
commit e795614e45
1459 changed files with 420036 additions and 436 deletions

View File

@@ -0,0 +1,31 @@
#!/usr/bin/python3
import psycopg2
import sys
class LocalDb:
def __init__(self):
pass
def connect(self,conn_string):
#try:
self.conn = psycopg2.connect(
conn_string
)
#except Exception as e:
#print(e)
def execute(self, command):
cursor = self.conn.cursor()
#try:
cursor.execute(command)
try:
result = cursor.fetchall()
except Exception as e:
print(e,file=sys.stderr)
result = []
#cursor.close()
return result
def disconnect(self):
self.conn.cursor.close()
self.conn.close()