diff --git a/README.md b/README.md index f3108cd..ec30ea7 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ func yesqlScan[T any](query yesql.SQLQuery, obj T) T { func initSqlxDB() { _db = conf.MustSqlxDB() yesql.UseSqlx(_db) - yesql.SetDefaultQueryHooks(func(query *yesql.Query) (*yesql.Query, error) { + yesql.SetDefaultQueryHook(func(query *yesql.Query) (*yesql.Query, error) { qstr := strings.TrimRight(query.Query, ";") // table name fixed qstr = strings.Replace(qstr, "@", conf.DatabaseSetting.TablePrefix, -1) diff --git a/yesql.go b/yesql.go index 7df03e0..d757c41 100644 --- a/yesql.go +++ b/yesql.go @@ -46,8 +46,8 @@ func SetDefaultPrepareHook(hook PrepareHook) { } } -// SetDefaultQueryHooks set default query hooks -func SetDefaultQueryHooks(hooks ...func(query *Query) (*Query, error)) { +// SetDefaultQueryHook set default query hooks +func SetDefaultQueryHook(hooks ...func(query *Query) (*Query, error)) { _defaultQueryHooks = nil for _, hook := range hooks { if hook != nil {