ClickHouse/docker/test/integration/mysql_js_client/test.js
Ilya Yatsishin e6420c82ca
mysql/postgresql: move Dockerfiles and docker_compose to docker/test (#13448)
* mysql/postgresql: move Dockerfiles and docker_compose to docker/test
* Build client containers in CI
* pass tag to docker_compose
2020-08-12 18:04:36 +03:00

22 lines
550 B
JavaScript

var mysql = require('mysql');
var connection = mysql.createConnection({
host : process.argv[2],
port : process.argv[3],
user : process.argv[4],
password : process.argv[5],
database : 'system',
});
connection.connect();
connection.query('SELECT 1 + 1 AS solution', function (error, results, fields) {
if (error) throw error;
if (results[0].solution.toString() !== '2') {
throw Error('Wrong result of a query. Expected: "2", received: ' + results[0].solution + '.')
}
});
connection.end();