package ocsql

import (
	
)
TraceOption allows for managing ocsql configuration using functional options.
type TraceOption func(o *TraceOptions)
TraceOptions holds configuration of our ocsql tracing middleware. By default all options are set to false intentionally when creating a wrapped driver and provide the most sensible default with both performance and security in mind.
AllowRoot, if set to true, will allow ocsql to create root spans in absence of existing spans or even context. Default is to not trace ocsql calls if no existing parent span is found in context or when using methods not taking context.
Ping, if set to true, will enable the creation of spans on Ping requests.
RowsNext, if set to true, will enable the creation of spans on RowsNext calls. This can result in many spans.
RowsClose, if set to true, will enable the creation of spans on RowsClose calls.
RowsAffected, if set to true, will enable the creation of spans on RowsAffected calls.
LastInsertID, if set to true, will enable the creation of spans on LastInsertId calls.
Query, if set to true, will enable recording of sql queries in spans. Only allow this if it is safe to have queries recorded with respect to security.
QueryParams, if set to true, will enable recording of parameters used with parametrized queries. Only allow this if it is safe to have parameters recorded with respect to security. This setting is a noop if the Query option is set to false.
DefaultAttributes will be set to each span as default.
WithAllTraceOptions enables all available trace options.
func () TraceOption {
	return func( *TraceOptions) {
		* = AllTraceOptions
	}
}
AllTraceOptions has all tracing options enabled.
WithOptions sets our ocsql tracing middleware options through a single TraceOptions object.
func ( TraceOptions) TraceOption {
	return func( *TraceOptions) {
		* = 
		.DefaultAttributes = append(
			[]trace.Attribute(nil), .DefaultAttributes...,
		)
	}
}
WithAllowRoot if set to true, will allow ocsql to create root spans in absence of exisiting spans or even context. Default is to not trace ocsql calls if no existing parent span is found in context or when using methods not taking context.
func ( bool) TraceOption {
	return func( *TraceOptions) {
		.AllowRoot = 
	}
}
WithPing if set to true, will enable the creation of spans on Ping requests.
func ( bool) TraceOption {
	return func( *TraceOptions) {
		.Ping = 
	}
}
WithRowsNext if set to true, will enable the creation of spans on RowsNext calls. This can result in many spans.
func ( bool) TraceOption {
	return func( *TraceOptions) {
		.RowsNext = 
	}
}
WithRowsClose if set to true, will enable the creation of spans on RowsClose calls.
func ( bool) TraceOption {
	return func( *TraceOptions) {
		.RowsClose = 
	}
}
WithRowsAffected if set to true, will enable the creation of spans on RowsAffected calls.
func ( bool) TraceOption {
	return func( *TraceOptions) {
		.RowsAffected = 
	}
}
WithLastInsertID if set to true, will enable the creation of spans on LastInsertId calls.
func ( bool) TraceOption {
	return func( *TraceOptions) {
		.LastInsertID = 
	}
}
WithQuery if set to true, will enable recording of sql queries in spans. Only allow this if it is safe to have queries recorded with respect to security.
func ( bool) TraceOption {
	return func( *TraceOptions) {
		.Query = 
	}
}
WithQueryParams if set to true, will enable recording of parameters used with parametrized queries. Only allow this if it is safe to have parameters recorded with respect to security. This setting is a noop if the Query option is set to false.
func ( bool) TraceOption {
	return func( *TraceOptions) {
		.QueryParams = 
	}
}
WithDefaultAttributes will be set to each span as default.
func ( ...trace.Attribute) TraceOption {
	return func( *TraceOptions) {
		.DefaultAttributes = 
	}