Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*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.
- BUNDEBUG=2 - enables the hook and verbose mode.
func WithVerbose ¶
WithVerbose configures the hook to log all queries (by default, only failed queries are logged).
func WithWriter ¶
WithWriter sets the log output to an io.Writer the default is os.Stderr
type QueryHook ¶
type QueryHook struct {
// contains filtered or unexported fields
}
func NewQueryHook ¶
func (*QueryHook) AfterQuery ¶
func (h *QueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)
func (*QueryHook) BeforeQuery ¶
Click to show internal directories.
Click to hide internal directories.