github.com/blend/go-sdk@v1.20220411.3/db/tracer.go (about) 1 /* 2 3 Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package db 9 10 import ( 11 "context" 12 "database/sql" 13 ) 14 15 // Tracer is a type that can implement traces. 16 // If any of the methods return a nil finisher, they will be skipped. 17 type Tracer interface { 18 Prepare(context.Context, Config, string) TraceFinisher 19 Query(context.Context, Config, string, string) TraceFinisher 20 } 21 22 // TraceFinisher is a type that can finish traces. 23 type TraceFinisher interface { 24 FinishPrepare(context.Context, error) 25 FinishQuery(context.Context, sql.Result, error) 26 }