2016-01-26 19:29:12 -05:00
<!doctype html>
2015-11-20 09:21:46 -05:00
< html >
2014-10-20 16:56:45 -04:00
< head >
2015-11-20 09:21:46 -05:00
< meta charset = 'utf-8' / >
< title > | Documentation< / title >
< meta name = 'viewport' content = 'width=device-width,initial-scale=1' >
< link href = 'http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Source+Code+Pro:400,500,700' rel = 'stylesheet' type = 'text/css' >
< 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' / >
< / head >
< body class = 'documentation' >
< div class = 'container' >
< div class = 'clearfix md-mxn2' >
< div class = 'fixed md-show fix-3 overflow-auto max-height-100' >
< div class = 'py1 px2' >
< h3 class = 'mb0 no-anchor' > < / h3 >
< div class = 'mb1' > < code > < / code > < / div >
< input
placeholder='Filter'
id='filter-input'
class='col12 block field'
type='text' />
< div id = 'toc' >
< a
2016-01-26 19:29:12 -05:00
href='#NodeQuery'
2015-11-20 09:21:46 -05:00
class='block bold'>
2016-01-26 19:29:12 -05:00
NodeQuery
2015-11-20 09:21:46 -05:00
< / a >
2016-03-11 10:41:04 -05:00
< a
href='#NodeQuery.constructor'
class='regular block'>
#constructor
< / a >
2016-01-26 19:29:12 -05:00
< a
href='#NodeQuery.getQuery'
class='regular block'>
#getQuery
< / a >
< a
href='#NodeQuery.init'
class='regular block'>
#init
< / a >
2015-11-20 09:21:46 -05:00
< a
2016-01-26 19:29:12 -05:00
href='#QueryBuilder'
2015-11-20 09:21:46 -05:00
class='block bold'>
2016-01-26 19:29:12 -05:00
QueryBuilder
2015-11-20 09:21:46 -05:00
< / a >
< a
2016-01-26 19:29:12 -05:00
href='#QueryBuilder.delete'
2015-11-20 09:21:46 -05:00
class='regular block'>
2016-01-26 19:29:12 -05:00
#delete
2015-11-20 09:21:46 -05:00
< / a >
< a
2016-01-26 19:29:12 -05:00
href='#QueryBuilder.end'
2015-11-20 09:21:46 -05:00
class='regular block'>
2016-01-26 19:29:12 -05:00
#end
2015-11-20 09:21:46 -05:00
< / a >
< a
2016-01-26 19:29:12 -05:00
href='#QueryBuilder.from'
2015-11-20 09:21:46 -05:00
class='regular block'>
2016-01-26 19:29:12 -05:00
#from
2015-11-20 09:21:46 -05:00
< / a >
< a
2016-01-26 19:29:12 -05:00
href='#QueryBuilder.get'
2015-11-20 09:21:46 -05:00
class='regular block'>
2016-01-26 19:29:12 -05:00
#get
2015-11-20 09:21:46 -05:00
< / a >
< a
2016-01-26 19:29:12 -05:00
href='#QueryBuilder.getCompiledDelete'
2015-11-20 09:21:46 -05:00
class='regular block'>
2016-01-26 19:29:12 -05:00
#getCompiledDelete
2015-11-20 09:21:46 -05:00
< / a >
2015-12-02 13:01:31 -05:00
< a
2016-01-26 19:29:12 -05:00
href='#QueryBuilder.getCompiledInsert'
2015-12-02 13:01:31 -05:00
class='regular block'>
2016-01-26 19:29:12 -05:00
#getCompiledInsert
< / a >
< a
href='#QueryBuilder.getCompiledSelect'
class='regular block'>
#getCompiledSelect
< / a >
< a
href='#QueryBuilder.getCompiledUpdate'
class='regular block'>
#getCompiledUpdate
< / a >
< a
href='#QueryBuilder.groupBy'
class='regular block'>
#groupBy
< / a >
< a
href='#QueryBuilder.groupEnd'
class='regular block'>
#groupEnd
< / a >
< a
href='#QueryBuilder.groupStart'
class='regular block'>
#groupStart
< / a >
< a
href='#QueryBuilder.having'
class='regular block'>
#having
< / a >
< a
href='#QueryBuilder.insert'
class='regular block'>
#insert
< / a >
< a
href='#QueryBuilder.insertBatch'
class='regular block'>
#insertBatch
< / a >
< a
href='#QueryBuilder.join'
class='regular block'>
#join
< / a >
< a
href='#QueryBuilder.like'
class='regular block'>
#like
< / a >
< a
href='#QueryBuilder.limit'
class='regular block'>
#limit
< / a >
< a
href='#QueryBuilder.notLike'
class='regular block'>
#notLike
< / a >
< a
href='#QueryBuilder.orGroupStart'
class='regular block'>
#orGroupStart
< / a >
< a
href='#QueryBuilder.orHaving'
class='regular block'>
#orHaving
< / a >
< a
href='#QueryBuilder.orLike'
class='regular block'>
#orLike
< / a >
< a
href='#QueryBuilder.orNotGroupStart'
class='regular block'>
#orNotGroupStart
< / a >
< a
href='#QueryBuilder.orNotLike'
class='regular block'>
#orNotLike
< / a >
< a
href='#QueryBuilder.orWhere'
class='regular block'>
#orWhere
< / a >
< a
href='#QueryBuilder.orWhereIn'
class='regular block'>
#orWhereIn
< / a >
< a
href='#QueryBuilder.orWhereIsNotNull'
class='regular block'>
#orWhereIsNotNull
< / a >
< a
href='#QueryBuilder.orWhereIsNull'
class='regular block'>
#orWhereIsNull
< / a >
< a
href='#QueryBuilder.orWhereNotIn'
class='regular block'>
#orWhereNotIn
< / a >
< a
href='#QueryBuilder.orderBy'
class='regular block'>
#orderBy
< / a >
2016-02-12 11:40:49 -05:00
< a
href='#QueryBuilder.query'
class='regular block'>
#query
< / a >
2016-01-26 19:29:12 -05:00
< a
href='#QueryBuilder.resetQuery'
class='regular block'>
#resetQuery
< / a >
< a
href='#QueryBuilder.select'
class='regular block'>
#select
< / a >
< a
href='#QueryBuilder.set'
class='regular block'>
#set
< / a >
< a
href='#QueryBuilder.update'
class='regular block'>
#update
< / a >
< a
href='#QueryBuilder.where'
class='regular block'>
#where
< / a >
< a
href='#QueryBuilder.whereIn'
class='regular block'>
#whereIn
< / a >
< a
href='#QueryBuilder.whereIsNotNull'
class='regular block'>
#whereIsNotNull
< / a >
< a
href='#QueryBuilder.whereIsNull'
class='regular block'>
#whereIsNull
< / a >
< a
href='#QueryBuilder.whereNotIn'
class='regular block'>
#whereNotIn
2015-12-02 13:01:31 -05:00
< / a >
2015-11-20 09:21:46 -05:00
< / div >
< / div >
< / div >
< div class = 'fix-margin-3' >
< div class = 'px2' >
< div class = 'py1' > < section class = 'py2 clearfix' >
2016-01-26 19:29:12 -05:00
< h2 id = 'NodeQuery' class = 'mt0' >
2016-03-11 10:41:04 -05:00
NodeQuery< span class = 'gray' > (config)< / span >
2015-11-20 09:21:46 -05:00
< / h2 >
2016-01-26 19:29:12 -05:00
< p > Class for connection management< / p >
2014-10-20 16:56:45 -04:00
2016-03-11 10:41:04 -05:00
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < strong > config< / strong >
:
< div class = 'force-inline' >
< / div >
< / li >
< / ul >
2016-01-26 19:29:12 -05:00
< h4 > Instance members< / h4 >
2016-03-11 10:41:04 -05:00
< div class = 'collapsible' id = 'NodeQuery.constructor' >
< a href = '#NodeQuery.constructor' >
< code >
#constructor< span class = 'gray' > (config)< / span >
< / code >
< div class = 'force-inline' >
< p > Constructor< / p >
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'NodeQuery.constructor' class = 'mt0' >
constructor< span class = 'gray' > (config)< / span >
< / h2 >
< p > Constructor< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > object< / a > < / code > < strong > config< / strong >
:
< div class = 'force-inline' >
< p > connection paramaters< / p >
< / div >
< / li >
< / ul >
< / section >
< / div >
< / div >
2016-01-26 19:29:12 -05:00
< div class = 'collapsible' id = 'NodeQuery.getQuery' >
< a href = '#NodeQuery.getQuery' >
2015-11-20 09:21:46 -05:00
< code >
2016-01-26 19:29:12 -05:00
#getQuery< span class = 'gray' > < / span >
2015-11-20 09:21:46 -05:00
< / code >
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Return an existing query builder instance< / p >
2014-10-20 16:56:45 -04:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / a >
2016-01-26 19:29:12 -05:00
< div class = 'collapser border px2' >
2015-11-20 09:21:46 -05:00
< section class = 'py2 clearfix' >
2016-01-26 19:29:12 -05:00
< h2 id = 'NodeQuery.getQuery' class = 'mt0' >
getQuery< span class = 'gray' > < / span >
2015-11-20 09:21:46 -05:00
< / h2 >
2016-01-26 19:29:12 -05:00
< p > Return an existing query builder instance< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'NodeQuery.init' >
< a href = '#NodeQuery.init' >
< code >
#init< span class = 'gray' > (driverType, connObject, [connLib])< / span >
< / code >
< div class = 'force-inline' >
< p > Create a query builder object< / p >
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'NodeQuery.init' class = 'mt0' >
init< span class = 'gray' > (driverType, connObject, [connLib])< / span >
< / h2 >
< p > Create a query builder object< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > driverType< / strong >
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > The name of the database type, eg. mysql or pg< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / li >
2016-01-26 19:29:12 -05:00
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > < strong > connObject< / strong >
:
< div class = 'force-inline' >
2016-03-09 15:05:38 -05:00
< p > A connection object from the database library
you are connecting with< / p >
2016-01-26 19:29:12 -05:00
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > connLib< / strong >
:
< div class = 'force-inline' >
2016-03-09 15:05:38 -05:00
< p > The name of the db connection library you are
using, eg. mysql or mysql2. Optional if the same as driverType< / p >
2016-01-26 19:29:12 -05:00
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object< / p >
< / div >
< / section >
< / div >
< / div >
< / section >
< / div > < div class = 'py1' > < section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder' class = 'mt0' >
QueryBuilder< span class = 'gray' > (Driver, Adapter)< / span >
< / h2 >
< p > Main object that builds SQL queries.< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > Driver< / code > < strong > Driver< / strong >
:
< div class = 'force-inline' >
< p > The syntax driver for the database< / p >
< / div >
< / li >
< li > < code > Adapter< / code > < strong > Adapter< / strong >
:
< div class = 'force-inline' >
< p > The database module adapter for running queries< / p >
< / div >
< / li >
< / ul >
< h4 > Instance members< / h4 >
< div class = 'collapsible' id = 'QueryBuilder.delete' >
< a href = '#QueryBuilder.delete' >
< code >
#delete< span class = 'gray' > (table, [where], [callback])< / span >
< / code >
< div class = 'force-inline' >
< p > Run the generated delete query< / p >
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.delete' class = 'mt0' >
delete< span class = 'gray' > (table, [where], [callback])< / span >
< / h2 >
< p > Run the generated delete query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > The table to insert into< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > ]< / code > < strong > where< / strong >
:
< div class = 'force-inline' >
< p > Where clause for delete statement< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function" > Function< / a > < / code > ]< / code > < strong > callback< / strong >
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Callback for handling response from the database< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / li >
< / ul >
< h4 > Returns< / h4 >
2016-01-26 19:29:12 -05:00
< code > < code > void< / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" > Promise< / a > < / code > < / code >
2015-12-03 20:43:42 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > If no callback is passed, a promise is returned< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.end' >
< a href = '#QueryBuilder.end' >
< code >
#end< span class = 'gray' > < / span >
< / code >
< div class = 'force-inline' >
< p > Closes the database connection for the current adapter< / p >
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.end' class = 'mt0' >
end< span class = 'gray' > < / span >
< / h2 >
< p > Closes the database connection for the current adapter< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< h4 > Returns< / h4 >
< code > < code > void< / code > < / code >
< div class = 'force-inline' >
< / div >
2015-11-20 09:21:46 -05:00
< / section >
< / div >
< / div >
2016-01-26 19:29:12 -05:00
< div class = 'collapsible' id = 'QueryBuilder.from' >
< a href = '#QueryBuilder.from' >
2015-11-20 09:21:46 -05:00
< code >
2016-01-26 19:29:12 -05:00
#from< span class = 'gray' > (tableName)< / span >
2015-11-20 09:21:46 -05:00
< / code >
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Specify the database table to select from< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / a >
2016-01-26 19:29:12 -05:00
< div class = 'collapser border px2' >
2015-11-20 09:21:46 -05:00
< section class = 'py2 clearfix' >
2016-01-26 19:29:12 -05:00
< h2 id = 'QueryBuilder.from' class = 'mt0' >
from< span class = 'gray' > (tableName)< / span >
2015-11-20 09:21:46 -05:00
< / h2 >
2016-01-26 19:29:12 -05:00
< p > Specify the database table to select from< / p >
2015-11-20 09:21:46 -05:00
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
2016-01-26 19:29:12 -05:00
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > tableName< / strong >
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > The table to use for the current query< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / li >
< / ul >
< h4 > Returns< / h4 >
2016-01-26 19:29:12 -05:00
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
2015-12-03 20:43:42 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2016-01-26 20:23:52 -05:00
< h4 > Examples< / h4 >
< pre class = 'overflow-auto' > query.from(< span class = "hljs-string" > 'tableName'< / span > );< / pre > < pre class = 'overflow-auto' > query.from(< span class = "hljs-string" > 'tableName t'< / span > ); < span class = "hljs-comment" > // Select the table with an alias< / span > < / pre >
2015-11-20 09:21:46 -05:00
< / section >
< / div >
< / div >
2016-01-26 19:29:12 -05:00
< div class = 'collapsible' id = 'QueryBuilder.get' >
< a href = '#QueryBuilder.get' >
2015-11-20 09:21:46 -05:00
< code >
2016-01-26 19:29:12 -05:00
#get< span class = 'gray' > ([table], [limit], [offset], [callback])< / span >
2015-11-20 09:21:46 -05:00
< / code >
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Get the results of the compiled query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / a >
2016-01-26 19:29:12 -05:00
< div class = 'collapser border px2' >
2015-11-20 09:21:46 -05:00
< section class = 'py2 clearfix' >
2016-01-26 19:29:12 -05:00
< h2 id = 'QueryBuilder.get' class = 'mt0' >
get< span class = 'gray' > ([table], [limit], [offset], [callback])< / span >
2015-11-20 09:21:46 -05:00
< / h2 >
2016-01-26 19:29:12 -05:00
< p > Get the results of the compiled query< / p >
2015-11-20 09:21:46 -05:00
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
2016-01-26 19:29:12 -05:00
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > The table to select from< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" > Number< / a > < / code > ]< / code > < strong > limit< / strong >
:
< div class = 'force-inline' >
< p > A limit for the query< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" > Number< / a > < / code > ]< / code > < strong > offset< / strong >
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > An offset for the query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / li >
2016-01-26 19:29:12 -05:00
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function" > Function< / a > < / code > ]< / code > < strong > callback< / strong >
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > A callback for receiving the result< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / li >
< / ul >
< h4 > Returns< / h4 >
2016-01-26 19:29:12 -05:00
< code > < code > void< / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" > Promise< / a > < / code > < / code >
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > If no callback is passed, a promise is returned< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2016-01-26 20:23:52 -05:00
< h4 > Examples< / h4 >
< pre class = 'overflow-auto' > 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 = 'overflow-auto' > query.get(< span class = "hljs-string" > 'table_name'< / span > , < span class = "hljs-number" > 5< / span > , callback); < span class = "hljs-comment" > // Get 5 rows from the table< / span > < / pre > < pre class = 'overflow-auto' > query.get(callback); < span class = "hljs-comment" > // Get the results of a query generated with other methods< / span > < / pre >
2015-11-20 09:21:46 -05:00
< / section >
< / div >
< / div >
2016-01-26 19:29:12 -05:00
< div class = 'collapsible' id = 'QueryBuilder.getCompiledDelete' >
< a href = '#QueryBuilder.getCompiledDelete' >
2015-11-20 09:21:46 -05:00
< code >
2016-01-26 19:29:12 -05:00
#getCompiledDelete< span class = 'gray' > (table, [reset])< / span >
2015-11-20 09:21:46 -05:00
< / code >
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Return generated delete query SQL< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / a >
2016-01-26 19:29:12 -05:00
< div class = 'collapser border px2' >
2015-11-20 09:21:46 -05:00
< section class = 'py2 clearfix' >
2016-01-26 19:29:12 -05:00
< h2 id = 'QueryBuilder.getCompiledDelete' class = 'mt0' >
getCompiledDelete< span class = 'gray' > (table, [reset])< / span >
2015-11-20 09:21:46 -05:00
< / h2 >
2016-01-26 19:29:12 -05:00
< p > Return generated delete query SQL< / p >
2015-11-20 09:21:46 -05:00
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
2016-01-26 19:29:12 -05:00
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > the name of the table to delete from< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" > Boolean< / a > < / code > ]< / code > < strong > reset< / strong >
(default < code > true< / code > )
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Whether to reset the query builder so another query can be built< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < / code >
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > The compiled sql statement< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / section >
< / div >
< / div >
2016-01-26 19:29:12 -05:00
< div class = 'collapsible' id = 'QueryBuilder.getCompiledInsert' >
< a href = '#QueryBuilder.getCompiledInsert' >
2015-11-20 09:21:46 -05:00
< code >
2016-01-26 19:29:12 -05:00
#getCompiledInsert< span class = 'gray' > (table, [reset])< / span >
2015-11-20 09:21:46 -05:00
< / code >
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Return generated insert query SQL< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / a >
2016-01-26 19:29:12 -05:00
< div class = 'collapser border px2' >
2015-11-20 09:21:46 -05:00
< section class = 'py2 clearfix' >
2016-01-26 19:29:12 -05:00
< h2 id = 'QueryBuilder.getCompiledInsert' class = 'mt0' >
getCompiledInsert< span class = 'gray' > (table, [reset])< / span >
2015-11-20 09:21:46 -05:00
< / h2 >
2016-01-26 19:29:12 -05:00
< p > Return generated insert query SQL< / p >
2015-11-20 09:21:46 -05:00
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
2016-01-26 19:29:12 -05:00
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > table< / strong >
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > the name of the table to insert into< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" > Boolean< / a > < / code > ]< / code > < strong > reset< / strong >
(default < code > true< / code > )
:
< div class = 'force-inline' >
< p > Whether to reset the query builder so another query can be built< / p >
< / div >
2015-11-20 09:21:46 -05:00
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < / code >
2015-12-03 20:43:42 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > The compiled sql statement< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / section >
< / div >
< / div >
2016-01-26 19:29:12 -05:00
< div class = 'collapsible' id = 'QueryBuilder.getCompiledSelect' >
< a href = '#QueryBuilder.getCompiledSelect' >
2015-11-20 09:21:46 -05:00
< code >
2016-01-26 19:29:12 -05:00
#getCompiledSelect< span class = 'gray' > ([table], [reset])< / span >
2015-11-20 09:21:46 -05:00
< / code >
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Return generated select query SQL< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / a >
2016-01-26 19:29:12 -05:00
< div class = 'collapser border px2' >
2015-11-20 09:21:46 -05:00
< section class = 'py2 clearfix' >
2016-01-26 19:29:12 -05:00
< h2 id = 'QueryBuilder.getCompiledSelect' class = 'mt0' >
getCompiledSelect< span class = 'gray' > ([table], [reset])< / span >
2015-11-20 09:21:46 -05:00
< / h2 >
2016-01-26 19:29:12 -05:00
< p > Return generated select query SQL< / p >
2015-11-20 09:21:46 -05:00
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
2016-01-26 19:29:12 -05:00
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > the name of the table to retrieve from< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" > Boolean< / a > < / code > ]< / code > < strong > reset< / strong >
(default < code > true< / code > )
2015-11-20 09:21:46 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > Whether to reset the query builder so another query can be built< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < / code >
2015-12-03 20:43:42 -05:00
:
2016-01-26 19:29:12 -05:00
< div class = 'force-inline' >
< p > The compiled sql statement< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
2015-11-20 09:21:46 -05:00
< / section >
< / div >
< / div >
2016-01-26 19:29:12 -05:00
< div class = 'collapsible' id = 'QueryBuilder.getCompiledUpdate' >
< a href = '#QueryBuilder.getCompiledUpdate' >
< code >
#getCompiledUpdate< span class = 'gray' > (table, [reset])< / span >
< / code >
< div class = 'force-inline' >
< p > Return generated update query SQL< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.getCompiledUpdate' class = 'mt0' >
getCompiledUpdate< span class = 'gray' > (table, [reset])< / span >
< / h2 >
< p > Return generated update query SQL< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > the name of the table to update< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" > Boolean< / a > < / code > ]< / code > < strong > reset< / strong >
(default < code > true< / code > )
:
< div class = 'force-inline' >
< p > Whether to reset the query builder so another query can be built< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The compiled sql statement< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.groupBy' >
< a href = '#QueryBuilder.groupBy' >
< code >
#groupBy< span class = 'gray' > (field)< / span >
< / code >
< div class = 'force-inline' >
< p > Group the results by the selected field(s)< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.groupBy' class = 'mt0' >
groupBy< span class = 'gray' > (field)< / span >
< / h2 >
< p > Group the results by the selected field(s)< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" > Array< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name of the field to group by< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.groupEnd' >
< a href = '#QueryBuilder.groupEnd' >
< code >
#groupEnd< span class = 'gray' > < / span >
< / code >
< div class = 'force-inline' >
< p > Ends a logical grouping started with one of the groupStart methods< / p >
2015-12-02 13:01:31 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.groupEnd' class = 'mt0' >
groupEnd< span class = 'gray' > < / span >
< / h2 >
< p > Ends a logical grouping started with one of the groupStart methods< / p >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.groupStart' >
< a href = '#QueryBuilder.groupStart' >
< code >
#groupStart< span class = 'gray' > < / span >
< / code >
< div class = 'force-inline' >
< p > Adds an open paren to the current query for logical grouping< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.groupStart' class = 'mt0' >
groupStart< span class = 'gray' > < / span >
< / h2 >
< p > Adds an open paren to the current query for logical grouping< / p >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.having' >
< a href = '#QueryBuilder.having' >
< code >
#having< span class = 'gray' > (key, [val])< / span >
< / code >
< div class = 'force-inline' >
< p > Add a ' having' clause< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.having' class = 'mt0' >
having< span class = 'gray' > (key, [val])< / span >
< / h2 >
< p > Add a ' having' clause< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > The name of the field and the comparision operator, or an object< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" > Number< / a > < / code > ]< / code > < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value to compare if the value of key is a string< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.insert' >
< a href = '#QueryBuilder.insert' >
< code >
#insert< span class = 'gray' > (table, [data], [callback])< / span >
< / code >
< div class = 'force-inline' >
< p > Run the generated insert query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.insert' class = 'mt0' >
insert< span class = 'gray' > (table, [data], [callback])< / span >
< / h2 >
< p > Run the generated insert query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > The table to insert into< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > ]< / code > < strong > data< / strong >
:
< div class = 'force-inline' >
< p > Data to insert, if not already added with the ' set' method< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function" > Function< / a > < / code > ]< / code > < strong > callback< / strong >
:
< div class = 'force-inline' >
< p > Callback for handling response from the database< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > void< / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" > Promise< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > If no callback is passed, a promise is returned< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.insertBatch' >
< a href = '#QueryBuilder.insertBatch' >
< code >
#insertBatch< span class = 'gray' > (table, data, [callback])< / span >
< / code >
< div class = 'force-inline' >
< p > Insert multiple sets of rows at a time< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.insertBatch' class = 'mt0' >
insertBatch< span class = 'gray' > (table, data, [callback])< / span >
< / h2 >
< p > Insert multiple sets of rows at a time< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > The table to insert into< / p >
< / div >
< / li >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" > Array< / a > < / code > < strong > data< / strong >
:
< div class = 'force-inline' >
< p > The array of objects containing data rows to insert< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function" > Function< / a > < / code > ]< / code > < strong > callback< / strong >
:
< div class = 'force-inline' >
< p > Callback for handling database response< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > void< / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" > Promise< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > If no callback is passed, a promise is returned< / p >
< / div >
< h4 > Examples< / h4 >
2016-01-26 20:23:52 -05:00
< pre class = 'overflow-auto' > query.insertBatch(< span class = "hljs-string" > 'foo'< / span > ,[{id:< span class = "hljs-number" > 1< / span > ,val:< span class = "hljs-string" > 'bar'< / span > },{id:< span class = "hljs-number" > 2< / span > ,val:< span class = "hljs-string" > 'baz'< / span > }], callbackFunction);< / pre > < pre class = 'overflow-auto' > query.insertBatch(< span class = "hljs-string" > 'foo'< / span > ,[{id:< span class = "hljs-number" > 1< / span > ,val:< span class = "hljs-string" > 'bar'< / span > },{id:< span class = "hljs-number" > 2< / span > ,val:< span class = "hljs-string" > 'baz'< / span > }])
.then(promiseCallback);< / pre >
2016-01-26 19:29:12 -05:00
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.join' >
< a href = '#QueryBuilder.join' >
< code >
#join< span class = 'gray' > (table, cond, [type])< / span >
< / code >
< div class = 'force-inline' >
< p > Add a join clause to the query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.join' class = 'mt0' >
join< span class = 'gray' > (table, cond, [type])< / span >
< / h2 >
< p > Add a join clause to the query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > The table you are joining< / p >
< / div >
< / li >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > cond< / strong >
:
< div class = 'force-inline' >
< p > The join condition.< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > type< / strong >
(default < code > ' inner' < / code > )
:
< div class = 'force-inline' >
< p > The type of join, which defaults to inner< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.like' >
< a href = '#QueryBuilder.like' >
< code >
#like< span class = 'gray' > (field, val, [pos])< / span >
< / code >
< div class = 'force-inline' >
< p > Add a ' like/ and like' clause to the query< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.like' class = 'mt0' >
like< span class = 'gray' > (field, val, [pos])< / span >
< / h2 >
< p > Add a ' like/ and like' clause to the query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name of the field to compare to< / p >
< / div >
< / li >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < /code> < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value to compare to< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > pos< / strong >
(default < code > both< / code > )
:
< div class = 'force-inline' >
< p > The placement of the wildcard character(s): before, after, or both< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.limit' >
< a href = '#QueryBuilder.limit' >
< code >
#limit< span class = 'gray' > (limit, [offset])< / span >
< / code >
< div class = 'force-inline' >
< p > Put a limit on the query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.limit' class = 'mt0' >
limit< span class = 'gray' > (limit, [offset])< / span >
< / h2 >
< p > Put a limit on the query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" > Number< / a > < / code > < strong > limit< / strong >
:
< div class = 'force-inline' >
< p > The maximum number of rows to fetch< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" > Number< / a > < / code > ]< / code > < strong > offset< / strong >
:
< div class = 'force-inline' >
< p > The row number to start from< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.notLike' >
< a href = '#QueryBuilder.notLike' >
< code >
#notLike< span class = 'gray' > (field, val, [pos])< / span >
< / code >
< div class = 'force-inline' >
< p > Add a ' not like/ and not like' clause to the query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.notLike' class = 'mt0' >
notLike< span class = 'gray' > (field, val, [pos])< / span >
< / h2 >
< p > Add a ' not like/ and not like' clause to the query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name of the field to compare to< / p >
< / div >
< / li >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value to compare to< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > pos< / strong >
(default < code > both< / code > )
:
< div class = 'force-inline' >
< p > The placement of the wildcard character(s): before, after, or both< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orGroupStart' >
< a href = '#QueryBuilder.orGroupStart' >
< code >
#orGroupStart< span class = 'gray' > < / span >
< / code >
< div class = 'force-inline' >
< p > Adds an open paren to the current query for logical grouping,
prefixed with ' OR' < / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orGroupStart' class = 'mt0' >
orGroupStart< span class = 'gray' > < / span >
< / h2 >
< p > Adds an open paren to the current query for logical grouping,
prefixed with ' OR' < / p >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orHaving' >
< a href = '#QueryBuilder.orHaving' >
< code >
#orHaving< span class = 'gray' > (key, [val])< / span >
< / code >
< div class = 'force-inline' >
< p > Add an ' or having' clause< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orHaving' class = 'mt0' >
orHaving< span class = 'gray' > (key, [val])< / span >
< / h2 >
< p > Add an ' or having' clause< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > The name of the field and the comparision operator, or an object< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" > Number< / a > < / code > ]< / code > < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value to compare if the value of key is a string< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orLike' >
< a href = '#QueryBuilder.orLike' >
< code >
#orLike< span class = 'gray' > (field, val, [pos])< / span >
< / code >
< div class = 'force-inline' >
< p > Add an ' or like' clause to the query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orLike' class = 'mt0' >
orLike< span class = 'gray' > (field, val, [pos])< / span >
< / h2 >
< p > Add an ' or like' clause to the query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name of the field to compare to< / p >
< / div >
< / li >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value to compare to< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > pos< / strong >
(default < code > both< / code > )
:
< div class = 'force-inline' >
< p > The placement of the wildcard character(s): before, after, or both< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orNotGroupStart' >
< a href = '#QueryBuilder.orNotGroupStart' >
< code >
#orNotGroupStart< span class = 'gray' > < / span >
< / code >
< div class = 'force-inline' >
< p > Adds an open paren to the current query for logical grouping,
prefixed with ' OR NOT' < / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orNotGroupStart' class = 'mt0' >
orNotGroupStart< span class = 'gray' > < / span >
< / h2 >
< p > Adds an open paren to the current query for logical grouping,
prefixed with ' OR NOT' < / p >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orNotLike' >
< a href = '#QueryBuilder.orNotLike' >
< code >
#orNotLike< span class = 'gray' > (field, val, [pos])< / span >
< / code >
< div class = 'force-inline' >
< p > Add an ' or not like' clause to the query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orNotLike' class = 'mt0' >
orNotLike< span class = 'gray' > (field, val, [pos])< / span >
< / h2 >
< p > Add an ' or not like' clause to the query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name of the field to compare to< / p >
< / div >
< / li >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value to compare to< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > pos< / strong >
(default < code > both< / code > )
:
< div class = 'force-inline' >
< p > The placement of the wildcard character(s): before, after, or both< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orWhere' >
< a href = '#QueryBuilder.orWhere' >
< code >
#orWhere< span class = 'gray' > (key, [val])< / span >
< / code >
< div class = 'force-inline' >
< p > Set a ' or where' clause< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orWhere' class = 'mt0' >
orWhere< span class = 'gray' > (key, [val])< / span >
< / h2 >
< p > Set a ' or where' clause< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > The name of the field and the comparision operator, or an object< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" > Number< / a > < / code > ]< / code > < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value to compare if the value of key is a string< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orWhereIn' >
< a href = '#QueryBuilder.orWhereIn' >
< code >
2016-01-26 20:23:52 -05:00
#orWhereIn< span class = 'gray' > (key, values)< / span >
2016-01-26 19:29:12 -05:00
< / code >
< div class = 'force-inline' >
< p > Set a ' or where in' clause< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orWhereIn' class = 'mt0' >
2016-01-26 20:23:52 -05:00
orWhereIn< span class = 'gray' > (key, values)< / span >
2016-01-26 19:29:12 -05:00
< / h2 >
< p > Set a ' or where in' clause< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > the field to search< / p >
< / div >
< / li >
2016-01-26 20:23:52 -05:00
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" > Array< / a > < / code > < strong > values< / strong >
2016-01-26 19:29:12 -05:00
:
< div class = 'force-inline' >
< p > the array of items to search in< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orWhereIsNotNull' >
< a href = '#QueryBuilder.orWhereIsNotNull' >
< code >
#orWhereIsNotNull< span class = 'gray' > (field)< / span >
< / code >
< div class = 'force-inline' >
< p > Field is not null prefixed with ' OR' < / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orWhereIsNotNull' class = 'mt0' >
orWhereIsNotNull< span class = 'gray' > (field)< / span >
< / h2 >
< p > Field is not null prefixed with ' OR' < / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name of the field< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orWhereIsNull' >
< a href = '#QueryBuilder.orWhereIsNull' >
< code >
#orWhereIsNull< span class = 'gray' > (field)< / span >
< / code >
< div class = 'force-inline' >
< p > Field is null prefixed with ' OR' < / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orWhereIsNull' class = 'mt0' >
orWhereIsNull< span class = 'gray' > (field)< / span >
< / h2 >
< p > Field is null prefixed with ' OR' < / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name of the field< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orWhereNotIn' >
< a href = '#QueryBuilder.orWhereNotIn' >
< code >
2016-01-26 20:23:52 -05:00
#orWhereNotIn< span class = 'gray' > (key, values)< / span >
2016-01-26 19:29:12 -05:00
< / code >
< div class = 'force-inline' >
< p > Set a ' or where not in' clause< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orWhereNotIn' class = 'mt0' >
2016-01-26 20:23:52 -05:00
orWhereNotIn< span class = 'gray' > (key, values)< / span >
2016-01-26 19:29:12 -05:00
< / h2 >
< p > Set a ' or where not in' clause< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > the field to search< / p >
< / div >
< / li >
2016-01-26 20:23:52 -05:00
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" > Array< / a > < / code > < strong > values< / strong >
2016-01-26 19:29:12 -05:00
:
< div class = 'force-inline' >
< p > the array of items to search in< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.orderBy' >
< a href = '#QueryBuilder.orderBy' >
< code >
#orderBy< span class = 'gray' > (field, [type])< / span >
< / code >
< div class = 'force-inline' >
< p > Order the results by the selected field(s)< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.orderBy' class = 'mt0' >
orderBy< span class = 'gray' > (field, [type])< / span >
< / h2 >
< p > Order the results by the selected field(s)< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The field(s) to order by< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > type< / strong >
(default < code > ' ASC' < / code > )
:
< div class = 'force-inline' >
< p > The order direction, ASC or DESC< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
2016-02-12 11:40:49 -05:00
< div class = 'collapsible' id = 'QueryBuilder.query' >
< a href = '#QueryBuilder.query' >
< code >
#query< span class = 'gray' > (sql, [params], [callback])< / span >
< / code >
< div class = 'force-inline' >
2016-02-12 12:50:59 -05:00
< p > Manually make an sql query< / p >
2016-02-12 11:40:49 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.query' class = 'mt0' >
query< span class = 'gray' > (sql, [params], [callback])< / span >
< / h2 >
2016-02-12 12:50:59 -05:00
< p > Manually make an sql query< / p >
2016-02-12 11:40:49 -05:00
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > string< / a > < / code > < strong > sql< / strong >
:
< div class = 'force-inline' >
< p > The sql to execute< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" > array< / a > < / code > ]< / code > < strong > params< / strong >
:
< div class = 'force-inline' >
< p > The query parameters< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function" > function< / a > < / code > ]< / code > < strong > callback< / strong >
:
< div class = 'force-inline' >
< p > Optional callback< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > void< / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" > Promise< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > Returns a promise if no callback is supplied< / p >
< / div >
< / section >
< / div >
< / div >
2016-01-26 19:29:12 -05:00
< div class = 'collapsible' id = 'QueryBuilder.resetQuery' >
< a href = '#QueryBuilder.resetQuery' >
< code >
#resetQuery< span class = 'gray' > < / span >
< / code >
< div class = 'force-inline' >
< p > Reset the object state for a new query< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.resetQuery' class = 'mt0' >
resetQuery< span class = 'gray' > < / span >
< / h2 >
< p > Reset the object state for a new query< / p >
< h4 > Returns< / h4 >
< code > < code > void< / code > < / code >
< div class = 'force-inline' >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.select' >
< a href = '#QueryBuilder.select' >
< code >
#select< span class = 'gray' > (fields)< / span >
< / code >
< div class = 'force-inline' >
< p > Specify rows to select in the query< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.select' class = 'mt0' >
select< span class = 'gray' > (fields)< / span >
< / h2 >
< p > Specify rows to select in the query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" > Array< / a > < / code > < strong > fields< / strong >
:
< div class = 'force-inline' >
< p > The fields to select from the current table< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
2016-01-26 20:23:52 -05:00
< h4 > Examples< / h4 >
< pre class = 'overflow-auto' > query.select(< span class = "hljs-string" > 'foo, bar'< / span > ); < span class = "hljs-comment" > // Select multiple fields with a string< / span > < / pre > < pre class = 'overflow-auto' > 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 >
2016-01-26 19:29:12 -05:00
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.set' >
< a href = '#QueryBuilder.set' >
< code >
#set< span class = 'gray' > (key, [val])< / span >
< / code >
< div class = 'force-inline' >
< p > Set values for insertion or updating< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.set' class = 'mt0' >
set< span class = 'gray' > (key, [val])< / span >
< / h2 >
< p > Set values for insertion or updating< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > The key or object to use< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > ]< / code > < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value if using a scalar key< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
2016-01-26 20:23:52 -05:00
< h4 > Examples< / h4 >
< pre class = 'overflow-auto' > 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 = 'overflow-auto' > query.set({foo:< span class = "hljs-string" > 'bar'< / span > }); < span class = "hljs-comment" > // Set with an object< / span > < / pre >
2016-01-26 19:29:12 -05:00
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.update' >
< a href = '#QueryBuilder.update' >
< code >
#update< span class = 'gray' > (table, [data], [callback])< / span >
< / code >
< div class = 'force-inline' >
< p > Run the generated update query< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.update' class = 'mt0' >
update< span class = 'gray' > (table, [data], [callback])< / span >
< / h2 >
< p > Run the generated update query< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > table< / strong >
:
< div class = 'force-inline' >
< p > The table to insert into< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > ]< / code > < strong > data< / strong >
:
< div class = 'force-inline' >
< p > Data to insert, if not already added with the ' set' method< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function" > Function< / a > < / code > ]< / code > < strong > callback< / strong >
:
< div class = 'force-inline' >
< p > Callback for handling response from the database< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > void< / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" > Promise< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > If no callback is passed, a promise is returned< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.where' >
< a href = '#QueryBuilder.where' >
< code >
#where< span class = 'gray' > (key, [val])< / span >
< / code >
< div class = 'force-inline' >
< p > Set a ' where' clause< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.where' class = 'mt0' >
where< span class = 'gray' > (key, [val])< / span >
< / h2 >
< p > Set a ' where' clause< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" > Object< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > The name of the field and the comparision operator, or an object< / p >
< / div >
< / li >
< li > < code > [< code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > or < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" > Number< / a > < / code > ]< / code > < strong > val< / strong >
:
< div class = 'force-inline' >
< p > The value to compare if the value of key is a string< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.whereIn' >
< a href = '#QueryBuilder.whereIn' >
< code >
2016-01-26 20:23:52 -05:00
#whereIn< span class = 'gray' > (key, values)< / span >
2016-01-26 19:29:12 -05:00
< / code >
< div class = 'force-inline' >
< p > Set a ' where in' clause< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.whereIn' class = 'mt0' >
2016-01-26 20:23:52 -05:00
whereIn< span class = 'gray' > (key, values)< / span >
2016-01-26 19:29:12 -05:00
< / h2 >
< p > Set a ' where in' clause< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > the field to search< / p >
< / div >
< / li >
2016-01-26 20:23:52 -05:00
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" > Array< / a > < / code > < strong > values< / strong >
2016-01-26 19:29:12 -05:00
:
< div class = 'force-inline' >
< p > the array of items to search in< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.whereIsNotNull' >
< a href = '#QueryBuilder.whereIsNotNull' >
< code >
#whereIsNotNull< span class = 'gray' > (field)< / span >
< / code >
< div class = 'force-inline' >
< p > Specify that a field IS NOT NULL< / p >
2015-11-20 09:21:46 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.whereIsNotNull' class = 'mt0' >
whereIsNotNull< span class = 'gray' > (field)< / span >
< / h2 >
< p > Specify that a field IS NOT NULL< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name so the field that is not to be null< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.whereIsNull' >
< a href = '#QueryBuilder.whereIsNull' >
< code >
#whereIsNull< span class = 'gray' > (field)< / span >
< / code >
< div class = 'force-inline' >
< p > Select a field that is Null< / p >
2014-10-20 16:56:45 -04:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.whereIsNull' class = 'mt0' >
whereIsNull< span class = 'gray' > (field)< / span >
< / h2 >
< p > Select a field that is Null< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > field< / strong >
:
< div class = 'force-inline' >
< p > The name of the field that has a NULL value< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
< div class = 'collapsible' id = 'QueryBuilder.whereNotIn' >
< a href = '#QueryBuilder.whereNotIn' >
< code >
2016-01-26 20:23:52 -05:00
#whereNotIn< span class = 'gray' > (key, values)< / span >
2016-01-26 19:29:12 -05:00
< / code >
< div class = 'force-inline' >
< p > Set a ' where not in' clause< / p >
2015-12-03 20:43:42 -05:00
2016-01-26 19:29:12 -05:00
< / div >
< / a >
< div class = 'collapser border px2' >
< section class = 'py2 clearfix' >
< h2 id = 'QueryBuilder.whereNotIn' class = 'mt0' >
2016-01-26 20:23:52 -05:00
whereNotIn< span class = 'gray' > (key, values)< / span >
2016-01-26 19:29:12 -05:00
< / h2 >
< p > Set a ' where not in' clause< / p >
< h4 > Parameters< / h4 >
< ul class = 'suppress-p-margin' >
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" > String< / a > < / code > < strong > key< / strong >
:
< div class = 'force-inline' >
< p > the field to search< / p >
< / div >
< / li >
2016-01-26 20:23:52 -05:00
< li > < code > < a href = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" > Array< / a > < / code > < strong > values< / strong >
2016-01-26 19:29:12 -05:00
:
< div class = 'force-inline' >
< p > the array of items to search in< / p >
< / div >
< / li >
< / ul >
< h4 > Returns< / h4 >
< code > < code > < a href = "#QueryBuilder" > QueryBuilder< / a > < / code > < / code >
:
< div class = 'force-inline' >
< p > The Query Builder object, for chaining< / p >
< / div >
< / section >
< / div >
< / div >
2015-11-20 09:21:46 -05:00
< / section >
< / div >
< / div >
< / div >
< / div >
< / div >
< script src = 'assets/anchor.js' > < / script >
< script src = 'assets/site.js' > < / script >
2014-10-20 16:56:45 -04:00
< / body >
2015-11-20 09:21:46 -05:00
< / html >