Documentation
¶
Index ¶
- type CockDbMock
- func (c *CockDbMock) BeginTransaction() Transaction
- func (c *CockDbMock) Close() bool
- func (c *CockDbMock) Connect() bool
- func (c *CockDbMock) Delete(query string, args ...any) bool
- func (c *CockDbMock) Exec(query string) (bool, error)
- func (c *CockDbMock) Get(query string, args ...any) *DbRow
- func (c *CockDbMock) GetList(query string, args ...any) *DbRows
- func (c *CockDbMock) Insert(query string, args ...any) (bool, int64)
- func (c *CockDbMock) New() Database
- func (c *CockDbMock) Test(query string, args ...any) *DbRow
- func (c *CockDbMock) Update(query string, args ...any) bool
- type CockDbTx
- type CockDbTxMock
- type CockRDB
- func (c *CockRDB) BeginTransaction() Transaction
- func (c *CockRDB) Close() bool
- func (c *CockRDB) Connect() bool
- func (c *CockRDB) Delete(query string, args ...any) bool
- func (c *CockRDB) Exec(query string) (bool, error)
- func (c *CockRDB) Get(query string, args ...any) *DbRow
- func (c *CockRDB) GetList(query string, args ...any) *DbRows
- func (c *CockRDB) Insert(query string, args ...any) (bool, int64)
- func (c *CockRDB) New() Database
- func (c *CockRDB) Test(query string, args ...any) *DbRow
- func (c *CockRDB) Update(query string, args ...any) bool
- type Database
- type DbRow
- type DbRows
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CockDbMock ¶
type CockDbMock struct {
Host string
User string
Password string
Database string
Port string
Sslmode string
Sslrootcert 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
MockExecSuccess bool
MockExecError error
// contains filtered or unexported fields
}
func (*CockDbMock) BeginTransaction ¶
func (c *CockDbMock) BeginTransaction() Transaction
BeginTransaction BeginTransaction
func (*CockDbMock) Delete ¶
func (c *CockDbMock) Delete(query string, args ...any) bool
Delete Delete
func (*CockDbMock) GetList ¶
func (c *CockDbMock) GetList(query string, args ...any) *DbRows
GetList GetList
type CockDbTxMock ¶
type CockDbTxMock struct {
Tx *sql.Tx
CockDbMock *CockDbMock
}
CockDbTxMock CockDbTxMock
func (*CockDbTxMock) Delete ¶
func (t *CockDbTxMock) Delete(query string, args ...any) bool
Delete Delete
type CockRDB ¶ added in v1.0.4
type CockRDB struct {
Host string
User string
Password string
Database string
Port string
Sslmode string
Sslrootcert string
// contains filtered or unexported fields
}
CockDB CockDB
func (*CockRDB) BeginTransaction ¶ added in v1.0.4
func (c *CockRDB) BeginTransaction() Transaction
BeginTransaction BeginTransaction
func (*CockRDB) Insert ¶ added in v1.0.4
Insert Insert requires use of RETURNING id on end of insert query
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
Exec(query string) (bool, error)
Close() bool
}
Database Database
Click to show internal directories.
Click to hide internal directories.