Documentation ¶
Index ¶
- Constants
- type IRepository
- type MigrationRepository
- func (r MigrationRepository) BatchCreateTx(ctx context.Context, t migration.Transaction, list migration.LogsList) error
- func (r MigrationRepository) BatchUpdateTx(ctx context.Context, t migration.Transaction, list migration.LogsList) error
- func (r MigrationRepository) BeginTx(ctx context.Context) (migration.Transaction, error)
- func (r MigrationRepository) ExecFunc(ctx context.Context, f migration.Func) (returnErr error)
- func (r MigrationRepository) ExecFuncTx(ctx context.Context, t migration.Transaction, f migration.Func) (returnErr error)
- func (r MigrationRepository) ExecSQL(ctx context.Context, sql string) error
- func (r MigrationRepository) ExecSQLTx(ctx context.Context, t migration.Transaction, sql string) error
- func (r MigrationRepository) Last(ctx context.Context, query *migration.QueryCondition) (*migration.Log, error)
- func (r MigrationRepository) LastTx(ctx context.Context, t migration.Transaction, query *migration.QueryCondition) (*migration.Log, error)
- func (r MigrationRepository) Query(ctx context.Context, offset, limit uint) ([]migration.Log, error)
- func (r MigrationRepository) QueryTx(ctx context.Context, t migration.Transaction, query *migration.QueryCondition, ...) ([]migration.Log, error)
- func (r MigrationRepository) SetLogger(logger app.Logger)
Constants ¶
const MaxLIstLimit = 1000
MaxLIstLimit const
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IRepository ¶
type IRepository interface { SetLogger(logger app.Logger) Query(ctx context.Context, offset, limit uint) ([]migration.Log, error) }
IRepository is an interface of repository
func GetRepository ¶
GetRepository return a repository
type MigrationRepository ¶
type MigrationRepository struct {
// contains filtered or unexported fields
}
MigrationRepository is a repository for the migration entity
func NewMigrationRepository ¶
func NewMigrationRepository(repository *repository) (*MigrationRepository, error)
NewMigrationRepository creates a new Repository
func (MigrationRepository) BatchCreateTx ¶
func (r MigrationRepository) BatchCreateTx(ctx context.Context, t migration.Transaction, list migration.LogsList) error
BatchCreateTx saves a batch of a new entities in the database.
func (MigrationRepository) BatchUpdateTx ¶
func (r MigrationRepository) BatchUpdateTx(ctx context.Context, t migration.Transaction, list migration.LogsList) error
BatchUpdateTx updates records of a batch entities in the database.
func (MigrationRepository) BeginTx ¶
func (r MigrationRepository) BeginTx(ctx context.Context) (migration.Transaction, error)
BeginTx begins a transaction
func (MigrationRepository) ExecFuncTx ¶
func (r MigrationRepository) ExecFuncTx(ctx context.Context, t migration.Transaction, f migration.Func) (returnErr error)
ExecFuncTx executes a function
func (MigrationRepository) ExecSQL ¶
func (r MigrationRepository) ExecSQL(ctx context.Context, sql string) error
ExecSQL executes a SQL code
func (MigrationRepository) ExecSQLTx ¶
func (r MigrationRepository) ExecSQLTx(ctx context.Context, t migration.Transaction, sql string) error
ExecSQLTx executes a SQL code
func (MigrationRepository) Last ¶
func (r MigrationRepository) Last(ctx context.Context, query *migration.QueryCondition) (*migration.Log, error)
Last retrieves a last record with the specified query condition and limit 1 from the database.
func (MigrationRepository) LastTx ¶
func (r MigrationRepository) LastTx(ctx context.Context, t migration.Transaction, query *migration.QueryCondition) (*migration.Log, error)
LastTx retrieves a last record with the specified query condition and limit 1 from the database.
func (MigrationRepository) Query ¶
func (r MigrationRepository) Query(ctx context.Context, offset, limit uint) ([]migration.Log, error)
Query retrieves records with the specified offset and limit from the database.
func (MigrationRepository) QueryTx ¶
func (r MigrationRepository) QueryTx(ctx context.Context, t migration.Transaction, query *migration.QueryCondition, offset, limit uint) ([]migration.Log, error)
QueryTx retrieves records with the specified offset and limit from the database.
func (MigrationRepository) SetLogger ¶
func (r MigrationRepository) SetLogger(logger app.Logger)
SetLogger is setter for logger