2016-01-26 19:29:12 -05:00
|
|
|
/**
|
|
|
|
* Class for objects containing the query builder state
|
|
|
|
* @private
|
|
|
|
*/
|
|
|
|
class State {
|
2016-09-14 16:50:32 -04:00
|
|
|
constructor () {
|
2015-12-03 20:43:42 -05:00
|
|
|
// Arrays/maps
|
|
|
|
this.queryMap = [];
|
|
|
|
this.values = [];
|
|
|
|
this.whereValues = [];
|
|
|
|
this.setArrayKeys = [];
|
|
|
|
this.orderArray = [];
|
|
|
|
this.groupArray = [];
|
|
|
|
this.havingMap = [];
|
|
|
|
this.whereMap = [];
|
|
|
|
this.rawWhereValues = [];
|
2015-12-02 13:01:31 -05:00
|
|
|
|
2015-12-03 20:43:42 -05:00
|
|
|
// Partials
|
|
|
|
this.selectString = '';
|
|
|
|
this.fromString = '';
|
|
|
|
this.setString = '';
|
|
|
|
this.orderString = '';
|
|
|
|
this.groupString = '';
|
2015-12-02 13:01:31 -05:00
|
|
|
|
2015-12-03 20:43:42 -05:00
|
|
|
// Other various values
|
|
|
|
this.limit = null;
|
|
|
|
this.offset = null;
|
|
|
|
}
|
2016-01-26 19:29:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = State;
|