{"size": 1082, "ext": "js", "max_stars_repo_path": "app/classes/MySQL.js", "max_stars_repo_name": "Bizarrus/MySQL-Connector", "max_stars_repo_stars_event_min_datetime": "2018-01-09T11:20:06.000Z", "max_stars_repo_stars_event_max_datetime": "2018-01-09T11:20:06.000Z", "max_issues_repo_path": "app/classes/MySQL.js", "max_issues_repo_name": "Bizarrus/MySQL-Connector", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/classes/MySQL.js", "max_forks_repo_name": "Bizarrus/MySQL-Connector", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.5909090909, "max_line_length": 100, "alphanum_fraction": 0.6913123845}
const MySQL = (new function MySQL() {
	let _server = {
		tunnel:		null,
		hostname:	'localhost',
		port:		3306,
		username:	'root',
		password:	null,
		database:	null
	};
	
	this.setConnection = function setConnection(tunnel, hostname, port, username, password, database) {
		_server.tunnel		= tunnel;
		_server.hostname	= hostname;
		_server.port		= port;
		_server.username	= username;
		_server.password	= password;
		_server.database	= database;
	};
	
	this.call = function call(data, callback) {
		KnuddelsServer.getExternalServerAccess().postURL(_server.tunnel, {
			data: data,
			onSuccess: function onSuccess(responseData, externalServerResponse) {
				callback(responseData);
			},
			onFailure: function(responseData, externalServerResponse) {
				callback(responseData);
			}
		});
	};
	
	this.query = function query(statement, callback) {
		this.call({
			action:		'query',
			hostname:	_server.hostname,
			port:		_server.port,
			username:	_server.username,
			password:	_server.password,
			database:	_server.database,
			query:		statement
		}, callback);
	};
}());
