sql

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetHostAttribute = func(dsn string) attribute.KeyValue {
		host, _ := dbx.GetHost(dsn)
		return attribute.String("host", host)
	}

	GetDBNameAttribute = func(dsn string) attribute.KeyValue {
		dbname, _ := dbx.GetDatabase(dsn)
		return attribute.String("database", dbname)
	}
)

Functions

func DBOpener

func DBOpener(opts ...func(*DBOpenerConfig)) sql.DBOpener

func DBOpenerWithMetricsCallback added in v0.0.9

func DBOpenerWithMetricsCallback(opts ...func(*DBOpenerConfig)) func(string, *stdsql.DB) error

func DBOpenerWithTracer added in v0.0.9

func DBOpenerWithTracer(opts ...func(*DBOpenerConfig)) sql.DBOpener

func WithOtelSqlOptBuilder added in v0.0.10

func WithOtelSqlOptBuilder(b func(dsn string) []otelsql.Option) func(*DBOpenerConfig)

Types

type DBOpenerConfig added in v0.0.10

type DBOpenerConfig struct {
	DBOpenerOptBuilder func(string) []otelsql.Option
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL