-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(nl2sql): 新增 H2 数据库支持 #2328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 添加 H2 数据库的连接池、DDL 和访问器实现 - 在枚举类型中增加 H2 相关选项 - 更新配置文件以支持 H2 数据源 -增加 H2 数据库的示例数据和初始化脚本
- 在 AgentVectorService 中增加对 H2 数据库的支持 - 新增 H2 数据库配置文件 - 在示例数据中添加 H2 数据源 - 修改 H2JdbcDdl 类以适应 H2 数据库特性- 更新数据源表结构,允许空主机和端口字段
- 将 mysqlAccessor 重命名为 dbAccessor,统一数据库访问接口 - 在 BaseDefaultConfiguration 中根据数据库类型动态选择合适的 Accessor - 更新相关服务类以使用新的 dbAccessor - 注释掉数据源类型检查代码,为后续多数据库支持做准备
- 更新数据初始化脚本路径和内容 - 调整 H2JdbcDdl 类以支持 schema 参数 - 修改 SqlExecuteNode 和 SqlExecutor 以支持 H2 数据库的 schema 切换
It looks great. Can you provide detailed testing code? |
由于没有太多逻辑,所以没有添加单元测试,添加了2个集成测试 @zhangshenghang |
- 新增 H2AccessorIntegrationTest 类,实现对 H2 数据库的各种操作测试- 新增 H2DatabaseIntegrationTest 类,验证 H2 数据库配置和初始化脚本 - 修改 H2JdbcDdl 类中的 sampleColumn 方法,增加 schema 参数
…类添加环境变量条件 为确保集成测试在设置了 AI_DASHSCOPE_API_KEY 环境变量时才运行,增加了 @EnabledIfEnvironmentVariable 注解。这样可以防止在没有设置 API 密钥的情况下执行这些测试。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,plta,@VLSMB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Describe what this PR does / why we need it
新增 H2 数据库支持,方便学习和调试
Does this pull request fix one issue?
NONE
Describe how you did it
Describe how to verify it
Special notes for reviews