// Code generated by mockery v1.1.2. DO NOT EDIT.

package mock

import (
	context "context"
	driver "database/sql/driver"

	mock "github.com/stretchr/testify/mock"

	record "github.com/appist/appy/record"

	sql "database/sql"

	time "time"
)

// DB is an autogenerated mock type for the DBer type
type DB struct {
	mock.Mock
}

// Begin provides a mock function with given fields:
func (_m *DB) Begin() (record.Txer, error) {
	ret := _m.Called()

	var r0 record.Txer
	if rf, ok := ret.Get(0).(func() record.Txer); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(record.Txer)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// BeginContext provides a mock function with given fields: ctx, opts
func (_m *DB) BeginContext(ctx context.Context, opts *sql.TxOptions) (record.Txer, error) {
	ret := _m.Called(ctx, opts)

	var r0 record.Txer
	if rf, ok := ret.Get(0).(func(context.Context, *sql.TxOptions) record.Txer); ok {
		r0 = rf(ctx, opts)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(record.Txer)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, *sql.TxOptions) error); ok {
		r1 = rf(ctx, opts)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Close provides a mock function with given fields:
func (_m *DB) Close() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Config provides a mock function with given fields:
func (_m *DB) Config() *record.Config {
	ret := _m.Called()

	var r0 *record.Config
	if rf, ok := ret.Get(0).(func() *record.Config); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Config)
		}
	}

	return r0
}

