update docs for new methods

This commit is contained in:
Timothy Warren 2014-11-18 13:41:32 -05:00
parent 5f8c4ad9b0
commit 5f974da5d9
14 changed files with 663 additions and 71 deletions

View File

@ -110,7 +110,7 @@ module.exports = {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -252,7 +252,7 @@ module.exports = d;</pre>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -161,12 +161,6 @@ var h = {
for(i=0; i&lt; l; i++) for(i=0; i&lt; l; i++)
{ {
// Recurse for nested arrays
if (Array.isArray(arr[i]))
{
return h.regexInArray(arr[i], pattern);
}
// Short circuit if any items match // Short circuit if any items match
if (pattern.test(arr[i])) return true; if (pattern.test(arr[i])) return true;
} }
@ -219,7 +213,7 @@ module.exports = h;</pre>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -148,7 +148,7 @@ query.select('foo')
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -354,7 +354,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -170,7 +170,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -190,7 +190,7 @@ function name, eg isNumber</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="helpers.js.html">helpers.js</a>, <a href="helpers.js.html">helpers.js</a>,
<a href="helpers.js.html#sunlight-1-line-106">line 106</a> <a href="helpers.js.html#sunlight-1-line-100">line 100</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -1027,7 +1027,7 @@ in the passed array</p>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -457,7 +457,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -383,7 +383,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-826">line 826</a> <a href="query-builder.js.html#sunlight-1-line-880">line 880</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -519,7 +519,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-406">line 406</a> <a href="query-builder.js.html#sunlight-1-line-416">line 416</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -764,7 +764,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-748">line 748</a> <a href="query-builder.js.html#sunlight-1-line-802">line 802</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -955,7 +955,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-888">line 888</a> <a href="query-builder.js.html#sunlight-1-line-942">line 942</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -1154,7 +1154,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-866">line 866</a> <a href="query-builder.js.html#sunlight-1-line-920">line 920</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -1355,7 +1355,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-849">line 849</a> <a href="query-builder.js.html#sunlight-1-line-903">line 903</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -1546,7 +1546,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-877">line 877</a> <a href="query-builder.js.html#sunlight-1-line-931">line 931</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -1641,7 +1641,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-353">line 353</a> <a href="query-builder.js.html#sunlight-1-line-363">line 363</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -1788,7 +1788,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-630">line 630</a> <a href="query-builder.js.html#sunlight-1-line-684">line 684</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -1875,7 +1875,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-729">line 729</a> <a href="query-builder.js.html#sunlight-1-line-783">line 783</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -1962,7 +1962,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-693">line 693</a> <a href="query-builder.js.html#sunlight-1-line-747">line 747</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -2147,7 +2147,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-479">line 479</a> <a href="query-builder.js.html#sunlight-1-line-489">line 489</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -2357,7 +2357,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-771">line 771</a> <a href="query-builder.js.html#sunlight-1-line-825">line 825</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -2539,7 +2539,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-791">line 791</a> <a href="query-builder.js.html#sunlight-1-line-845">line 845</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -2771,7 +2771,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-605">line 605</a> <a href="query-builder.js.html#sunlight-1-line-659">line 659</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -2997,7 +2997,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-428">line 428</a> <a href="query-builder.js.html#sunlight-1-line-438">line 438</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -3176,7 +3176,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-681">line 681</a> <a href="query-builder.js.html#sunlight-1-line-735">line 735</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -3402,7 +3402,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-441">line 441</a> <a href="query-builder.js.html#sunlight-1-line-451">line 451</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -3593,7 +3593,7 @@
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-653">line 653</a> <a href="query-builder.js.html#sunlight-1-line-707">line 707</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -3681,7 +3681,7 @@ prefixed with 'OR'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-706">line 706</a> <a href="query-builder.js.html#sunlight-1-line-760">line 760</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -3866,7 +3866,7 @@ prefixed with 'OR'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-493">line 493</a> <a href="query-builder.js.html#sunlight-1-line-503">line 503</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -4092,7 +4092,7 @@ prefixed with 'OR'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-454">line 454</a> <a href="query-builder.js.html#sunlight-1-line-464">line 464</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -4180,7 +4180,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-718">line 718</a> <a href="query-builder.js.html#sunlight-1-line-772">line 772</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -4406,7 +4406,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-467">line 467</a> <a href="query-builder.js.html#sunlight-1-line-477">line 477</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -4591,7 +4591,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-519">line 519</a> <a href="query-builder.js.html#sunlight-1-line-529">line 529</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -4750,7 +4750,279 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-543">line 543</a> <a href="query-builder.js.html#sunlight-1-line-597">line 597</a>
</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>this</p>
</div>
</dd>
<dt>
<h4 class="name" id="orWhereIsNotNull"><span class="type-signature"></span>orWhereIsNotNull<span class="signature">(field)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Field is not null prefixed with 'OR'</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>field</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-573">line 573</a>
</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>this</p>
</div>
</dd>
<dt>
<h4 class="name" id="orWhereIsNull"><span class="type-signature"></span>orWhereIsNull<span class="signature">(field)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Field is null prefixed with 'OR'</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>field</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-562">line 562</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -4909,7 +5181,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-567">line 567</a> <a href="query-builder.js.html#sunlight-1-line-621">line 621</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -5048,7 +5320,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-372">line 372</a> <a href="query-builder.js.html#sunlight-1-line-382">line 382</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -5230,7 +5502,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-579">line 579</a> <a href="query-builder.js.html#sunlight-1-line-633">line 633</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -5440,7 +5712,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-807">line 807</a> <a href="query-builder.js.html#sunlight-1-line-861">line 861</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -5625,7 +5897,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-507">line 507</a> <a href="query-builder.js.html#sunlight-1-line-517">line 517</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -5784,7 +6056,279 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-531">line 531</a> <a href="query-builder.js.html#sunlight-1-line-585">line 585</a>
</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>this</p>
</div>
</dd>
<dt>
<h4 class="name" id="whereIsNotNull"><span class="type-signature"></span>whereIsNotNull<span class="signature">(field)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Specify that a field IS NOT NULL</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>field</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-551">line 551</a>
</li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>this</p>
</div>
</dd>
<dt>
<h4 class="name" id="whereIsNull"><span class="type-signature"></span>whereIsNull<span class="signature">(field)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Select a field that is Null</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>field</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>The name of the field that has a NULL value</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-540">line 540</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -5943,7 +6487,7 @@ prefixed with 'OR NOT'</p>
<ul class="dummy"> <ul class="dummy">
<li> <li>
<a href="query-builder.js.html">query-builder.js</a>, <a href="query-builder.js.html">query-builder.js</a>,
<a href="query-builder.js.html#sunlight-1-line-555">line 555</a> <a href="query-builder.js.html#sunlight-1-line-609">line 609</a>
</li> </li>
</ul> </ul>
</dd> </dd>
@ -6007,7 +6551,7 @@ prefixed with 'OR NOT'</p>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -466,7 +466,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -158,7 +158,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -149,7 +149,7 @@ module.exports = new NodeQuery();</pre>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -262,6 +262,25 @@ var QueryBuilder = function(driver, adapter) {
_p.mixedSet('whereMap', 'both', args.key, args.val); _p.mixedSet('whereMap', 'both', args.key, args.val);
_p.mixedSet('whereValues', 'value', args.key, args.val); _p.mixedSet('whereValues', 'value', args.key, args.val);
}, },
fixConjunction: function(conj) {
var lastItem = state.queryMap[state.queryMap.length - 1];
var conjunctionList = helpers.arrayPluck(state.queryMap, 'conjunction');
if (state.queryMap.length === 0 || ( ! helpers.regexInArray(conjunctionList, /^ ?WHERE/i)))
{
conj = " WHERE ";
}
else if (lastItem.type === 'groupStart')
{
conj = '';
}
else
{
conj = ' ' + conj + ' ';
}
return conj;
},
where: function(key, val, defaultConj) { where: function(key, val, defaultConj) {
// Normalize key and value and insert into state.whereMap // Normalize key and value and insert into state.whereMap
_p.whereMixedSet(key, val); _p.whereMixedSet(key, val);
@ -276,24 +295,8 @@ var QueryBuilder = function(driver, adapter) {
// Simple key value, or an operator? // Simple key value, or an operator?
item += (fieldArray.length === 1 || fieldArray[1] === '') ? '=?' : " " + fieldArray[1] + " ?"; item += (fieldArray.length === 1 || fieldArray[1] === '') ? '=?' : " " + fieldArray[1] + " ?";
var firstItem = state.queryMap[0],
lastItem = state.queryMap[state.queryMap.length - 1];
// Determine the correct conjunction // Determine the correct conjunction
var conjunctionList = helpers.arrayPluck(state.queryMap, 'conjunction'); var conj = _p.fixConjunction(defaultConj);
var conj = defaultConj;
if (state.queryMap.length === 0 || ( ! helpers.regexInArray(conjunctionList, /^ ?WHERE/i)))
{
conj = " WHERE ";
}
else if (lastItem.type === 'groupStart')
{
conj = '';
}
else
{
conj = ' ' + conj + ' ';
}
_p.appendMap(conj, item, 'where'); _p.appendMap(conj, item, 'where');
@ -301,6 +304,13 @@ var QueryBuilder = function(driver, adapter) {
state.whereMap = {}; state.whereMap = {};
}); });
}, },
whereNull: function(field, stmt, conj) {
conj = conj || 'AND';
field = driver.quoteIdentifiers(field);
var item = field + ' ' + stmt;
_p.appendMap(_p.fixConjunction(conj), item, 'whereNull');
},
having: function(/*key, val, conj*/) { having: function(/*key, val, conj*/) {
var args = getArgs('key:string|object, [val]:string|number, [conj]:string', arguments); var args = getArgs('key:string|object, [val]:string|number, [conj]:string', arguments);
args.conj = args.conj || 'AND'; args.conj = args.conj || 'AND';
@ -596,6 +606,50 @@ var QueryBuilder = function(driver, adapter) {
return this; return this;
}; };
/**
* Select a field that is Null
*
* @param {String} field - The name of the field that has a NULL value
* @return this
*/
this.whereIsNull = function(field) {
_p.whereNull(field, 'IS NULL', 'AND');
return this;
}
/**
* Specify that a field IS NOT NULL
*
* @param {String} field
* @return this
*/
this.whereIsNotNull = function(field) {
_p.whereNull(field, 'IS NOT NULL', 'AND');
return this;
}
/**
* Field is null prefixed with 'OR'
*
* @param {String} field
* @return this
*/
this.orWhereIsNull = function(field) {
_p.whereNull(field, 'IS NULL', 'OR');
return this;
}
/**
* Field is not null prefixed with 'OR'
*
* @param {String} field
* @return this
*/
this.orWhereIsNotNull = function(field) {
_p.whereNull(field, 'IS NOT NULL', 'OR');
return this;
}
/** /**
* Set a 'where in' clause * Set a 'where in' clause
* *
@ -988,7 +1042,7 @@ module.exports = QueryBuilder;</pre>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>

View File

@ -184,7 +184,7 @@ module.exports = QueryParser;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
on Wed Nov 5th 2014 using the <a on Tue Nov 18th 2014 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>. href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>