upstep bun to v1.0.14 (#291)

This commit is contained in:
tobi 2021-10-24 13:14:37 +02:00 committed by GitHub
commit 8b7c3507fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
100 changed files with 5071 additions and 3836 deletions

View file

@ -163,7 +163,14 @@ func (db *DB) ScanRow(ctx context.Context, rows *sql.Rows, dest ...interface{})
return rs.ScanRow(ctx, rows)
}
type queryHookIniter interface {
Init(db *DB)
}
func (db *DB) AddQueryHook(hook QueryHook) {
if initer, ok := hook.(queryHookIniter); ok {
initer.Init(db)
}
db.queryHooks = append(db.queryHooks, hook)
}