Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
package mysql
import (
"testing"
mysqldriver "github.com/go-sql-driver/mysql"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
)
func TestIsRetryableTransactionError(t *testing.T) {
db := &DB{}
require.True(t, db.IsRetryableTransactionError(errors.Wrap(&mysqldriver.MySQLError{Number: 1213}, "commit failed")))
require.True(t, db.IsRetryableTransactionError(&mysqldriver.MySQLError{Number: 1205}))
require.False(t, db.IsRetryableTransactionError(&mysqldriver.MySQLError{Number: 1062}))
}