Documentation ¶
Overview ¶
Package fsql provides database/sql utilities.
Index ¶
- type DB
- func (db *DB) Close() error
- func (c DB) Collect(ch chan<- prometheus.Metric)
- func (c DB) Describe(ch chan<- *prometheus.Desc)
- func (db *DB) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (db *DB) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (db *DB) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps *database/sql.DB with tracing, metrics, logging, and resource tracking.
func WrapDB ¶
WrapDB creates a new DB.
Name is used for metric label values, etc. Logger (that will be named) is used for query logging.
func (DB) Collect ¶
func (c DB) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (DB) Describe ¶
func (c DB) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
func (*DB) ExecContext ¶
ExecContext implements sqlDB.
func (*DB) QueryContext ¶
QueryContext implements sqlDB.
Click to show internal directories.
Click to hide internal directories.