Skip to content

refactor(sqlquery):增加动态参数功能;增加选中多表通过AI生成SQL语句功能#3159

Open
RankRao wants to merge 1 commit into
hhyo:masterfrom
RankRao:refactor-sqlquery
Open

refactor(sqlquery):增加动态参数功能;增加选中多表通过AI生成SQL语句功能#3159
RankRao wants to merge 1 commit into
hhyo:masterfrom
RankRao:refactor-sqlquery

Conversation

@RankRao
Copy link
Copy Markdown
Contributor

@RankRao RankRao commented Apr 29, 2026

1、sql查询支持动态参数,
示例sql:select * from table_name where add_date between '${start_date}' and '${end_date}';
通过${}的固定格式,在sql查询底下增加可配置的动态参数输入框,最终sql提交查询替换参数占位符为文本值。
#3019
2、增强AI查询功能
当前为单表结构输入给AI提示词,改为选中多表(去重)提交给后台,查询对应表结构,和自然语言一起输入给AI。增加AI输出的联表join能力。

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.14%. Comparing base (9d50777) to head (9154c0d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3159      +/-   ##
==========================================
+ Coverage   84.66%   85.14%   +0.47%     
==========================================
  Files         141      142       +1     
  Lines       25015    25471     +456     
==========================================
+ Hits        21179    21687     +508     
+ Misses       3836     3784      -52     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RankRao
Copy link
Copy Markdown
Contributor Author

RankRao commented May 29, 2026

@LeoQuote 有空帮忙看看这个PR,好久前的提交了。

Copy link
Copy Markdown
Collaborator

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第一个功能, 我不太确认这是否有意义, 写一个裸 sql 是不是也很好?

第二个功能, 我也不太确认是否需要, 首先这里多了一个需要交互的地方, 之前是单选表, 现在是多选了, 多选表也仅为 AI 服务, 我想交互上能否更加地简单, 比如 AI 自主分析出是否需要多张表的表结构, 哪些表的表结构, 然后AI主动请求获取到相关表的表结构, 最终使用表结构和需求, 生成 SQL 语句.

@RankRao
Copy link
Copy Markdown
Contributor Author

RankRao commented May 29, 2026

第一个功能是这样的实现,在多SQL,多条件传参方面有一定的优势

image

@RankRao
Copy link
Copy Markdown
Contributor Author

RankRao commented May 29, 2026

第二个功能:你说的这种【AI 自主分析出是否需要多张表的表结构】目前在真实业务中基本很难做,有调研过各种AI及其工具的自动查表功能,实际最大的难点就是AI怎么找到对应的表,每次可能都找到另一个及其相似的表。

目前archery的ai也比较基础,没有用很大的辅助功能,
第二个功能只是在目前的AI查单表的基础上,扩展到查询多表,然后表的选择方面,以前单表是人工选择,多表也是人工选择的,没有突破人为因素。

@RankRao
Copy link
Copy Markdown
Contributor Author

RankRao commented Jun 4, 2026

好像搞错了,rebase到origin/master之后,解决冲突,重新推送就变成这个鬼样子,一大堆commit啦。

@RankRao RankRao requested a review from LeoQuote June 4, 2026 09:42
@LeoQuote
Copy link
Copy Markdown
Collaborator

LeoQuote commented Jun 5, 2026

你试一下 reset --soft 然后重新 commit 试一下, 这个修改范围有点太广了

@RankRao RankRao force-pushed the refactor-sqlquery branch from 0d1dcab to 9154c0d Compare June 5, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants