Skip to content

Commit 50799b1

Browse files
committed
Added WIthAllTraceOptions() and renamed TraceAll to AllTraceOptions to avoid potential confusion
1 parent 4274270 commit 50799b1

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var (
2828
)
2929

3030
// Register our ocsql wrapper for the provided SQLite3 driver.
31-
driverName, err = ocsql.Register("sqlite3", ocsql.WithOptions(ocsql.TraceAll))
31+
driverName, err = ocsql.Register("sqlite3", ocsql.WithAllTraceOptions())
3232
if err != nil {
3333
log.Fatalf("unable to register our ocsql driver: %v\n", err)
3434
}

options.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,15 @@ type TraceOptions struct {
5050
QueryParams bool
5151
}
5252

53-
// TraceAll has all tracing options enabled.
54-
var TraceAll = TraceOptions{
53+
// WithAllTraceOptions enables all available trace options.
54+
func WithAllTraceOptions() TraceOption {
55+
return func(o *TraceOptions) {
56+
*o = AllTraceOptions
57+
}
58+
}
59+
60+
// AllTraceOptions has all tracing options enabled.
61+
var AllTraceOptions = TraceOptions{
5562
AllowRoot: true,
5663
Transaction: true,
5764
Ping: true,

0 commit comments

Comments
 (0)