Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecInsertOrUpdate ¶
func ExecInsertOrUpdate( ctx context.Context, tx *sql.Tx, query string, args ...interface{}, ) (bool, error)
ExecInsertOrUpdate executes a MySQL "INSERT ... ON DUPLICATE KEY UPDATE" query, and returns true if it results in an insert.
func ExecSingleRow ¶
ExecSingleRow executes a query without returning any rows and verifies that exactly one row was affected.
For an UPDATE query, this means that the query must actually alter the row, not simply match one row.
The args are for any placeholder parameters in the query. It returns an error if more than one row was affected.
func IsDeadlock ¶
IsDeadlock returns true if err represents a MySQL deadlock condition.
func IsDuplicateEntry ¶
IsDuplicateEntry returns true if err represents a MySQL duplicate entry error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.