Help us shape the future of Go! Take the 2026 Go Developer Survey

database

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

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
	FindPreloadWitLimitAndPage(entityPointer interface{}, where map[string]interface{},
		preloads map[string][]interface{}, table string, limit, page int) 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
	Exec(rawQuery string, values ...interface{}) error
}

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) Exec

func (m *Mock) Exec(_ string, _ ...interface{}) error

func (*Mock) Find

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

func (*Mock) FindPreload

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

func (*Mock) FindPreloadWitLimitAndPage

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

func (*Mock) First

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

func (*Mock) IsAvailable

func (m *Mock) IsAvailable() bool

func (*Mock) Raw

func (m *Mock) Raw(_ string, entityPointer 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