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

Function list_generate_sql_logs

backend/apps/chat/curd/chat.py:675–685  ·  view source on GitHub ↗
(session: SessionDep, chart_id: int)

Source from the content-addressed store, hash-verified

673
674
675def list_generate_sql_logs(session: SessionDep, chart_id: int) -> List[ChatLog]:
676 stmt = select(ChatLog).where(
677 and_(ChatLog.pid.in_(select(ChatRecord.id).where(and_(ChatRecord.chat_id == chart_id))),
678 ChatLog.type == TypeEnum.CHAT, ChatLog.operate == OperationEnum.GENERATE_SQL)).order_by(
679 ChatLog.start_time)
680 result = session.execute(stmt).all()
681 _list = []
682 for row in result:
683 for r in row:
684 _list.append(ChatLog(**r.model_dump()))
685 return _list
686
687
688def list_generate_chart_logs(session: SessionDep, chart_id: int) -> List[ChatLog]:

Callers 1

__init__Method · 0.90

Calls 2

ChatLogClass · 0.90
appendMethod · 0.45

Tested by

no test coverage detected