The example in the README file will throw an error:
TypeError: Expected args to be strings
at Connection.query (/home/krm/dev/sync-mysql-test/node_modules/sync-mysql/lib/index.js:63:15)
However the code below will work:
var MySql = require('sync-mysql');
var assert = require('assert');
var connection = new MySql({
host: 'localhost',
user: 'me',
password: 'secret'
});
const result = connection.query('SELECT 1 + 1 AS solution', []);
assert(result[0].solution==2);
The example in the README file will throw an error:
However the code below will work: