Documentation ¶
Overview ¶
Package bun provides helper functions for tracing the github.com/uptrace/bun package (https://github.com/uptrace/bun).
Example ¶
package main import ( "context" "database/sql" "github.com/uptrace/bun" "github.com/uptrace/bun/dialect/sqlitedialect" buntrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/uptrace/bun" _ "modernc.org/sqlite" ) func main() { sqlite, err := sql.Open("sqlite", "file::memory:?cache=shared") if err != nil { panic(err) } db := bun.NewDB(sqlite, sqlitedialect.New()) // Wrap the connection with the APM hook. buntrace.Wrap(db) var user struct { Name string } _ = db.NewSelect().Column("name").Table("users").Scan(context.Background(), &user) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.