database

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 11 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Read  IDatabaseRead
	Write IDatabaseWrite
}

func NewDatabaseReadAndWrite

func NewDatabaseReadAndWrite(config databaseConfig.IConfig) (*Connection, error)

type IDatabaseRead

type IDatabaseRead interface {
	IsAvailable() bool
	FindPreload(entityPointer interface{}, where map[string]interface{}, preloads map[string][]interface{},
		table string) response.IResponse
	Find(entityPointer interface{}, where map[string]interface{}, table string) response.IResponse
	First(entityPointer interface{}, where map[string]interface{}, table string) response.IResponse
	Raw(rawSQL string, entityPointer interface{}, values ...interface{}) response.IResponse
}

type IDatabaseWrite

type IDatabaseWrite interface {
	StartTransaction() IDatabaseWrite
	RollbackTransaction() response.IResponse
	CommitTransaction() response.IResponse
	IsAvailable() bool
	Create(entityPointer interface{}, table string) response.IResponse
	CreateOrUpdate(entityPointer interface{}, where map[string]interface{}, table string) response.IResponse
	Update(entityPointer interface{}, where map[string]interface{}, table string) response.IResponse
	Delete(where map[string]interface{}, table string) response.IResponse
}

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) CommitTransaction

func (m *Mock) CommitTransaction() response.IResponse

func (*Mock) Create

func (m *Mock) Create(_ interface{}, _ string) response.IResponse

func (*Mock) CreateOrUpdate

func (m *Mock) CreateOrUpdate(_ interface{}, _ map[string]interface{}, _ string) response.IResponse

func (*Mock) Delete

func (m *Mock) Delete(_ map[string]interface{}, _ string) response.IResponse

func (*Mock) Find

func (m *Mock) Find(_ interface{}, _ map[string]interface{}, _ string) response.IResponse

func (*Mock) FindPreload

func (m *Mock) FindPreload(_ interface{}, _ map[string]interface{}, _ map[string][]interface{}, _ string) response.IResponse

func (*Mock) First

func (m *Mock) First(_ interface{}, _ map[string]interface{}, _ string) response.IResponse

func (*Mock) IsAvailable

func (m *Mock) IsAvailable() bool

func (*Mock) Raw

func (m *Mock) Raw(_ string, _ interface{}, _ ...interface{}) response.IResponse

func (*Mock) RollbackTransaction

func (m *Mock) RollbackTransaction() response.IResponse

func (*Mock) StartTransaction

func (m *Mock) StartTransaction() IDatabaseWrite

func (*Mock) Update

func (m *Mock) Update(_ interface{}, _ map[string]interface{}, _ string) response.IResponse

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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