You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: connection.go
    path of file: ./repos/slashbase/pkg/queryengines/mysqlqueryengine
    
    the code of the file until where you have to start completion: package mysqlqueryengine

import (
	"database/sql"
	"fmt"
	"strconv"
	"time"

	_ "github.com/go-sql-driver/mysql"
	"github.com/slashbaseide/slashbase/pkg/queryengines/utils"
)

type mysqlInstance struct {
	mysqlInstance *sql.DB
	LastUsed      time.Time
}

func (myEngine *MysqlQueryEngine) getConnection(dbConnectionId, host string, port uint16, database, user, password string) (c *sql.DB, err error) {
	if conn, exists := myEngine.openConnections[dbConnectionId]; exists {
		myEngine.mutex.Lock()
		myEngine.openConnections[dbConnectionId] = mysqlInstance{
			mysqlInstance: conn.mysqlInstance,
			LastUsed:      time.Now(),
		}
		myEngine.mutex.Unlock()
		return conn.mysqlInstance, nil
	}
	err = utils.CheckTcpConnection(host, strconv.Itoa(int(port)))
	i
    
func (myEngine *MysqlQueryEngine) getConnection(dbConnectionId, host string, port uint16, database, user, password string) (c *sql.DB, err error) {
	if conn, exists := myEngine.openConnections[dbConnectionId]; exists {
		myEngine.mutex.Lock()
		myEngine.openConnections[dbConnectionId] = mysqlInstance{
			mysqlInstance: conn.mysqlInstance,
			LastUsed:      time.Now(),
		}
		myEngine.mutex.Unlock()
		return conn.mysqlInstance, nil
	}
	err = utils.CheckTcpConnection(host, strconv.Itoa(int(port)))
	if err != nil {
		return
	}
	connString := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?parseTime=true", user, password, host, strconv.Itoa(int(port)), database)
	db, err := sql.Open("mysql", connString)
	if err != nil {
		return nil, err
	}
	if dbConnectionId != "" {
		myEngine.mutex.Lock()
		myEngine.openConnections[dbConnectionId] = mysqlInstance{
			mysqlInstance: db,
			LastUsed:      time.Now(),
		}
		myEngine.mutex.Unlock()
	}
	return db, err
}