code consistency

This commit is contained in:
Tim Griesser 2014-04-27 19:36:40 -04:00
parent 2f6a42dd5e
commit 7f4cc4e287
4 changed files with 8 additions and 8 deletions

View File

@ -16,10 +16,10 @@ var orderBys = ['asc', 'desc'];
// parameterize values within a query, keeping track of all bindings
// added to the query. This allows us to easily keep track of raw statements
// arbitrarily added to queries.
var Formatter = function() {
function Formatter() {
this.bindings = [];
this.errors = [];
};
}
// Turns a list of values into a list of ?'s, joining them with commas unless
// a "joining" value is specified (e.g. ' and ')

View File

@ -8,14 +8,14 @@ var Raw = require('../raw');
// The "QueryCompiler" takes all of the query statements which have been
// gathered in the "QueryBuilder" and turns them into a properly formatted / bound
// query string.
var QueryCompiler = function(queryBuilder) {
function QueryCompiler(queryBuilder) {
this.method = queryBuilder._method || 'select';
this.options = queryBuilder._options;
this.single = queryBuilder._single;
this.transacting = queryBuilder._transacting;
this.grouped = _.groupBy(queryBuilder._statements, 'grouping');
this.tableName = this.single.table ? this.formatter.wrap(this.single.table) : '';
};
}
// Collapse the builder into a single object
QueryCompiler.prototype.toSQL = function(method) {

View File

@ -3,11 +3,11 @@
// The "JoinClause" is an object holding any necessary info about a join,
// including the type, and any associated tables & columns being joined.
var JoinClause = function(table, type) {
function JoinClause(table, type) {
this.table = table;
this.joinType = type;
this.clauses = [];
};
}
JoinClause.prototype.grouping = 'join';

View File

@ -10,7 +10,7 @@ var columnAlias = {
};
// The chainable interface off the original "column" method.
var ColumnBuilder = function(tableBuilder, type, args) {
function ColumnBuilder(tableBuilder, type, args) {
this._single = {};
this._modifiers = {};
this._statements = [];
@ -23,7 +23,7 @@ var ColumnBuilder = function(tableBuilder, type, args) {
if (tableBuilder._method === 'alter') {
_.extend(this, AlterMethods);
}
};
}
var AlterMethods = {};