db

package
v0.0.0-...-970f38b Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

func GetRepository(dbase dbx.DBx, logger app.Logger, entity string) (repo IRepository, err error)

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

BatchCreateTx saves a batch of a new entities in the database.

func (MigrationRepository) BatchUpdateTx

BatchUpdateTx updates records of a batch entities in the database.

func (MigrationRepository) BeginTx

BeginTx begins a transaction

func (MigrationRepository) ExecFunc

func (r MigrationRepository) ExecFunc(ctx context.Context, f migration.Func) (returnErr error)

ExecFunc executes a function

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

ExecSQLTx executes a SQL code

func (MigrationRepository) Last

Last retrieves a last record with the specified query condition and limit 1 from the database.

func (MigrationRepository) LastTx

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

Jump to

Keyboard shortcuts

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