MCPcopy Create free account
hub / github.com/caesarHQ/textSQL / update_input_classification

Function update_input_classification

api/app/api/utils/caesar_logging.py:128–149  ·  view source on GitHub ↗
(id: str, ran_sql: bool, rows_returned: int, generated_sql: str)

Source from the content-addressed store, hash-verified

126
127@failsoft
128def update_input_classification(id: str, ran_sql: bool, rows_returned: int, generated_sql: str):
129
130 if not EVENTS_ENGINE or not id:
131 return None
132
133 params = {
134 "id": id,
135 "ran_sql": ran_sql,
136 "rows_returned": rows_returned,
137 "generated_sql": generated_sql
138 }
139
140 update_query = text("""
141 UPDATE input_classifications SET ran_sql = :ran_sql, rows_returned = :rows_returned, generated_sql = :generated_sql
142 WHERE id = :id
143 """)
144
145 with EVENTS_ENGINE.connect() as conn:
146 conn.execute(update_query, params)
147 conn.commit()
148
149 return {"status": "success"}
150
151@failsoft
152def log_sql_failure(input_text, sql_script, failure_message, attempt_number, app_name, session_id=None):

Callers 1

text_to_sqlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected