Skip to content

Conversation

HunterPorter
Copy link
Contributor

Describe what this PR does / why we need it

新增 H2 数据库支持,方便学习和调试

Does this pull request fix one issue?

NONE

Describe how you did it

  • 添加 H2 数据库的连接池、DDL 和访问器实现
  • 在枚举类型中增加 H2 相关选项
  • 更新配置文件以支持 H2 数据源 -增加 H2 数据库的示例数据和初始化脚本

Describe how to verify it

Special notes for reviews

- 添加 H2 数据库的连接池、DDL 和访问器实现
- 在枚举类型中增加 H2 相关选项
- 更新配置文件以支持 H2 数据源
-增加 H2 数据库的示例数据和初始化脚本
@github-actions github-actions bot added the area/nl2sql SAA nl2sql module label Sep 4, 2025
- 在 AgentVectorService 中增加对 H2 数据库的支持
- 新增 H2 数据库配置文件
- 在示例数据中添加 H2 数据源
- 修改 H2JdbcDdl 类以适应 H2 数据库特性- 更新数据源表结构,允许空主机和端口字段
- 将 mysqlAccessor 重命名为 dbAccessor,统一数据库访问接口
- 在 BaseDefaultConfiguration 中根据数据库类型动态选择合适的 Accessor
- 更新相关服务类以使用新的 dbAccessor
- 注释掉数据源类型检查代码,为后续多数据库支持做准备
yuluo-yx
yuluo-yx previously approved these changes Sep 7, 2025
- 更新数据初始化脚本路径和内容
- 调整 H2JdbcDdl 类以支持 schema 参数
- 修改 SqlExecuteNode 和 SqlExecutor 以支持 H2 数据库的 schema 切换
@zhangshenghang
Copy link
Collaborator

It looks great. Can you provide detailed testing code?

@HunterPorter
Copy link
Contributor Author

HunterPorter commented Sep 13, 2025

It looks great. Can you provide detailed testing code?

由于没有太多逻辑,所以没有添加单元测试,添加了2个集成测试 @zhangshenghang

- 新增 H2AccessorIntegrationTest 类,实现对 H2 数据库的各种操作测试- 新增 H2DatabaseIntegrationTest 类,验证 H2 数据库配置和初始化脚本
- 修改 H2JdbcDdl 类中的 sampleColumn 方法,增加 schema 参数
…类添加环境变量条件

为确保集成测试在设置了 AI_DASHSCOPE_API_KEY 环境变量时才运行,增加了 @EnabledIfEnvironmentVariable 注解。这样可以防止在没有设置 API 密钥的情况下执行这些测试。
@chickenlj chickenlj changed the base branch from main to a2a-support September 21, 2025 09:32
Copy link
Collaborator

@zxuexingzhijie zxuexingzhijie left a comment

Choose a reason for hiding this comment

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

LGTM,plta,@VLSMB

Copy link
Collaborator

@VLSMB VLSMB left a comment

Choose a reason for hiding this comment

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

LGTM

@VLSMB VLSMB merged commit 295c686 into alibaba:a2a-support Sep 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nl2sql SAA nl2sql module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants