feat:新增投顾agent和nl2sqlagent
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
"""NL2SQL 安全 EXPLAIN 辅助函数。"""
|
||||
from __future__ import annotations
|
||||
|
||||
from nl2sql.sql_security import ValidatedSql
|
||||
|
||||
|
||||
def build_explain_sql(validated_sql: ValidatedSql) -> str:
|
||||
"""只为已通过安全校验的 SELECT 构造 EXPLAIN 语句。"""
|
||||
if not isinstance(validated_sql, ValidatedSql):
|
||||
raise TypeError("EXPLAIN 只接受已校验 SQL")
|
||||
return f"EXPLAIN {validated_sql.sql}"
|
||||
Reference in New Issue
Block a user