Files
db-postgres/component.go
T

21 lines
618 B
Go
Raw Normal View History

package postgres
import (
"code.nochebuena.dev/einherjar/contracts/lifecycle"
"code.nochebuena.dev/einherjar/contracts/observability"
"github.com/jackc/pgx/v5/pgxpool"
)
// Component bundles the full postgres capability: lifecycle management,
// health reporting, and the database [Provider] interface.
// Register with launcher and health before starting.
type Component interface {
lifecycle.Component
observability.Checkable
observability.Identifiable
Provider
// Stats returns connection pool statistics. Returns a zero-value stat
// when the pool has not been initialized yet.
Stats() *pgxpool.Stat
}