Quazim0t0 commited on
Commit
bf0142b
·
verified ·
1 Parent(s): 91561ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -69,6 +69,14 @@ def get_data_table():
69
  def sql_engine(query: str) -> str:
70
  """
71
  Executes an SQL query and returns formatted results.
 
 
 
 
 
 
 
 
72
  """
73
  try:
74
  with engine.connect() as con:
 
69
  def sql_engine(query: str) -> str:
70
  """
71
  Executes an SQL query and returns formatted results.
72
+
73
+ Args:
74
+ query: The SQL query string to execute on the database. Must be a valid SELECT query.
75
+
76
+ Returns:
77
+ str: The formatted query results as a string. For single value results, returns the value.
78
+ For multiple rows/columns, returns newline-separated rows with comma-separated values.
79
+ Returns error message as string if query execution fails.
80
  """
81
  try:
82
  with engine.connect() as con: