database

package
v0.0.0-...-a9a6b3f Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Conn   *sql.DB
	Logger *logging.Logger
}

DB wraps the SQL database object and logger

func Initialize

func Initialize(url string, logger *logging.Logger) (*DB, error)

Initialize creates a database connection and registers Prometheus metrics

func (*DB) Close

func (db *DB) Close() error

Close closes the database connection

func (*DB) PerformQuery

func (db *DB) PerformQuery(query string) error

PerformQuery executes a query and updates Prometheus metrics

Jump to

Keyboard shortcuts

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