Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseConnections ¶
func CloseConnections()
CloseConnections close all connections with database
func OpenConnections ¶
OpenConnections open connections with database
func OpenConnectionsForTests ¶
func OpenConnectionsForTests() (mock sqlmock.Sqlmock, err error)
OpenConnectionsForTests opens connections to the mocked database
Types ¶
type Transaction ¶
type Transaction struct { Builder squirrel.StatementBuilderType // contains filtered or unexported fields }
Transaction used to aggregate transactions
func NewTransaction ¶
func NewTransaction(ctx context.Context, readOnly bool) (*Transaction, error)
NewTransaction uses a transaction from a connection already opened in the database
func (*Transaction) Commit ¶
func (t *Transaction) Commit() (erro error)
Commit confirm pending transactions for all open databases
func (*Transaction) Execute ¶
Execute executes a query that doesn't return rows, typically an INSERT/UPDATE/DELETE.
func (*Transaction) Rollback ¶
func (t *Transaction) Rollback()
Rollback close all pending transaction for all open databases
Click to show internal directories.
Click to hide internal directories.