Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bunpgd/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func WithConnMaxIdleTime(d time.Duration) bun.DBOption {
}

func WithOTEL(option ...bunotel.Option) bun.DBOption {
return func(db *bun.DB) { db.WithQueryHook(bunotel.NewQueryHook(option...)) }
return func(db *bun.DB) { *db = *db.WithQueryHook(bunotel.NewQueryHook(option...)) }
}

func WithSLog(opts ...bunslog.Option) bun.DBOption {
Expand All @@ -39,7 +39,7 @@ func WithSLog(opts ...bunslog.Option) bun.DBOption {
bunslog.WithSlowQueryThreshold(3 * time.Second),
}
}
return func(db *bun.DB) { db.WithQueryHook(bunslog.NewQueryHook(opts...)) }
return func(db *bun.DB) { *db = *db.WithQueryHook(bunslog.NewQueryHook(opts...)) }
}

func WithCreateTable(ctx context.Context, cancel context.CancelCauseFunc, model ...any) bun.DBOption {
Expand Down
Loading