# README
go-pg extensions
Faster JSON encoding by segmentio
import (
"github.com/go-pg/pg/v10/pgjson"
"github.com/go-pg/pgext"
)
func init() {
pgjson.SetProvider(pgext.SegmentJSONProvider{})
}
Tracing using OpenTelemetryHook
For more details see documentation:
db := pg.Connect(&pg.Options{...})
db.AddQueryHook(&pgext.OpenTelemetryHook{})
Print failed queries using DebugHook
db := pg.Connect(&pg.Options{...})
if debug {
db.AddQueryHook(&pgext.DebugHook{
//Verbose: true,
})
}