MCPcopy Index your code
hub / github.com/dataease/SQLBot / save_sql_answer

Function save_sql_answer

backend/apps/chat/curd/chat.py:886–900  ·  view source on GitHub ↗
(session: SessionDep, record_id: int, answer: str)

Source from the content-addressed store, hash-verified

884
885
886def save_sql_answer(session: SessionDep, record_id: int, answer: str) -> ChatRecord:
887 if not record_id:
888 raise Exception("Record id cannot be None")
889
890 stmt = update(ChatRecord).where(and_(ChatRecord.id == record_id)).values(
891 sql_answer=answer,
892 )
893
894 session.execute(stmt)
895
896 session.commit()
897
898 record = get_chat_record_by_id(session, record_id)
899
900 return record
901
902
903def save_analysis_answer(session: SessionDep, record_id: int, answer: str = '') -> ChatRecord:

Callers 1

generate_sqlMethod · 0.90

Calls 3

get_chat_record_by_idFunction · 0.85
updateFunction · 0.50
valuesMethod · 0.45

Tested by

no test coverage detected