Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTooManyAffectedRows returned when store modifes too many rows. ErrTooManyAffectedRows = errors.New("too many affected rows") )
View Source
var ErrUserNotFound = errors.New("user not found")
View Source
var UserFields = dal.UserColumns
Functions ¶
Types ¶
type BaseQuery ¶
type BaseQuery[M any] interface { // Count all rows matching query. Count(ctx context.Context) (int, error) // Get all rows matching query. All(ctx context.Context) ([]*M, error) // Get first row matching query. One(ctx context.Context) (*M, error) // Delete all rows matching query. Delete(ctx context.Context) error }
type MigratorFactory ¶
type MigratorFactory interface {
Migrator() Migrator
}
MigratorFactory define method for migrations of store
type Store ¶
type Store interface { StoreFactory StoreTx MigratorFactory }
Store define generic interface for database with transaction support
type StoreFactory ¶
type StoreFactory interface {
User() User
}
StoreFactory define interface of factory methods
type StoreTx ¶
type StoreTx interface { // TxFactory returns function for create transaction scopes. Tx(ctx context.Context, txFunc TxFunc) error }
StoreTx define interface of transactional of store.
Click to show internal directories.
Click to hide internal directories.