refactor(db): 增强测试事务支持和保存点管理

- 在 HoTimeDB 中新增测试事务功能,允许在测试模式下使用事务进行操作
- 实现 BeginTestTx 和 RollbackTestTx 方法,支持测试事务的开启和回滚
- 在 Action 方法中集成保存点管理,确保在测试模式下的嵌套事务处理
- 更新 README.md,添加 API 测试框架的相关说明,提升文档完整性
This commit is contained in:
2026-03-14 10:19:57 +08:00
parent fab7931d3c
commit bd20af0c89
12 changed files with 2251 additions and 9 deletions
+7 -6
View File
@@ -1,14 +1,8 @@
package hotime
import (
. "code.hoteas.com/golang/hotime/cache"
"code.hoteas.com/golang/hotime/code"
. "code.hoteas.com/golang/hotime/common"
. "code.hoteas.com/golang/hotime/db"
. "code.hoteas.com/golang/hotime/log"
"database/sql"
"fmt"
"github.com/sirupsen/logrus"
"io/ioutil"
"net/http"
"net/url"
@@ -17,6 +11,13 @@ import (
"strconv"
"strings"
"time"
. "code.hoteas.com/golang/hotime/cache"
"code.hoteas.com/golang/hotime/code"
. "code.hoteas.com/golang/hotime/common"
. "code.hoteas.com/golang/hotime/db"
. "code.hoteas.com/golang/hotime/log"
"github.com/sirupsen/logrus"
)
type Application struct {