Documentation ¶ Index ¶ type CRUD func NewCrud[T any, I any](scan func(row pgx.CollectableRow) (T, error), pool *pgxpool.Pool, ...) *CRUD[T, I] func (c CRUD[T, I]) Add(attr ...any) I func (c CRUD[T, I]) Delete(attr ...any) int64 func (c CRUD[T, I]) GetById(id I) (T, error) func (c CRUD[T, I]) GetByIds(id []uint64) ([]T, error) func (c CRUD[T, I]) Update(attr ...any) int64 type Config type Storage func New(cfg Config) *Storage func (s *Storage) Close() error func (s *Storage) Get() *pgxpool.Pool Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type CRUD ¶ type CRUD[T any, I any] struct { // contains filtered or unexported fields } func NewCrud ¶ func NewCrud[T any, I any](scan func(row pgx.CollectableRow) (T, error), pool *pgxpool.Pool, sel, selIds, ins, upd, del string) *CRUD[T, I] func (CRUD[T, I]) Add ¶ func (c CRUD[T, I]) Add(attr ...any) I func (CRUD[T, I]) Delete ¶ func (c CRUD[T, I]) Delete(attr ...any) int64 func (CRUD[T, I]) GetById ¶ func (c CRUD[T, I]) GetById(id I) (T, error) func (CRUD[T, I]) GetByIds ¶ func (c CRUD[T, I]) GetByIds(id []uint64) ([]T, error) func (CRUD[T, I]) Update ¶ func (c CRUD[T, I]) Update(attr ...any) int64 type Config ¶ type Config interface { Get(string) string } type Storage ¶ type Storage struct { // contains filtered or unexported fields } func New ¶ func New(cfg Config) *Storage func (*Storage) Close ¶ func (s *Storage) Close() error func (*Storage) Get ¶ func (s *Storage) Get() *pgxpool.Pool Source Files ¶ View all Source files crud.gopg.go Directories ¶ Show internal Expand all Path Synopsis bucket control data point token Click to show internal directories. Click to hide internal directories.