Documentation
¶
Index ¶
- type PgxBeginner
- type PostgresError
- type SelectBuilder
- type Table
- func (t *Table[T]) Count(ctx context.Context, builder ...SelectBuilder) (uint64, error)
- func (t *Table[T]) Find(ctx context.Context, where ...SelectBuilder) (*T, error)
- func (t *Table[T]) FindAll(ctx context.Context, builder ...SelectBuilder) ([]T, error)
- func (t *Table[T]) Insert(ctx context.Context, data []*T, returning ...bool) ([]T, error)
- func (t *Table[T]) InsertOne(ctx context.Context, record *T, returning ...bool) (*T, error)
- func (t *Table[T]) Update(ctx context.Context, record any, builder UpdateBuilder, returning ...bool) ([]T, error)
- type Transactor
- type UpdateBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PgxBeginner ¶
type PostgresError ¶
func AsPostgresError ¶
func AsPostgresError(err error) *PostgresError
func (*PostgresError) IsUniqueViolation ¶
func (pe *PostgresError) IsUniqueViolation(col ...string) bool
type SelectBuilder ¶
type SelectBuilder = func(sb *sqlbuilder.SelectBuilder)
type Table ¶
type Table[T any] struct { Name string Txer *Transactor Log *slog.Logger RowTo pgx.RowToFunc[T] // contains filtered or unexported fields }
func (*Table[T]) Find ¶
func (t *Table[T]) Find(ctx context.Context, where ...SelectBuilder) (*T, error)
func (*Table[T]) FindAll ¶
func (t *Table[T]) FindAll(ctx context.Context, builder ...SelectBuilder) ([]T, error)
type Transactor ¶
type Transactor = gotx.Transactor[pgx.Tx]
func NewTransactor ¶
func NewTransactor(pool *pgxpool.Pool) *Transactor
type UpdateBuilder ¶
type UpdateBuilder = func(ub *sqlbuilder.UpdateBuilder)
Click to show internal directories.
Click to hide internal directories.