Documentation ¶
Index ¶
- type CreateModelI
- type GetModelI
- type ListModelI
- type ListParams
- type ModelStore
- func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Create(ctx context.Context, m CreateModel) error
- func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) CreateIfNotExist(ctx context.Context, m UpdateCreateModelI) error
- func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Delete(ctx context.Context, m UpdateModel) error
- func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Get(ctx context.Context, m GetModelI) (bool, error)
- func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) List(ctx context.Context, params ListParams) ([]ListModel, int64, error)
- func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Update(ctx context.Context, m UpdateModel) error
- func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) UpdateOrCreate(ctx context.Context, m UpdateCreateModelI) error
- type UpdateCreateModelI
- type UpdateModelI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateModelI ¶
type ListModelI ¶
type ListParams ¶
type ModelStore ¶
type ModelStore[ListModel ListModelI, GetModel GetModelI, CreateModel CreateModelI, UpdateModel UpdateModelI] struct { Con *pgxpool.Pool QB squirrel.StatementBuilderType TableName string ListModelConstructor func() ListModel }
func (*ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Create ¶
func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Create(ctx context.Context, m CreateModel) error
func (*ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) CreateIfNotExist ¶ added in v1.4.0
func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) CreateIfNotExist(ctx context.Context, m UpdateCreateModelI) error
func (*ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Delete ¶
func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Delete(ctx context.Context, m UpdateModel) error
func (*ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) List ¶
func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) List(ctx context.Context, params ListParams) ([]ListModel, int64, error)
func (*ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Update ¶
func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) Update(ctx context.Context, m UpdateModel) error
func (*ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) UpdateOrCreate ¶ added in v1.4.0
func (s *ModelStore[ListModel, GetModel, CreateModel, UpdateModel]) UpdateOrCreate(ctx context.Context, m UpdateCreateModelI) error
type UpdateCreateModelI ¶ added in v1.4.0
type UpdateCreateModelI interface { UpdateModelI CreateModelI }
Click to show internal directories.
Click to hide internal directories.