mirror of
https://github.com/knex/knex.git
synced 2025-12-28 15:38:41 +00:00
code consistency
This commit is contained in:
parent
2f6a42dd5e
commit
7f4cc4e287
@ -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 ')
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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 = {};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user