db

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ErrCodeUniqueViolation = 1062

Variables

This section is empty.

Functions

func IsUniqueViolation

func IsUniqueViolation(err error) bool

func Module

func Module() fx.Option

Types

type DefaultPagination

type DefaultPagination interface {
	DefaultLimit() int
	MaxLimit() int
}

type Pagination

type Pagination[T DefaultPagination] struct {
	// contains filtered or unexported fields
}

func NewPagination

func NewPagination[T DefaultPagination](limit, offset int) *Pagination[T]

func (*Pagination[T]) Apply

func (p *Pagination[T]) Apply(query *bun.SelectQuery) *bun.SelectQuery

func (*Pagination[T]) Limit

func (p *Pagination[T]) Limit() int

func (*Pagination[T]) Offset

func (p *Pagination[T]) Offset() int

type TimedModel

type TimedModel struct {
	CreatedAt time.Time `bun:",nullzero,notnull" json:"created_at"`
	UpdatedAt time.Time `bun:",nullzero,notnull" json:"updated_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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