forked from martintajur/node-mysql-activerecord
-
Notifications
You must be signed in to change notification settings - Fork 19
Upgrade from 1.x to 2.x
Kyle Farris edited this page Jun 11, 2018
·
2 revisions
NOTE This is coming soon... I'm writing this upgrade doc as I'm developing version 2 so that you can prepare.
With the upgrade from version 1 to version 2, we have some breaking changes that will require you to update your code. The changes are fairly minor:
With the change to ES6 class syntax, I've changed the instantiation syntax of the module:
const qb = require('node-querybuilder').QueryBuilder(settings, 'mysql', 'single');
const QueryBuilder = require('node-querybuilder');
const qb = new QueryBuilder(settings, 'mysql', 'single');
// OR Just...
const qb = new require('node-querybuilder')(settings, 'mysql', 'single');
It's not a huge change, but, definitely one that will need to be made in order for your code to work using v2.