bun

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package bun records queries executed through uptrace/bun as webpprof query entries while preserving Bun's existing hooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Profile

func Profile(db *bun.DB, configs ...Config) *bun.DB

Profile instruments db with the default profiler.

func ProfileWith

func ProfileWith(profiler *webpprof.Profiler, db *bun.DB, configs ...Config) *bun.DB

ProfileWith instruments db with an explicit profiler.

Types

type Config

type Config struct {
	Connection     string
	Driver         string
	Database       string
	Explain        bool
	ExplainTimeout time.Duration
	ExplainMaxRows int
}

Config supplies connection metadata and optional non-executing EXPLAIN behavior for captured Bun queries.

type ProfilerBun

type ProfilerBun struct {
	Config Config
}

ProfilerBun implements webpprof.Integration for Bun databases.

func New

func New(configs ...Config) ProfilerBun

New creates a Bun integration. Only the first optional Config is used.

func (ProfilerBun) Name

func (ProfilerBun) Name() string

Name returns the integration cache namespace.

func (ProfilerBun) Profile

func (d ProfilerBun) Profile(scope webpprof.Scope, db *bun.DB) *bun.DB

Profile returns a Bun database with a webpprof query hook. Wrappers are cached per database and profiler scope.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL