refactor(db): 重命名批量插入方法并更新文档

- 将 BatchInsert 方法重命名为 Inserts,以更好地反映其功能
- 更新示例代码和文档,确保使用新方法名
- 删除过时的文档文件,整合 HoTimeDB 使用说明和 API 参考
- 优化 README.md,增强框架特性和安装说明的清晰度
This commit is contained in:
2026-01-22 20:32:29 +08:00
parent 5235ef133d
commit e704701752
9 changed files with 366 additions and 452 deletions
+3 -3
View File
@@ -307,19 +307,19 @@ func (that *HoTimeDB) Insert(table string, data map[string]interface{}) int64 {
return id
}
// BatchInsert 批量插入数据
// Inserts 批量插入数据
// table: 表名
// dataList: 数据列表,每个元素是一个 Map
// 返回受影响的行数
//
// 示例:
//
// affected := db.BatchInsert("user", []Map{
// affected := db.Inserts("user", []Map{
// {"name": "张三", "age": 25, "email": "zhang@example.com"},
// {"name": "李四", "age": 30, "email": "li@example.com"},
// {"name": "王五", "age": 28, "email": "wang@example.com"},
// })
func (that *HoTimeDB) BatchInsert(table string, dataList []Map) int64 {
func (that *HoTimeDB) Inserts(table string, dataList []Map) int64 {
if len(dataList) == 0 {
return 0
}