Documentation
¶
Index ¶
- func GetSqlError(err error) error
- func ManageUpdateError(callerName string, result sql.Result, err error) error
- type Connection
- type DbPool
- type EnhacedTx
- func (v *EnhacedTx) Commit() error
- func (v *EnhacedTx) Exec(query string, args ...any) (sql.Result, error)
- func (v *EnhacedTx) ForceClose() error
- func (v *EnhacedTx) IsActive() bool
- func (v *EnhacedTx) Query(query string, args ...any) (*sql.Rows, error)
- func (v *EnhacedTx) QueryRow(query string, args ...any) *sql.Row
- func (v *EnhacedTx) Rollback() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSqlError ¶
func ManageUpdateError ¶
Manages the possible error coming for an update execution and returns the database error if exists. If not, it checks if any row has been affected and returns err if nothing has been updated.
params 'callerName' is the name of the caller function, it is used in log message 'result' is the sql.Result returned by Exec function 'err' is the error returned by Exec function
Types ¶
type Connection ¶ added in v0.1.4
type DbPool ¶
type DbPool struct {
// contains filtered or unexported fields
}
func CreateDbPool ¶
CreateDbPool creates the DB connections pool. time out must be in seconds
func (*DbPool) BeginEnhacedTx ¶
Returns a new Enhaced Improved Transaction
type EnhacedTx ¶
type EnhacedTx struct {
// contains filtered or unexported fields
}
func (*EnhacedTx) Exec ¶
Exec executes a query that doesn't return rows. For example: an INSERT and UPDATE.
func (*EnhacedTx) ForceClose ¶
ForceClose closes and aborts the transaction
Click to show internal directories.
Click to hide internal directories.