// Conn provides a mock function with given fields: ctx
func (_m *DB) Conn(ctx context.Context) (*sql.Conn, error) {
	ret := _m.Called(ctx)

	var r0 *sql.Conn
	if rf, ok := ret.Get(0).(func(context.Context) *sql.Conn); ok {
		r0 = rf(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*sql.Conn)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = rf(ctx)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Connect provides a mock function with given fields:
func (_m *DB) Connect() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// ConnectDefaultDB provides a mock function with given fields:
func (_m *DB) ConnectDefaultDB() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// CreateDB provides a mock function with given fields: database
func (_m *DB) CreateDB(database string) error {
	ret := _m.Called(database)

	var r0 error
	if rf, ok := ret.Get(0).(func(string) error); ok {
		r0 = rf(database)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Driver provides a mock function with given fields:
func (_m *DB) Driver() driver.Driver {
	ret := _m.Called()

	var r0 driver.Driver
	if rf, ok := ret.Get(0).(func() driver.Driver); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(driver.Driver)
		}
	}

	return r0
}

// DriverName provides a mock function with given fields:
func (_m *DB) DriverName() string {
	ret := _m.Called()

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// DropDB provides a mock function with given fields: database
func (_m *DB) DropDB(database string) error {
	ret := _m.Called(database)

	var r0 error
	if rf, ok := ret.Get(0).(func(string) error); ok {
		r0 = rf(database)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// DumpSchema provides a mock function with given fields: database
func (_m *DB) DumpSchema(database string) error {
	ret := _m.Called(database)

	var r0 error
	if rf, ok := ret.Get(0).(func(string) error); ok {
		r0 = rf(database)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Exec provides a mock function with given fields: query, args
func (_m *DB) Exec(query string, args ...interface{}) (sql.Result, error) {
	var _ca []interface{}
	_ca = append(_ca, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 sql.Result
	if rf, ok := ret.Get(0).(func(string, ...interface{}) sql.Result); ok {
		r0 = rf(query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(sql.Result)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string, ...interface{}) error); ok {
		r1 = rf(query, args...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ExecContext provides a mock function with given fields: ctx, query, args
func (_m *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
	var _ca []interface{}
	_ca = append(_ca, ctx, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 sql.Result
	if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) sql.Result); ok {
		r0 = rf(ctx, query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(sql.Result)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok {
		r1 = rf(ctx, query, args...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GenerateMigration provides a mock function with given fields: name, target, tx
func (_m *DB) GenerateMigration(name string, target string, tx bool) error {
	ret := _m.Called(name, target, tx)

	var r0 error
	if rf, ok := ret.Get(0).(func(string, string, bool) error); ok {
		r0 = rf(name, target, tx)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Get provides a mock function with given fields: dest, query, args
func (_m *DB) Get(dest interface{}, query string, args ...interface{}) error {
	var _ca []interface{}
	_ca = append(_ca, dest, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 error
	if rf, ok := ret.Get(0).(func(interface{}, string, ...interface{}) error); ok {
		r0 = rf(dest, query, args...)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// GetContext provides a mock function with given fields: ctx, dest, query, args
func (_m *DB) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
	var _ca []interface{}
	_ca = append(_ca, ctx, dest, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, interface{}, string, ...interface{}) error); ok {
		r0 = rf(ctx, dest, query, args...)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Migrate provides a mock function with given fields:
func (_m *DB) Migrate() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// MigrateStatus provides a mock function with given fields:
func (_m *DB) MigrateStatus() ([][]string, error) {
	ret := _m.Called()

	var r0 [][]string
	if rf, ok := ret.Get(0).(func() [][]string); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([][]string)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// NamedExec provides a mock function with given fields: query, arg
func (_m *DB) NamedExec(query string, arg interface{}) (sql.Result, error) {
	ret := _m.Called(query, arg)

	var r0 sql.Result
	if rf, ok := ret.Get(0).(func(string, interface{}) sql.Result); ok {
		r0 = rf(query, arg)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(sql.Result)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string, interface{}) error); ok {
		r1 = rf(query, arg)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// NamedExecContext provides a mock function with given fields: ctx, query, arg
func (_m *DB) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) {
	ret := _m.Called(ctx, query, arg)

	var r0 sql.Result
	if rf, ok := ret.Get(0).(func(context.Context, string, interface{}) sql.Result); ok {
		r0 = rf(ctx, query, arg)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(sql.Result)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string, interface{}) error); ok {
		r1 = rf(ctx, query, arg)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// NamedQuery provides a mock function with given fields: query, arg
func (_m *DB) NamedQuery(query string, arg interface{}) (*record.Rows, error) {
	ret := _m.Called(query, arg)

	var r0 *record.Rows
	if rf, ok := ret.Get(0).(func(string, interface{}) *record.Rows); ok {
		r0 = rf(query, arg)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Rows)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string, interface{}) error); ok {
		r1 = rf(query, arg)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// NamedQueryContext provides a mock function with given fields: ctx, query, arg
func (_m *DB) NamedQueryContext(ctx context.Context, query string, arg interface{}) (*record.Rows, error) {
	ret := _m.Called(ctx, query, arg)

	var r0 *record.Rows
	if rf, ok := ret.Get(0).(func(context.Context, string, interface{}) *record.Rows); ok {
		r0 = rf(ctx, query, arg)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Rows)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string, interface{}) error); ok {
		r1 = rf(ctx, query, arg)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Ping provides a mock function with given fields:
func (_m *DB) Ping() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// PingContext provides a mock function with given fields: ctx
func (_m *DB) PingContext(ctx context.Context) error {
	ret := _m.Called(ctx)

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
		r0 = rf(ctx)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Prepare provides a mock function with given fields: query
func (_m *DB) Prepare(query string) (*record.Stmt, error) {
	ret := _m.Called(query)

	var r0 *record.Stmt
	if rf, ok := ret.Get(0).(func(string) *record.Stmt); ok {
		r0 = rf(query)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Stmt)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// PrepareContext provides a mock function with given fields: ctx, query
func (_m *DB) PrepareContext(ctx context.Context, query string) (*record.Stmt, error) {
	ret := _m.Called(ctx, query)

	var r0 *record.Stmt
	if rf, ok := ret.Get(0).(func(context.Context, string) *record.Stmt); ok {
		r0 = rf(ctx, query)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Stmt)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = rf(ctx, query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// PrepareNamed provides a mock function with given fields: query
func (_m *DB) PrepareNamed(query string) (*record.NamedStmt, error) {
	ret := _m.Called(query)

	var r0 *record.NamedStmt
	if rf, ok := ret.Get(0).(func(string) *record.NamedStmt); ok {
		r0 = rf(query)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.NamedStmt)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// PrepareNamedContext provides a mock function with given fields: ctx, query
func (_m *DB) PrepareNamedContext(ctx context.Context, query string) (*record.NamedStmt, error) {
	ret := _m.Called(ctx, query)

	var r0 *record.NamedStmt
	if rf, ok := ret.Get(0).(func(context.Context, string) *record.NamedStmt); ok {
		r0 = rf(ctx, query)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.NamedStmt)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = rf(ctx, query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Query provides a mock function with given fields: query, args
func (_m *DB) Query(query string, args ...interface{}) (*record.Rows, error) {
	var _ca []interface{}
	_ca = append(_ca, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 *record.Rows
	if rf, ok := ret.Get(0).(func(string, ...interface{}) *record.Rows); ok {
		r0 = rf(query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Rows)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string, ...interface{}) error); ok {
		r1 = rf(query, args...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// QueryContext provides a mock function with given fields: ctx, query, args
func (_m *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*record.Rows, error) {
	var _ca []interface{}
	_ca = append(_ca, ctx, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 *record.Rows
	if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) *record.Rows); ok {
		r0 = rf(ctx, query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Rows)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok {
		r1 = rf(ctx, query, args...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// QueryRow provides a mock function with given fields: query, args
func (_m *DB) QueryRow(query string, args ...interface{}) *record.Row {
	var _ca []interface{}
	_ca = append(_ca, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 *record.Row
	if rf, ok := ret.Get(0).(func(string, ...interface{}) *record.Row); ok {
		r0 = rf(query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Row)
		}
	}

	return r0
}

// QueryRowContext provides a mock function with given fields: ctx, query, args
func (_m *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *record.Row {
	var _ca []interface{}
	_ca = append(_ca, ctx, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 *record.Row
	if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) *record.Row); ok {
		r0 = rf(ctx, query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*record.Row)
		}
	}

	return r0
}

// Rebind provides a mock function with given fields: query
func (_m *DB) Rebind(query string) string {
	ret := _m.Called(query)

	var r0 string
	if rf, ok := ret.Get(0).(func(string) string); ok {
		r0 = rf(query)
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// RegisterMigration provides a mock function with given fields: up, down, args
func (_m *DB) RegisterMigration(up func(record.DBer) error, down func(record.DBer) error, args ...string) error {
	_va := make([]interface{}, len(args))
	for _i := range args {
		_va[_i] = args[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, up, down)
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

	var r0 error
	if rf, ok := ret.Get(0).(func(func(record.DBer) error, func(record.DBer) error, ...string) error); ok {
		r0 = rf(up, down, args...)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// RegisterMigrationTx provides a mock function with given fields: upTx, downTx, args
func (_m *DB) RegisterMigrationTx(upTx func(record.Txer) error, downTx func(record.Txer) error, args ...string) error {
	_va := make([]interface{}, len(args))
	for _i := range args {
		_va[_i] = args[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, upTx, downTx)
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

	var r0 error
	if rf, ok := ret.Get(0).(func(func(record.Txer) error, func(record.Txer) error, ...string) error); ok {
		r0 = rf(upTx, downTx, args...)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// RegisterSeedTx provides a mock function with given fields: seed
func (_m *DB) RegisterSeedTx(seed func(record.Txer) error) {
	_m.Called(seed)
}

// Rollback provides a mock function with given fields:
func (_m *DB) Rollback() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Schema provides a mock function with given fields:
func (_m *DB) Schema() string {
	ret := _m.Called()

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// Seed provides a mock function with given fields:
func (_m *DB) Seed() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Select provides a mock function with given fields: dest, query, args
func (_m *DB) Select(dest interface{}, query string, args ...interface{}) error {
	var _ca []interface{}
	_ca = append(_ca, dest, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 error
	if rf, ok := ret.Get(0).(func(interface{}, string, ...interface{}) error); ok {
		r0 = rf(dest, query, args...)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// SelectContext provides a mock function with given fields: ctx, dest, query, args
func (_m *DB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
	var _ca []interface{}
	_ca = append(_ca, ctx, dest, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, interface{}, string, ...interface{}) error); ok {
		r0 = rf(ctx, dest, query, args...)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// SetConnMaxLifetime provides a mock function with given fields: d
func (_m *DB) SetConnMaxLifetime(d time.Duration) {
	_m.Called(d)
}

// SetMaxIdleConns provides a mock function with given fields: n
func (_m *DB) SetMaxIdleConns(n int) {
	_m.Called(n)
}

// SetMaxOpenConns provides a mock function with given fields: n
func (_m *DB) SetMaxOpenConns(n int) {
	_m.Called(n)
}

// SetSchema provides a mock function with given fields: schema
func (_m *DB) SetSchema(schema string) {
	_m.Called(schema)
}

// Stats provides a mock function with given fields:
func (_m *DB) Stats() sql.DBStats {
	ret := _m.Called()

	var r0 sql.DBStats
	if rf, ok := ret.Get(0).(func() sql.DBStats); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(sql.DBStats)
	}

	return r0
}
