Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(hook *QueryHook)
func FromEnv ¶
FromEnv configures the hook using the environment variable value. For example, WithEnv("BUNDEBUG"):
- BUNDEBUG=0 - disables the hook.
- BUNDEBUG=1 - enables the hook.
func WithErrorLevel ¶
func WithLogSlow ¶
func WithLogger ¶
func WithQueryLevel ¶
func WithSlowLevel ¶
type QueryHook ¶
type QueryHook struct {
// contains filtered or unexported fields
}
QueryHook wraps query hook
func NewQueryHook ¶
NewQueryHook returns new instance
func (*QueryHook) AfterQuery ¶
func (h *QueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)
AfterQuery convert a bun QueryEvent into a slog message
func (*QueryHook) BeforeQuery ¶
BeforeQuery does nothing
Click to show internal directories.
Click to hide internal directories.