mysql

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: MIT Imports: 4 Imported by: 6

README

Go Report Card

Database Interface MySQL module

This is a mockable database interface for MySQL build on the DbInterface project.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyDB

type MyDB struct {
	Host     string
	User     string
	Password string
	Database string
	// contains filtered or unexported fields
}

MyDB MyDB

func (*MyDB) BeginTransaction added in v1.0.3

func (m *MyDB) BeginTransaction() di.Transaction

BeginTransaction BeginTransaction

func (*MyDB) Close

func (m *MyDB) Close() bool

Close Close

func (*MyDB) Connect

func (m *MyDB) Connect() bool

Connect Connect

func (*MyDB) Delete

func (m *MyDB) Delete(query string, args ...interface{}) bool

Delete Delete

func (*MyDB) Get

func (m *MyDB) Get(query string, args ...interface{}) *di.DbRow

Get Get

func (*MyDB) GetList

func (m *MyDB) GetList(query string, args ...interface{}) *di.DbRows

GetList GetList

func (*MyDB) Insert

func (m *MyDB) Insert(query string, args ...interface{}) (bool, int64)

Insert Insert

func (*MyDB) Test

func (m *MyDB) Test(query string, args ...interface{}) *di.DbRow

Test Test

func (*MyDB) Update

func (m *MyDB) Update(query string, args ...interface{}) bool

Update Update

type MyDBMock

type MyDBMock struct {
	Host     string
	User     string
	Password string
	Database string

	MockSuccess bool
	MockID      int64
	MockRow     *di.DbRow
	MockRows    *di.DbRows
	// contains filtered or unexported fields
}

MyDBMock MyDBMock

func (*MyDBMock) BeginTransaction added in v1.0.3

func (m *MyDBMock) BeginTransaction() di.Transaction

BeginTransaction BeginTransaction

func (*MyDBMock) Close

func (m *MyDBMock) Close() bool

Close Close

func (*MyDBMock) Connect

func (m *MyDBMock) Connect() bool

Connect Connect

func (*MyDBMock) Delete

func (m *MyDBMock) Delete(query string, args ...interface{}) bool

Delete Delete

func (*MyDBMock) Get

func (m *MyDBMock) Get(query string, args ...interface{}) *di.DbRow

Get Get

func (*MyDBMock) GetList

func (m *MyDBMock) GetList(query string, args ...interface{}) *di.DbRows

GetList GetList

func (*MyDBMock) Insert

func (m *MyDBMock) Insert(query string, args ...interface{}) (bool, int64)

Insert Insert

func (*MyDBMock) Test

func (m *MyDBMock) Test(query string, args ...interface{}) *di.DbRow

Test Test

func (*MyDBMock) Update

func (m *MyDBMock) Update(query string, args ...interface{}) bool

Update Update

type MyDbTx added in v1.0.3

type MyDbTx struct {
	Tx *sql.Tx
}

MyDbTx MyDbTx

func (*MyDbTx) Commit added in v1.0.3

func (t *MyDbTx) Commit() bool

Commit Commit

func (*MyDbTx) Delete added in v1.0.3

func (t *MyDbTx) Delete(query string, args ...interface{}) bool

Delete Delete

func (*MyDbTx) Insert added in v1.0.3

func (t *MyDbTx) Insert(query string, args ...interface{}) (bool, int64)

Insert Insert

func (*MyDbTx) Rollback added in v1.0.3

func (t *MyDbTx) Rollback() bool

Rollback Rollback

func (*MyDbTx) Update added in v1.0.3

func (t *MyDbTx) Update(query string, args ...interface{}) bool

Update Update

type MyDbTxMock added in v1.0.3

type MyDbTxMock struct {
	Tx *sql.Tx
	//MockSuccess bool
	//MockID      int64
	MyDBMock *MyDBMock
}

MyDbTxMock MyDbTxMock

func (*MyDbTxMock) Commit added in v1.0.3

func (t *MyDbTxMock) Commit() bool

Commit Commit

func (*MyDbTxMock) Delete added in v1.0.3

func (t *MyDbTxMock) Delete(query string, args ...interface{}) bool

Delete Delete

func (*MyDbTxMock) Insert added in v1.0.3

func (t *MyDbTxMock) Insert(query string, args ...interface{}) (bool, int64)

Insert Insert

func (*MyDbTxMock) Rollback added in v1.0.3

func (t *MyDbTxMock) Rollback() bool

Rollback Rollback

func (*MyDbTxMock) Update added in v1.0.3

func (t *MyDbTxMock) Update(query string, args ...interface{}) bool

Update Update

Jump to

Keyboard shortcuts

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