# README
apmsql
Package apmsql provides a wrapper for database/sql/driver.Drivers for tracing database operations as spans of a transaction traced by Elastic APM.
To instrument a driver, you can simply swap your application's calls to sql.Register and sql.Open to apmsql.Register and apmsql.Open respectively. The apmsql.Register function accepts zero or more options to influence how tracing is performed.
# Packages
Package apmmysql registers the "mysql" driver with apmsql, so that you can trace go-sql-driver/mysql database connections.
Package apmpgxv4 registers the "postgres" driver with apmsql, so that you can trace pgx/v4 database connections.
Package apmpq registers the "postgres" driver with apmsql, so that you can trace lib/pq database connections.
Package apmsqlite3 registers the "sqlite3" driver with apmsql, so that you can trace sqlite3 database connections.
Package apmsqlserver registers the "sqlserver" driver with apmsql, so that you can trace microsoft/go-mssqldb database connections.
# Functions
DriverDSNParser returns the DSNParserFunc for the registered driver.
Open opens a database with the given driver and data source names, as in sql.Open.
QuerySignature returns the "signature" for a query: a high level description of the operation.
Register registers a traced version of the given driver.
WithDriverName returns a WrapOption which sets the underlying driver name to the specified value.
WithDSNParser returns a WrapOption which sets the function to use for parsing the data source name.
Wrap wraps a database/sql/driver.Driver such that the driver's database methods are traced.
# Constants
DriverPrefix should be used as a driver name prefix when registering via sql.Register.
# Type aliases
DSNParserFunc is the type of a function that can be used for parsing a data source name, and returning the corresponding Info.
WrapOption is an option that can be supplied to Wrap.