Documentation ¶
Index ¶
- type Database
- type DbRow
- type DbRows
- type MyDB
- func (m *MyDB) BeginTransaction() Transaction
- func (m *MyDB) Close() bool
- func (m *MyDB) Connect() bool
- func (m *MyDB) Delete(query string, args ...any) bool
- func (m *MyDB) Get(query string, args ...any) *DbRow
- func (m *MyDB) GetList(query string, args ...any) *DbRows
- func (m *MyDB) Insert(query string, args ...any) (bool, int64)
- func (m *MyDB) New() Database
- func (m *MyDB) Test(query string, args ...any) *DbRow
- func (m *MyDB) Update(query string, args ...any) bool
- type MyDBMock
- func (m *MyDBMock) BeginTransaction() Transaction
- func (m *MyDBMock) Close() bool
- func (m *MyDBMock) Connect() bool
- func (m *MyDBMock) Delete(query string, args ...any) bool
- func (m *MyDBMock) Get(query string, args ...any) *DbRow
- func (m *MyDBMock) GetList(query string, args ...any) *DbRows
- func (m *MyDBMock) GetNewDatabase() Database
- func (m *MyDBMock) Insert(query string, args ...any) (bool, int64)
- func (m *MyDBMock) New() Database
- func (m *MyDBMock) Test(query string, args ...any) *DbRow
- func (m *MyDBMock) Update(query string, args ...any) bool
- type MyDbTx
- type MyDbTxMock
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { Connect() bool BeginTransaction() Transaction Test(query string, args ...any) *DbRow Insert(query string, args ...any) (bool, int64) Update(query string, args ...any) bool Get(query string, args ...any) *DbRow GetList(query string, args ...any) *DbRows Delete(query string, args ...any) bool Close() bool }
Database Database
type MyDB ¶
type MyDB struct { Host string User string Password string Database string // contains filtered or unexported fields }
MyDB MyDB
func (*MyDB) BeginTransaction ¶
func (m *MyDB) BeginTransaction() Transaction
BeginTransaction BeginTransaction
type MyDBMock ¶
type MyDBMock struct { Host string User string Password string Database string MockConnectSuccess bool MockCloseSuccess bool MockCommitSuccess bool MockRollbackSuccess bool MockInsertSuccess1 bool MockInsertSuccess2 bool MockInsertSuccess3 bool MockInsertSuccess4 bool MockInsertSuccess5 bool MockInsertSuccess6 bool MockInsertSuccess7 bool MockInsertSuccess8 bool MockInsertID1 int64 MockInsertID2 int64 MockInsertID3 int64 MockInsertID4 int64 MockInsertID5 int64 MockInsertID6 int64 MockInsertID7 int64 MockInsertID8 int64 MockUpdateSuccess1 bool MockUpdateSuccess2 bool MockUpdateSuccess3 bool MockUpdateSuccess4 bool MockDeleteSuccess1 bool MockDeleteSuccess2 bool MockDeleteSuccess3 bool MockDeleteSuccess4 bool MockDeleteSuccess5 bool MockDeleteSuccess6 bool MockDeleteSuccess7 bool MockDeleteSuccess8 bool MockTestRow *DbRow MockRow1 *DbRow MockRow2 *DbRow MockRow3 *DbRow MockRow4 *DbRow MockRow5 *DbRow MockRow6 *DbRow MockRow7 *DbRow MockRow8 *DbRow MockRows1 *DbRows MockRows2 *DbRows MockRows3 *DbRows MockRows4 *DbRows MockRows5 *DbRows MockRows6 *DbRows MockRows7 *DbRows MockRows8 *DbRows // contains filtered or unexported fields }
MyDBMock MyDBMock
func (*MyDBMock) BeginTransaction ¶
func (m *MyDBMock) BeginTransaction() Transaction
BeginTransaction BeginTransaction
func (*MyDBMock) GetNewDatabase ¶
GetNewDatabase GetNewDatabase
type MyDbTxMock ¶
MyDbTxMock MyDbTxMock
func (*MyDbTxMock) Delete ¶
func (t *MyDbTxMock) Delete(query string, args ...any) bool
Delete Delete
Click to show internal directories.
Click to hide internal directories.