func (p *MySQL) unlock(ctx context.Context) error {
	if !p.isLocked {
		return nil
	}

	aid, err := lock.Generate(p.DatabaseName, p.EventStoreTable)
	if err != nil {
		return err
	}

	query := `SELECT RELEASE_LOCK(?)`
	if _, err := p.conn.ExecContext(ctx, query, aid); err != nil {
		return err
	}

	p.isLocked = false

	return nil
}
// Unlock is the implementation of the unlock for explicit locking
Unlock is the implementation of the unlock for explicit locking
// Unlock is the implementation of the unlock for explicit locking
func (p *MySQL) unlock(ctx context.Context) error {
	if !p.isLocked {
		return nil
	}
	aid, err := lock.Generate(p.DatabaseName, p.EventStoreTable)
	if err != nil {
		return err
	}
	query := `SELECT RELEASE_LOCK(?)`
	if _, err := p.conn.ExecContext(ctx, query, aid); err != nil {
		return err
	}
	p.isLocked = false
	return nil
}
func ( p * MySQL ) unlock ( ctx context . Context ) error { if ! p . isLocked { return nil } aid , err := lock . Generate ( p . DatabaseName , p . EventStoreTable ) if err != nil { return err } query := `SELECT RELEASE_LOCK(?)` if _ , err := p . conn . ExecContext ( ctx , query , aid ) ; err != nil { return err } p . isLocked = false return nil }
Unlock is the implementation of the unlock for explicit locking
Unlock is the implementation of the unlock for explicit locking