Git Product home page Git Product logo

Comments (6)

dr-coton avatar dr-coton commented on June 26, 2024 1

I connected with Mysql and it worked fine when I changed the password.

from slashbase.

dr-coton avatar dr-coton commented on June 26, 2024 1

PR : #129

from slashbase.

paraswaykole avatar paraswaykole commented on June 26, 2024

Thanks @dr-coton! Can you tell what type of database connection are you using?

from slashbase.

dr-coton avatar dr-coton commented on June 26, 2024

@paraswaykole
I've done a bunch of tests and it doesn't seem to be the problem I mentioned above.
I created mysql, mariadb, etc with docker and when I tried to connect to them, I got an error.
When I tested both Desktop and Web, there seems to be a lot of mysql errors.
I'll fork the project as much as I can and see where the issue is coming from.

from slashbase.

paraswaykole avatar paraswaykole commented on June 26, 2024

Thanks @dr-coton! Please add new issues if you find new bugs / errors in MySQL.

from slashbase.

dr-coton avatar dr-coton commented on June 26, 2024

@paraswaykole

I found the cause.

In the file pkg/queryengines/mysqlqueryengine/queryengine.go, an error occurred in MySQL TestConnection.

I don't know the exact reason, but it doesn't work while comparing the test variable with 1.

Since the role of the function in MySQL TestConnection is to test the connection, I changed the code to check for the presence or absence of a value rather than validating the exact value.

AS-IS

func (mqe *MysqlQueryEngine) TestConnection(dbConn *models.DBConnection, config *models.QueryConfig) error {
	query := "SELECT 1 AS test;"
	data, err := mqe.RunQuery(dbConn, query, config)
	if err != nil {
		return err
	}
	test := data["rows"].([]map[string]interface{})[0]["0"].(int64)
	if test == 1 {
		return nil
	}
	return errors.New("connection test failed")
}

TO-BE

func (mqe *MysqlQueryEngine) TestConnection(dbConn *models.DBConnection, config *models.QueryConfig) error {
	query := "SELECT 1 AS test;"
	data, err := mqe.RunQuery(dbConn, query, config)
	if err != nil {
		return err
	}
	rows := data["rows"].([]map[string]interface{})
	if len(rows) != 0 {
		return nil
	}
	return errors.New("connection test failed")
}

Thanks

from slashbase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.