Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,11 +48,13 @@ def get_db_connection():
|
|
48 |
def execute_query(sql_query: SQLQuery):
|
49 |
conn = get_db_connection()
|
50 |
try:
|
|
|
|
|
51 |
print("Solicitud POST completa:", sql_query.json())
|
52 |
-
print("Consulta recibida en el servidor:",
|
53 |
|
54 |
cursor = conn.cursor()
|
55 |
-
cursor.execute(
|
56 |
conn.commit()
|
57 |
if cursor.description: # Verifica si la consulta tiene resultados
|
58 |
results = cursor.fetchall()
|
|
|
48 |
def execute_query(sql_query: SQLQuery):
|
49 |
conn = get_db_connection()
|
50 |
try:
|
51 |
+
# Limpiar la consulta para eliminar '\nObservation'
|
52 |
+
cleaned_query = sql_query.query.replace("\nObservation", "")
|
53 |
print("Solicitud POST completa:", sql_query.json())
|
54 |
+
print("Consulta recibida en el servidor:", cleaned_query)
|
55 |
|
56 |
cursor = conn.cursor()
|
57 |
+
cursor.execute(cleaned_query)
|
58 |
conn.commit()
|
59 |
if cursor.description: # Verifica si la consulta tiene resultados
|
60 |
results = cursor.fetchall()
|