-
Notifications
You must be signed in to change notification settings - Fork 185
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
feat(document-readers): add mysql implements #379
Conversation
<artifactId>spring-ai-core</artifactId> | ||
</dependency> | ||
|
||
<!-- MySQL JDBC Driver --> |
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.
这里需要引入版本吗?我记得 spring ai alibaba 引入 spring boot parent bom,里面是有 mysql jar 包的,可以复用?
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.
替换成了mysql-connector-j
|
||
### MySQLResource 参数 | Parameters | ||
|
||
| 参数 Parameter | 说明 Description | 默认值 Default | |
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.
来个默认值?就是 127.0.0.1:3306 root root?
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.
resolved
</dependency> | ||
</dependencies> | ||
|
||
</project> |
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.
以空行结尾
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.
resolved
import org.springframework.ai.document.Document; | ||
import org.springframework.ai.document.DocumentReader; | ||
|
||
import java.sql.*; |
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.
不要用全量引入,用增量引入
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.
resolved
MySQL Document Reader Implementation
功能描述 | Feature Description
实现了基于Spring AI的MySQL文档读取器,支持从MySQL数据库读取数据并转换为文档格式。
Implemented a MySQL document reader based on Spring AI, supporting reading data from MySQL database and converting it to document format.
主要特性 | Key Features
Pure JDBC implementation, no additional dependencies required
Support for custom content and metadata columns
Comprehensive error handling and automatic resource cleanup
Support for custom SQL queries
技术实现 | Technical Implementation
Using JDBC to connect MySQL database directly
Supporting flexible field mapping configuration
Implemented automatic resource management and exception handling
Provided comprehensive unit tests
测试覆盖 | Test Coverage
Basic functionality tests: document reading and conversion
Error handling tests: invalid connections and queries
Resource management tests: connection closing and cleanup
文档完善 | Documentation
Provided detailed bilingual README
Included complete usage examples
Added configuration parameter descriptions
Supplemented with notes and best practices
代码规范 | Code Standards
Following Alibaba Java Development Guidelines
Added complete code comments
Implemented unified exception handling
Maintained code simplicity and maintainability