Skip to content

Commit b30ae1d

Browse files
committed
完善 WrappedDbClient 的注释。
1 parent 660e8f2 commit b30ae1d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

wrap/wrap_dbclient.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ type WrappedDbClient struct {
1818

1919
// WrapFunc 用于包裹 SQL 执行方法。
2020
// 函数本身在执行 SQL 语句前执行,返回一个函数,在执行 SQL 语句后执行。
21+
// 返回函数的 err 参数是 SQL 执行后返回的 error。
2122
type WrapFunc func(sql string, args []any) func(error)
2223

2324
// Extend 加强 DbClient,在 DbClient 的数据库访问上,提供一层装饰器包裹,以注入慢日志/统计指标等能力。
2425
// params:
2526
//
2627
// @raw 原始的 DbClient 实例。
27-
// @execWrapFunc 包裹函数,在执行 SQL 语句前执行,返回一个函数,在执行 SQL 语句后执行。
28+
// @execWrapFunc 包裹函数,在执行 SQL 语句前执行,返回一个函数,在执行 SQL 语句后执行。返回函数的 err 参数是 SQL 执行后返回的 error。
2829
//
2930
// returns:
3031
//

0 commit comments

Comments
 (0)