Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BulkInsert ¶
func BulkInsert[T Table](executor gorp.SqlExecutor, db DB, allObjs ...T) error
Bulk insert objects into the database, using an executor which can be a transaction or a database connection itself.
Note: This function does NOT support auto-incrementing primary keys.
func ReplaceAll ¶
Replace all old objects of a table with new objects.
Types ¶
type Connector ¶
Kubernetes connector which initializes the database connection from a secret.
func (Connector) FromSecretRef ¶
Create a new database client with authentication from the provided secret reference.
type DB ¶
Wrapper around gorp.DbMap that adds some convenience functions.
func (*DB) CreateTable ¶
Adds missing functionality to gorp.DbMap which creates one table.
func (*DB) SelectTimed ¶
Executes a select query while monitoring its execution time.
func (*DB) TableExists ¶
Check if a table exists in the database.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func NewDBMonitor ¶
func NewDBMonitor(registry *monitoring.Registry) Monitor
func NewUnregisteredDBMonitor ¶
func NewUnregisteredDBMonitor() Monitor
func (*Monitor) Collect ¶
func (m *Monitor) Collect(ch chan<- prometheus.Metric)
func (*Monitor) Describe ¶
func (m *Monitor) Describe(ch chan<- *prometheus.Desc)
Click to show internal directories.
Click to hide internal directories.