ForbesLindesay / sync-mysql

Make synchronous queries to a mysql database
MIT License
29 stars 8 forks source link

The example in the README file is not working. #1

Closed krmit closed 7 years ago

krmit commented 7 years ago

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);
ForbesLindesay commented 7 years ago

I think this should now be fixed.