3916 lines
97 KiB
HTML
3916 lines
97 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset='utf-8' />
|
|
<title>ci-node-query 5.0.0 | Documentation</title>
|
|
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
<link href='assets/bass.css' type='text/css' rel='stylesheet' />
|
|
<link href='assets/style.css' type='text/css' rel='stylesheet' />
|
|
<link href='assets/github.css' type='text/css' rel='stylesheet' />
|
|
<link href='assets/split.css' type='text/css' rel='stylesheet' />
|
|
</head>
|
|
<body class='documentation m0'>
|
|
<div class='flex'>
|
|
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
|
|
<div class='py1 px2'>
|
|
<h3 class='mb0 no-anchor'>ci-node-query</h3>
|
|
<div class='mb1'><code>5.0.0</code></div>
|
|
<input
|
|
placeholder='Filter'
|
|
id='filter-input'
|
|
class='col12 block input'
|
|
type='text' />
|
|
<div id='toc'>
|
|
<ul class='list-reset h5 py1-ul'>
|
|
|
|
|
|
<li><a
|
|
href='#nodequery'
|
|
class=" toggle-sibling">
|
|
NodeQuery
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#nodequerygetquery'
|
|
class='regular pre-open'>
|
|
#getQuery
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#querybuilder'
|
|
class=" toggle-sibling">
|
|
QueryBuilder
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#querybuilderqueryfile'
|
|
class='regular pre-open'>
|
|
#queryFile
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderquery'
|
|
class='regular pre-open'>
|
|
#query
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderresetquery'
|
|
class='regular pre-open'>
|
|
#resetQuery
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildertruncate'
|
|
class='regular pre-open'>
|
|
#truncate
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderend'
|
|
class='regular pre-open'>
|
|
#end
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderselect'
|
|
class='regular pre-open'>
|
|
#select
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderfrom'
|
|
class='regular pre-open'>
|
|
#from
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderlike'
|
|
class='regular pre-open'>
|
|
#like
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildernotlike'
|
|
class='regular pre-open'>
|
|
#notLike
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorlike'
|
|
class='regular pre-open'>
|
|
#orLike
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderornotlike'
|
|
class='regular pre-open'>
|
|
#orNotLike
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderhaving'
|
|
class='regular pre-open'>
|
|
#having
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorhaving'
|
|
class='regular pre-open'>
|
|
#orHaving
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderwhere'
|
|
class='regular pre-open'>
|
|
#where
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorwhere'
|
|
class='regular pre-open'>
|
|
#orWhere
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderwhereisnull'
|
|
class='regular pre-open'>
|
|
#whereIsNull
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderwhereisnotnull'
|
|
class='regular pre-open'>
|
|
#whereIsNotNull
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorwhereisnull'
|
|
class='regular pre-open'>
|
|
#orWhereIsNull
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorwhereisnotnull'
|
|
class='regular pre-open'>
|
|
#orWhereIsNotNull
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderwherein'
|
|
class='regular pre-open'>
|
|
#whereIn
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorwherein'
|
|
class='regular pre-open'>
|
|
#orWhereIn
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderwherenotin'
|
|
class='regular pre-open'>
|
|
#whereNotIn
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorwherenotin'
|
|
class='regular pre-open'>
|
|
#orWhereNotIn
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderset'
|
|
class='regular pre-open'>
|
|
#set
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderjoin'
|
|
class='regular pre-open'>
|
|
#join
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildergroupby'
|
|
class='regular pre-open'>
|
|
#groupBy
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorderby'
|
|
class='regular pre-open'>
|
|
#orderBy
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderlimit'
|
|
class='regular pre-open'>
|
|
#limit
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildergroupstart'
|
|
class='regular pre-open'>
|
|
#groupStart
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderorgroupstart'
|
|
class='regular pre-open'>
|
|
#orGroupStart
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderornotgroupstart'
|
|
class='regular pre-open'>
|
|
#orNotGroupStart
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildergroupend'
|
|
class='regular pre-open'>
|
|
#groupEnd
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderget'
|
|
class='regular pre-open'>
|
|
#get
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderinsert'
|
|
class='regular pre-open'>
|
|
#insert
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderinsertbatch'
|
|
class='regular pre-open'>
|
|
#insertBatch
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderupdate'
|
|
class='regular pre-open'>
|
|
#update
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderupdatebatch'
|
|
class='regular pre-open'>
|
|
#updateBatch
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuilderdelete'
|
|
class='regular pre-open'>
|
|
#delete
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildergetcompiledselect'
|
|
class='regular pre-open'>
|
|
#getCompiledSelect
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildergetcompiledinsert'
|
|
class='regular pre-open'>
|
|
#getCompiledInsert
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildergetcompiledupdate'
|
|
class='regular pre-open'>
|
|
#getCompiledUpdate
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#querybuildergetcompileddelete'
|
|
class='regular pre-open'>
|
|
#getCompiledDelete
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#result'
|
|
class=" toggle-sibling">
|
|
Result
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#resultrowcount'
|
|
class='regular pre-open'>
|
|
#rowCount
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#resultcolumncount'
|
|
class='regular pre-open'>
|
|
#columnCount
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</div>
|
|
<div class='mt1 h6 quiet'>
|
|
<a href='http://documentation.js.org/reading-documentation.html'>Need help reading this?</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id='split-right' class='relative overflow-auto height-viewport-100'>
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
|
|
<h3 class='fl m0' id='nodequery'>
|
|
NodeQuery
|
|
</h3>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p>Class for connection management</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new NodeQuery(config: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>config</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</code>
|
|
connection parameters
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='nodequerygetquery'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>getQuery()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Return an existing query builder instance</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>getQuery(): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
|
|
<h3 class='fl m0' id='querybuilder'>
|
|
QueryBuilder
|
|
</h3>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p>Main object that builds SQL queries.</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new QueryBuilder(Driver: Driver, Adapter: Adapter)</div>
|
|
|
|
|
|
<p>
|
|
Extends
|
|
|
|
QueryBuilderBase
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>Driver</span> <code class='quiet'>(Driver)</code>
|
|
The syntax driver for the database
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>Adapter</span> <code class='quiet'>(Adapter)</code>
|
|
The database module adapter for running queries
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='querybuilderqueryfile'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>queryFile(file, separator)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Run a set of queries from a file</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>queryFile(file: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, separator: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>file</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
The path to the sql file
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>separator</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
|
|
= <code>';'</code>)</code>
|
|
The character separating each query
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
The result of all the queries
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderquery'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>query(sql, params?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Run an arbitrary sql query. Run as a prepared statement.</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>query(sql: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, params: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>sql</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
The sql to execute
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>params</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>?)</code>
|
|
The query parameters
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
Promise with result of query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderresetquery'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>resetQuery()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Reset the object state for a new query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>resetQuery(): void</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code>void</code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildertruncate'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>truncate(table)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Empties the selected database table</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>truncate(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): (void | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
the name of the table to truncate
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code>(void | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>)</code>:
|
|
Returns a promise if no callback is supplied
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderend'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>end()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Closes the database connection for the current adapter</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>end(): void</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code>void</code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderselect'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>select(fields)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Specify rows to select in the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>select(fields: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>fields</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>))</code>
|
|
The fields to select from the current table
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.select(<span class="hljs-string">'foo, bar'</span>); <span class="hljs-comment">// Select multiple fields with a string</span></pre>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.select([<span class="hljs-string">'foo'</span>, <span class="hljs-string">'bar'</span>]); <span class="hljs-comment">// Select multiple fileds with an array</span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderfrom'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>from(tableName)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Specify the database table to select from</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>from(tableName: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>tableName</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The table to use for the current query
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.from(<span class="hljs-string">'tableName'</span>);</pre>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.from(<span class="hljs-string">'tableName t'</span>); <span class="hljs-comment">// Select the table with an alias</span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderlike'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>like(field, val, pos)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Add a 'like/ and like' clause to the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>like(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, val: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, pos: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The name of the field to compare to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The value to compare to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>pos</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>
|
|
= <code>both</code>)</code>
|
|
The placement of the wildcard character(s): before, after, or both
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildernotlike'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>notLike(field, val, pos)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Add a 'not like/ and not like' clause to the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>notLike(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, val: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, pos: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The name of the field to compare to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The value to compare to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>pos</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>
|
|
= <code>both</code>)</code>
|
|
The placement of the wildcard character(s): before, after, or both
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorlike'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orLike(field, val, pos)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Add an 'or like' clause to the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orLike(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, val: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, pos: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The name of the field to compare to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The value to compare to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>pos</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>
|
|
= <code>both</code>)</code>
|
|
The placement of the wildcard character(s): before, after, or both
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderornotlike'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orNotLike(field, val, pos)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Add an 'or not like' clause to the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orNotLike(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, val: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, pos: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The name of the field to compare to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The value to compare to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>pos</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>
|
|
= <code>both</code>)</code>
|
|
The placement of the wildcard character(s): before, after, or both
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderhaving'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>having(key, val = null)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Add a 'having' clause</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>having(key: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>), val: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)?): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>))</code>
|
|
The name of the field and the comparision operator, or an object
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)?
|
|
= <code>null</code>)</code>
|
|
The value to compare if the value of key is a string
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorhaving'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orHaving(key, val = null)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Add an 'or having' clause</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orHaving(key: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>), val: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)?): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>))</code>
|
|
The name of the field and the comparision operator, or an object
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)?
|
|
= <code>null</code>)</code>
|
|
The value to compare if the value of key is a string
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderwhere'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>where(key, val?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set a 'where' clause</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>where(key: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>), val: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)?): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>))</code>
|
|
The name of the field and the comparision operator, or an object
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)?)</code>
|
|
The value to compare if the value of key is a string
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorwhere'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orWhere(key, val?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set a 'or where' clause</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orWhere(key: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>), val: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)?): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>))</code>
|
|
The name of the field and the comparision operator, or an object
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)?)</code>
|
|
The value to compare if the value of key is a string
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderwhereisnull'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>whereIsNull(field)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Select a field that is Null</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>whereIsNull(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The name of the field that has a NULL value
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderwhereisnotnull'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>whereIsNotNull(field)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Specify that a field IS NOT NULL</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>whereIsNotNull(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The name so the field that is not to be null
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorwhereisnull'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orWhereIsNull(field)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Field is null prefixed with 'OR'</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orWhereIsNull(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The name of the field
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorwhereisnotnull'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orWhereIsNotNull(field)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Field is not null prefixed with 'OR'</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orWhereIsNotNull(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The name of the field
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderwherein'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>whereIn(key, values)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set a 'where in' clause</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>whereIn(key: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, values: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
the field to search
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>values</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)</code>
|
|
the array of items to search in
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorwherein'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orWhereIn(key, values)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set a 'or where in' clause</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orWhereIn(key: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, values: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
the field to search
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>values</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)</code>
|
|
the array of items to search in
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderwherenotin'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>whereNotIn(key, values)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set a 'where not in' clause</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>whereNotIn(key: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, values: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
the field to search
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>values</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)</code>
|
|
the array of items to search in
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorwherenotin'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orWhereNotIn(key, values)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set a 'or where not in' clause</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orWhereNotIn(key: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, values: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
the field to search
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>values</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)</code>
|
|
the array of items to search in
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderset'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>set(key, val?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set values for insertion or updating</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>set(key: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>), val: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>?): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>key</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>))</code>
|
|
The key or object to use
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>val</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>?)</code>
|
|
The value if using a scalar key
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.set(<span class="hljs-string">'foo'</span>, <span class="hljs-string">'bar'</span>); <span class="hljs-comment">// Set a key, value pair</span></pre>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.set({<span class="hljs-attr">foo</span>:<span class="hljs-string">'bar'</span>}); <span class="hljs-comment">// Set with an object</span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderjoin'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>join(table, cond, type)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Add a join clause to the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>join(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, cond: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, type: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The table you are joining
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>cond</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The join condition.
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>type</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>
|
|
= <code>'inner'</code>)</code>
|
|
The type of join, which defaults to inner
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildergroupby'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>groupBy(field)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Group the results by the selected field(s)</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>groupBy(field: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>))</code>
|
|
The name of the field to group by
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorderby'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orderBy(field, type)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Order the results by the selected field(s)</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orderBy(field: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, type: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>field</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The field(s) to order by
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>type</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>
|
|
= <code>'ASC'</code>)</code>
|
|
The order direction, ASC or DESC
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderlimit'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>limit(limit, offset?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Put a limit on the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>limit(limit: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>, offset: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>?): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>limit</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>)</code>
|
|
The maximum number of rows to fetch
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>offset</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>?)</code>
|
|
The row number to start from
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildergroupstart'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>groupStart()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Adds an open paren to the current query for logical grouping</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>groupStart(): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderorgroupstart'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orGroupStart()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Adds an open paren to the current query for logical grouping,
|
|
prefixed with 'OR'</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orGroupStart(): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderornotgroupstart'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>orNotGroupStart()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Adds an open paren to the current query for logical grouping,
|
|
prefixed with 'OR NOT'</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>orNotGroupStart(): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildergroupend'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>groupEnd()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Ends a logical grouping started with one of the groupStart methods</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>groupEnd(): <a href="#querybuilder">QueryBuilder</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#querybuilder">QueryBuilder</a></code>:
|
|
The Query Builder object, for chaining
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderget'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>get(table?, limit?, offset?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get the results of the compiled query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>get(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>?, limit: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>?, offset: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>?)</code>
|
|
The table to select from
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>limit</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>?)</code>
|
|
A limit for the query
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>offset</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a>?)</code>
|
|
An offset for the query
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></code>:
|
|
Promise containing the result of the query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.get(<span class="hljs-string">'table_name'</span>).then(promiseCallback); <span class="hljs-comment">// Get all the rows in the table</span></pre>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.get(<span class="hljs-string">'table_name'</span>, <span class="hljs-number">5</span>); <span class="hljs-comment">// Get 5 rows from the table</span></pre>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.get(); <span class="hljs-comment">// Get the results of a query generated with other methods</span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderinsert'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>insert(table, data?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Run the generated insert query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>insert(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, data: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The table to insert into
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>data</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?)</code>
|
|
Data to insert, if not already added with the 'set' method
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></code>:
|
|
Promise containing the result of the query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderinsertbatch'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>insertBatch(table, data)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Insert multiple sets of rows at a time</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>insertBatch(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, data: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The table to insert into
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>data</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)</code>
|
|
The array of objects containing data rows to insert
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></code>:
|
|
Promise containing the result of the query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>query.insertBatch(<span class="hljs-string">'foo'</span>,[{<span class="hljs-attr">id</span>:<span class="hljs-number">1</span>,<span class="hljs-attr">val</span>:<span class="hljs-string">'bar'</span>},{<span class="hljs-attr">id</span>:<span class="hljs-number">2</span>,<span class="hljs-attr">val</span>:<span class="hljs-string">'baz'</span>}])
|
|
.then(promiseCallback);</pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderupdate'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>update(table, data?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Run the generated update query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>update(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, data: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The table to insert into
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>data</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?)</code>
|
|
Data to insert, if not already added with the 'set' method
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></code>:
|
|
Promise containing the result of the query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderupdatebatch'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>updateBatch(table, data, updateKey)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Creates a batch update sql statement</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>updateBatch(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, data: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>, updateKey: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The table to update
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>data</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</code>
|
|
Batch insert data
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>updateKey</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The field in the table to compare against for updating
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></code>:
|
|
Number of rows updated
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuilderdelete'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>delete(table, where?)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Run the generated delete query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>delete(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, where: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
The table to insert into
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>where</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?)</code>
|
|
Where clause for delete statement
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a><<a href="#result">Result</a>></code>:
|
|
Promise containing the result of the query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildergetcompiledselect'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>getCompiledSelect(table?, reset)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Return generated select query SQL</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>getCompiledSelect(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>?, reset: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>?)</code>
|
|
the name of the table to retrieve from
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>reset</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>
|
|
= <code>true</code>)</code>
|
|
Whether to reset the query builder so another query can be built
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code>:
|
|
The compiled sql statement
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildergetcompiledinsert'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>getCompiledInsert(table, reset)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Return generated insert query SQL</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>getCompiledInsert(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, reset: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
the name of the table to insert into
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>reset</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>
|
|
= <code>true</code>)</code>
|
|
Whether to reset the query builder so another query can be built
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code>:
|
|
The compiled sql statement
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildergetcompiledupdate'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>getCompiledUpdate(table, reset)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Return generated update query SQL</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>getCompiledUpdate(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, reset: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
the name of the table to update
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>reset</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>
|
|
= <code>true</code>)</code>
|
|
Whether to reset the query builder so another query can be built
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code>:
|
|
The compiled sql statement
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='querybuildergetcompileddelete'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>getCompiledDelete(table, reset)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Return generated delete query SQL</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>getCompiledDelete(table: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>, reset: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>table</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a>)</code>
|
|
the name of the table to delete from
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>reset</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a>
|
|
= <code>true</code>)</code>
|
|
Whether to reset the query builder so another query can be built
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code>:
|
|
The compiled sql statement
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
|
|
<h3 class='fl m0' id='result'>
|
|
Result
|
|
</h3>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p>Query result object</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Result(rows: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>, columns: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>rows</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>
|
|
= <code>[]</code>)</code>
|
|
the data rows of the result
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>columns</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>
|
|
= <code>[]</code>)</code>
|
|
the column names in the result
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='resultrowcount'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>rowCount()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get the number of rows returned by the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>rowCount(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></code>:
|
|
the number of rows in the result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='resultcolumncount'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>columnCount()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get the number of columns returned by the query</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>columnCount(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></code>:
|
|
the number of columns in the result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<script src='assets/anchor.js'></script>
|
|
<script src='assets/split.js'></script>
|
|
<script src='assets/site.js'></script>
|
|
</body>
|
|
</html>
|