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

Function save_sql_exec_data

backend/apps/chat/curd/chat.py:1120–1137  ·  view source on GitHub ↗
(session: SessionDep, record_id: int, data: str)

Source from the content-addressed store, hash-verified

1118
1119
1120def save_sql_exec_data(session: SessionDep, record_id: int, data: str) -> ChatRecord:
1121 if not record_id:
1122 raise Exception("Record id cannot be None")
1123 record = get_chat_record_by_id(session, record_id)
1124
1125 record.data = data
1126
1127 result = ChatRecord(**record.model_dump())
1128
1129 stmt = update(ChatRecord).where(and_(ChatRecord.id == record.id)).values(
1130 data=record.data,
1131 )
1132
1133 session.execute(stmt)
1134
1135 session.commit()
1136
1137 return result
1138
1139
1140def finish_record(session: SessionDep, record_id: int) -> ChatRecord:

Callers 1

save_sql_dataMethod · 0.90

Calls 4

ChatRecordClass · 0.90
get_chat_record_by_idFunction · 0.85
updateFunction · 0.50
valuesMethod · 0.45

Tested by

no test coverage detected