diff --git a/lib/formatter.js b/lib/formatter.js index 450346b15..c81f55709 100644 --- a/lib/formatter.js +++ b/lib/formatter.js @@ -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 ') diff --git a/lib/query/compiler.js b/lib/query/compiler.js index d2508d1e6..fcccae5cf 100644 --- a/lib/query/compiler.js +++ b/lib/query/compiler.js @@ -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) { diff --git a/lib/query/joinclause.js b/lib/query/joinclause.js index ecb704e60..ba822d2ae 100644 --- a/lib/query/joinclause.js +++ b/lib/query/joinclause.js @@ -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'; diff --git a/lib/schema/columnbuilder.js b/lib/schema/columnbuilder.js index 3e4feb40f..1bb4440ad 100644 --- a/lib/schema/columnbuilder.js +++ b/lib/schema/columnbuilder.js @@ -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 = {};