Documentation
¶
Overview ¶
Package postgres provides the PostgreSQL-backed implementation of the audit.Repository port, built on pgx.
It is ported from go-licencias' audit_postgres.go rather than go-crucible's or go-bluprint's: go-licencias' List runs a single query using count(*) OVER() to get the total alongside the page of results, instead of the two round trips (one COUNT(*), one SELECT) the other two systems each issue; and go-licencias types the resource-ID filter as *uuid.UUID instead of a bare string, so an invalid ID is rejected by the caller's own parsing instead of silently matching zero rows deep inside a query.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository implements audit.Repository using pgxpool.
func NewRepository ¶
func NewRepository(pool *pgxpool.Pool) *Repository
NewRepository creates a new PostgreSQL-backed audit repository.
func (*Repository) Create ¶
Create inserts an audit entry using the given db (either a live pgx.Tx or the pool itself — see vogel/pgxtx.DBTX).