Skip to content

Commit

Permalink
Doc gen update
Browse files Browse the repository at this point in the history
  • Loading branch information
Twipped committed Sep 2, 2014
1 parent 7be98d6 commit 7815647
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ <h3>Usage:</h3>
debugEnabled: false,
database: false,
tableName: false,
tableAlias: false,
alias: false,
dataBindings: {},
useBoundParameters: queryize.useBoundParameters,
where: [],
Expand Down Expand Up @@ -891,15 +891,6 @@ <h3>Usage:</h3>
if (value === false) return 'FALSE';
if (value === null) return 'NULL';

if (typeof value === 'object') {
// if we've got a date, convert it into a mysql ready datestamp
if (value instanceof Date) {
value = value.toISOString().slice(0, 19).replace('T', ' ');
} else {
throw new TypeError('Received unparsable object as field value.');
}
}

var key = '{{' + _uniqueId('binding') + '}}';

this.insertBinding(key, value);
Expand Down Expand Up @@ -1135,7 +1126,7 @@ <h3>Usage:</h3>
<pre class="panel-body prettyprint"><code class="language-javascript">query.insert = function insert () {
this._attributes.builder = 'insert';
if (arguments.length) {
this.set(arrayFromArguments.apply(null, arguments));
this.set.apply(this, arguments);
}
return this;
};</code></pre>
Expand Down Expand Up @@ -1394,8 +1385,7 @@ <h3>Usage:</h3>
return self.createBinding(column.data, column.modifier);
}

console.log(column);
throw new TypeError('Unknown column type');
throw new TypeError('Unknown column type: ' + JSON.stringify(column));
});

this._attributes.columns = args;
Expand Down Expand Up @@ -1647,9 +1637,9 @@ <h3>Usage:</h3>
clause = flatten(clause).map(function (c) {
switch (typeof c) {
case 'string': return c;
case 'object': return self._processWhereObject(clause, operator, modifier);
case 'object': return self._processWhereObject(c, operator, modifier);
default:
throw new TypeError('Where clause could not be processed. Found ' + (typeof clause) + ' instead.');
throw new TypeError('Where clause could not be processed. Found ' + (typeof c) + ' instead.');
}
});

Expand All @@ -1661,8 +1651,13 @@ <h3>Usage:</h3>
if (clause[0] === 'AND') {
subBoolean = 'AND';
clause.shift();
l--;
}
if (l === 1) {
clause = clause[0];
} else {
clause = '(' + clause.join(subBoolean) + ')';
}
clause = '(' + clause.join(subBoolean) + ')';
} else {
clause = null;
}
Expand Down Expand Up @@ -2308,7 +2303,7 @@ <h3>Usage:</h3>
</div>
<div class="panel-collapse collapse">
<pre class="panel-body prettyprint"><code class="language-javascript">query.distinct = function distinct (enable) {
this._attributes.distinct = isDefined(enable) ? true : enable;
this._attributes.distinct = isDefined(enable) ? enable : true;
return this;
};</code></pre>
</div>
Expand Down Expand Up @@ -2357,10 +2352,18 @@ <h3>Usage:</h3>
</div>
<div class="panel-collapse collapse">
<pre class="panel-body prettyprint"><code class="language-javascript">query.limit = function limit (max, offset) {
if (isDefined(max)) max = 0;
if (isDefined(offset)) offset = 0;
if (!isDefined(max)) max = 0;
if (!isDefined(offset)) offset = 0;

this._attributes.limit = max ? ['LIMIT ',Number(offset), ', ', Number(max)].join() : false;
if (max) {
if (offset) {
this._attributes.limit = 'LIMIT ' + Number(offset) + ', ' + Number(max);
} else {
this._attributes.limit = 'LIMIT ' + Number(max);
}
} else {
this._attributes.limit = false;
}

return this;
};</code></pre>
Expand Down

0 comments on commit 7815647

Please sign in to comment.