From 5f20e0adb4664c22e14ad9a067357216ddafa159 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Fri, 20 Nov 2015 09:21:46 -0500 Subject: [PATCH] Add back ES6 shim for older node versions --- docs/adapter.js.html | 197 - docs/adapters_mysql.js.html | 190 - docs/adapters_mysql2.js.html | 190 - docs/assets/anchor.js | 197 + docs/assets/bass.css | 850 +++ docs/assets/github.css | 123 + docs/assets/site.js | 40 + docs/assets/style.css | 95 + docs/driver.js.html | 339 - docs/drivers_mysql.js.html | 203 - docs/drivers_pg.js.html | 188 - docs/es6-polyfill.js.html | 254 - docs/global.html | 445 -- docs/helpers.js.html | 300 - docs/img/glyphicons-halflings-white.png | Bin 8777 -> 0 bytes docs/img/glyphicons-halflings.png | Bin 12799 -> 0 bytes docs/index.html | 2274 +++++- docs/module-State.html | 259 - docs/module-adapter.html | 445 -- docs/module-adapters_mysql.html | 255 - docs/module-adapters_mysql2.html | 255 - docs/module-driver.html | 261 - docs/module-helpers.html | 1118 --- docs/module-node-query.html | 576 -- docs/module-query-builder.html | 6729 ------------------ docs/module-query-parser.html | 878 --- docs/modules.list.html | 249 - docs/mysql.html | 261 - docs/mysql.js.html | 209 - docs/mysql.js_.html | 193 - docs/mysql2.html | 259 - docs/mysql2.js.html | 201 - docs/node-query.js.html | 238 - docs/pg.html | 261 - docs/pg.js.html | 192 - docs/query-builder.js.html | 1108 --- docs/query-parser.js.html | 438 -- docs/scripts/URI.js | 1429 ---- docs/scripts/bootstrap-dropdown.js | 169 - docs/scripts/bootstrap-tab.js | 144 - docs/scripts/docstrap.lib.js | 9 - docs/scripts/linenumber.js | 25 - docs/scripts/prettify/Apache-License-2.0.txt | 202 - docs/scripts/prettify/jquery.min.js | 6 - docs/scripts/prettify/lang-css.js | 21 - docs/scripts/prettify/prettify.js | 496 -- docs/scripts/sunlight.js | 1157 --- docs/scripts/toc.js | 100 - docs/state.js.html | 209 - docs/styles/darkstrap.css | 960 --- docs/styles/jsdoc-default.css | 333 - docs/styles/prettify-jsdoc.css | 111 - docs/styles/prettify-tomorrow.css | 132 - docs/styles/site.amelia.css | 6369 ----------------- docs/styles/site.cerulean.css | 5701 --------------- docs/styles/site.cosmo.css | 5944 ---------------- docs/styles/site.cyborg.css | 6151 ---------------- docs/styles/site.darkstrap.css | 5638 --------------- docs/styles/site.flatly.css | 5993 ---------------- docs/styles/site.journal.css | 5745 --------------- docs/styles/site.readable.css | 5433 -------------- docs/styles/site.simplex.css | 5758 --------------- docs/styles/site.slate.css | 6204 ---------------- docs/styles/site.spacelab.css | 5796 --------------- docs/styles/site.spruce.css | 5938 ---------------- docs/styles/site.superhero.css | 6106 ---------------- docs/styles/site.united.css | 5545 --------------- docs/styles/sunlight.dark.css | 345 - docs/styles/sunlight.default.css | 344 - lib/helpers.js | 1 + package.json | 3 +- 71 files changed, 3371 insertions(+), 105416 deletions(-) delete mode 100644 docs/adapter.js.html delete mode 100644 docs/adapters_mysql.js.html delete mode 100644 docs/adapters_mysql2.js.html create mode 100644 docs/assets/anchor.js create mode 100755 docs/assets/bass.css create mode 100644 docs/assets/github.css create mode 100644 docs/assets/site.js create mode 100644 docs/assets/style.css delete mode 100644 docs/driver.js.html delete mode 100644 docs/drivers_mysql.js.html delete mode 100644 docs/drivers_pg.js.html delete mode 100644 docs/es6-polyfill.js.html delete mode 100644 docs/global.html delete mode 100644 docs/helpers.js.html delete mode 100644 docs/img/glyphicons-halflings-white.png delete mode 100644 docs/img/glyphicons-halflings.png delete mode 100644 docs/module-State.html delete mode 100644 docs/module-adapter.html delete mode 100644 docs/module-adapters_mysql.html delete mode 100644 docs/module-adapters_mysql2.html delete mode 100644 docs/module-driver.html delete mode 100644 docs/module-helpers.html delete mode 100644 docs/module-node-query.html delete mode 100644 docs/module-query-builder.html delete mode 100644 docs/module-query-parser.html delete mode 100644 docs/modules.list.html delete mode 100644 docs/mysql.html delete mode 100644 docs/mysql.js.html delete mode 100644 docs/mysql.js_.html delete mode 100644 docs/mysql2.html delete mode 100644 docs/mysql2.js.html delete mode 100644 docs/node-query.js.html delete mode 100644 docs/pg.html delete mode 100644 docs/pg.js.html delete mode 100644 docs/query-builder.js.html delete mode 100644 docs/query-parser.js.html delete mode 100644 docs/scripts/URI.js delete mode 100644 docs/scripts/bootstrap-dropdown.js delete mode 100644 docs/scripts/bootstrap-tab.js delete mode 100644 docs/scripts/docstrap.lib.js delete mode 100644 docs/scripts/linenumber.js delete mode 100644 docs/scripts/prettify/Apache-License-2.0.txt delete mode 100644 docs/scripts/prettify/jquery.min.js delete mode 100644 docs/scripts/prettify/lang-css.js delete mode 100644 docs/scripts/prettify/prettify.js delete mode 100644 docs/scripts/sunlight.js delete mode 100644 docs/scripts/toc.js delete mode 100644 docs/state.js.html delete mode 100644 docs/styles/darkstrap.css delete mode 100644 docs/styles/jsdoc-default.css delete mode 100644 docs/styles/prettify-jsdoc.css delete mode 100644 docs/styles/prettify-tomorrow.css delete mode 100644 docs/styles/site.amelia.css delete mode 100644 docs/styles/site.cerulean.css delete mode 100644 docs/styles/site.cosmo.css delete mode 100644 docs/styles/site.cyborg.css delete mode 100644 docs/styles/site.darkstrap.css delete mode 100644 docs/styles/site.flatly.css delete mode 100644 docs/styles/site.journal.css delete mode 100644 docs/styles/site.readable.css delete mode 100644 docs/styles/site.simplex.css delete mode 100644 docs/styles/site.slate.css delete mode 100644 docs/styles/site.spacelab.css delete mode 100644 docs/styles/site.spruce.css delete mode 100644 docs/styles/site.superhero.css delete mode 100644 docs/styles/site.united.css delete mode 100644 docs/styles/sunlight.dark.css delete mode 100644 docs/styles/sunlight.default.css diff --git a/docs/adapter.js.html b/docs/adapter.js.html deleted file mode 100644 index 63393de..0000000 --- a/docs/adapter.js.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - DocStrap Source: adapter.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: adapter.js

- -
-
-
'use strict';
-
-/** @module adapter */
-module.exports = {
-
-	/**
-	 * Run the sql query as a prepared statement
-	 *
-	 * @param {String} sql - The sql with placeholders
-	 * @param {Array} params - The values to insert into the query
-	 * @param {Function} callback - Callback to run when a response is recieved
-	 * @return void
-	 */
-	execute: function(sql, params, callback) {
-		throw new Error("Correct adapter not defined for query execution");
-	}
-};
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/adapters_mysql.js.html b/docs/adapters_mysql.js.html deleted file mode 100644 index a177740..0000000 --- a/docs/adapters_mysql.js.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - DocStrap Source: adapters/mysql.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: adapters/mysql.js

- -
-
-
/** @module adapters/mysql */
-
-'use strict';
-
-var adapter = require('../lib/adapter.js');
-
-module.exports = function(instance) {
-
-	adapter.execute = function(sql, params, callback) {
-		instance.query(sql, params, callback);
-	};
-
-	return adapter;
-}
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-dev - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/adapters_mysql2.js.html b/docs/adapters_mysql2.js.html deleted file mode 100644 index b064cd0..0000000 --- a/docs/adapters_mysql2.js.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - DocStrap Source: adapters/mysql2.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: adapters/mysql2.js

- -
-
-
/** @module adapters/mysql2 */
-
-'use strict';
-
-var adapter = require('../lib/adapter.js');
-
-module.exports = function(instance) {
-
-	adapter.execute = function(sql, params, callback) {
-		instance.execute(sql, params, callback);
-	};
-
-	return adapter;
-}
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-dev - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/assets/anchor.js b/docs/assets/anchor.js new file mode 100644 index 0000000..47d871a --- /dev/null +++ b/docs/assets/anchor.js @@ -0,0 +1,197 @@ +/*! + * AnchorJS - v1.2.1 - 2015-07-02 + * https://github.com/bryanbraun/anchorjs + * Copyright (c) 2015 Bryan Braun; Licensed MIT + */ + +function AnchorJS(options) { + 'use strict'; + + this.options = options || {}; + + this._applyRemainingDefaultOptions = function(opts) { + this.options.icon = this.options.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'. + this.options.visible = this.options.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always' + this.options.placement = this.options.hasOwnProperty('placement') ? opts.placement : 'right'; // Also accepts 'left' + this.options.class = this.options.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name. + }; + + this._applyRemainingDefaultOptions(options); + + this.add = function(selector) { + var elements, + elsWithIds, + idList, + elementID, + i, + roughText, + tidyText, + index, + count, + newTidyText, + readableID, + anchor; + + this._applyRemainingDefaultOptions(this.options); + + // Provide a sensible default selector, if none is given. + if (!selector) { + selector = 'h1, h2, h3, h4, h5, h6'; + } else if (typeof selector !== 'string') { + throw new Error('The selector provided to AnchorJS was invalid.'); + } + + elements = document.querySelectorAll(selector); + if (elements.length === 0) { + return false; + } + + this._addBaselineStyles(); + + // We produce a list of existing IDs so we don't generate a duplicate. + elsWithIds = document.querySelectorAll('[id]'); + idList = [].map.call(elsWithIds, function assign(el) { + return el.id; + }); + + for (i = 0; i < elements.length; i++) { + + if (elements[i].hasAttribute('id')) { + elementID = elements[i].getAttribute('id'); + } else { + roughText = elements[i].textContent; + + // Refine it so it makes a good ID. Strip out non-safe characters, replace + // spaces with hyphens, truncate to 32 characters, and make toLowerCase. + // + // Example string: // '⚡⚡⚡ Unicode icons are cool--but they definitely don't belong in a URL fragment.' + tidyText = roughText.replace(/[^\w\s-]/gi, '') // ' Unicode icons are cool--but they definitely dont belong in a URL fragment' + .replace(/\s+/g, '-') // '-Unicode-icons-are-cool--but-they-definitely-dont-belong-in-a-URL-fragment' + .replace(/-{2,}/g, '-') // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL-fragment' + .substring(0, 64) // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' + .replace(/^-+|-+$/gm, '') // 'Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' + .toLowerCase(); // 'unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-url' + + // Compare our generated ID to existing IDs (and increment it if needed) + // before we add it to the page. + newTidyText = tidyText; + count = 0; + do { + if (index !== undefined) { + newTidyText = tidyText + '-' + count; + } + // .indexOf is supported in IE9+. + index = idList.indexOf(newTidyText); + count += 1; + } while (index !== -1); + index = undefined; + idList.push(newTidyText); + + // Assign it to our element. + // Currently the setAttribute element is only supported in IE9 and above. + elements[i].setAttribute('id', newTidyText); + + elementID = newTidyText; + } + + readableID = elementID.replace(/-/g, ' '); + + // The following code builds the following DOM structure in a more effiecient (albeit opaque) way. + // ''; + anchor = document.createElement('a'); + anchor.className = 'anchorjs-link ' + this.options.class; + anchor.href = '#' + elementID; + anchor.setAttribute('aria-label', 'Anchor link for: ' + readableID); + anchor.setAttribute('data-anchorjs-icon', this.options.icon); + + if (this.options.visible === 'always') { + anchor.style.opacity = '1'; + } + + if (this.options.icon === '\ue9cb') { + anchor.style.fontFamily = 'anchorjs-icons'; + anchor.style.fontStyle = 'normal'; + anchor.style.fontVariant = 'normal'; + anchor.style.fontWeight = 'normal'; + anchor.style.lineHeight = 1; + } + + if (this.options.placement === 'left') { + anchor.style.position = 'absolute'; + anchor.style.marginLeft = '-1em'; + anchor.style.paddingRight = '0.5em'; + elements[i].insertBefore(anchor, elements[i].firstChild); + } else { // if the option provided is `right` (or anything else). + anchor.style.paddingLeft = '0.375em'; + elements[i].appendChild(anchor); + } + } + + return this; + }; + + this.remove = function(selector) { + var domAnchor, + elements = document.querySelectorAll(selector); + for (var i = 0; i < elements.length; i++) { + domAnchor = elements[i].querySelector('.anchorjs-link'); + if (domAnchor) { + elements[i].removeChild(domAnchor); + } + } + return this; + }; + + this._addBaselineStyles = function() { + // We don't want to add global baseline styles if they've been added before. + if (document.head.querySelector('style.anchorjs') !== null) { + return; + } + + var style = document.createElement('style'), + linkRule = + ' .anchorjs-link {' + + ' opacity: 0;' + + ' text-decoration: none;' + + ' -webkit-font-smoothing: antialiased;' + + ' -moz-osx-font-smoothing: grayscale;' + + ' }', + hoverRule = + ' *:hover > .anchorjs-link,' + + ' .anchorjs-link:focus {' + + ' opacity: 1;' + + ' }', + anchorjsLinkFontFace = + ' @font-face {' + + ' font-family: "anchorjs-icons";' + + ' font-style: normal;' + + ' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above + ' src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBTUAAAC8AAAAYGNtYXAWi9QdAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zgq29TcAAAF4AAABNGhlYWQEZM3pAAACrAAAADZoaGVhBhUDxgAAAuQAAAAkaG10eASAADEAAAMIAAAAFGxvY2EAKACuAAADHAAAAAxtYXhwAAgAVwAAAygAAAAgbmFtZQ5yJ3cAAANIAAAB2nBvc3QAAwAAAAAFJAAAACAAAwJAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpywPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6cv//f//AAAAAAAg6cv//f//AAH/4xY5AAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzk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nMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' + + ' }', + pseudoElContent = + ' [data-anchorjs-icon]::after {' + + ' content: attr(data-anchorjs-icon);' + + ' }', + firstStyleEl; + + style.className = 'anchorjs'; + style.appendChild(document.createTextNode('')); // Necessary for Webkit. + + // We place it in the head with the other style tags, if possible, so as to + // not look out of place. We insert before the others so these styles can be + // overridden if necessary. + firstStyleEl = document.head.querySelector('[rel="stylesheet"], style'); + if (firstStyleEl === undefined) { + document.head.appendChild(style); + } else { + document.head.insertBefore(style, firstStyleEl); + } + + style.sheet.insertRule(linkRule, style.sheet.cssRules.length); + style.sheet.insertRule(hoverRule, style.sheet.cssRules.length); + style.sheet.insertRule(pseudoElContent, style.sheet.cssRules.length); + style.sheet.insertRule(anchorjsLinkFontFace, style.sheet.cssRules.length); + }; +} + +var anchors = new AnchorJS(); diff --git a/docs/assets/bass.css b/docs/assets/bass.css new file mode 100755 index 0000000..941c260 --- /dev/null +++ b/docs/assets/bass.css @@ -0,0 +1,850 @@ +/* + + Basscss v7.0.3 + Low-level CSS toolkit + http://basscss.com + + 14.88 kB + 3.38 kB Gzipped + 286 Rules + 328 Selectors + 441 Declarations + 95 Properties + +*/ + + + +body { margin: 0 } +img { max-width: 100% } +svg { max-height: 100% } + +input, +select, +textarea, +fieldset { + font-family: inherit; + font-size: 1rem; + box-sizing: border-box; + margin-top: 0; + margin-bottom: 0; +} + +label { + vertical-align: middle; +} + +input[type=text], +input[type=date], +input[type=datetime], +input[type=datetime-local], +input[type=email], +input[type=month], +input[type=number], +input[type=password], +input[type=search], +input[type=tel], +input[type=time], +input[type=url], +input[type=week] { + height: 2.25rem; + padding: .5rem .5rem; + vertical-align: middle; + -webkit-appearance: none; +} + +select { + line-height: 1.75; + padding: .5rem .5rem; +} + +select:not([multiple]) { + height: 2.25rem; + vertical-align: middle; +} + +textarea { + line-height: 1.75; + padding: .5rem .5rem; +} + +table { + border-collapse: separate; + border-spacing: 0; + max-width: 100%; + width: 100%; +} + +th { + text-align: left; + font-weight: bold; +} + +th, +td { + padding: .25rem 1rem; + line-height: inherit; +} + +th { vertical-align: bottom } +td { vertical-align: top } + +body { + font-family: 'Helvetica Neue', Helvetica, sans-serif; + line-height: 1.5; + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Helvetica Neue', Helvetica, sans-serif; + font-weight: bold; + line-height: 1.25; + margin-top: 1em; + margin-bottom: .5em; +} + +p { + margin-top: 0; + margin-bottom: 1rem; +} + +dl, ol, ul { + margin-top: 0; + margin-bottom: 1rem; +} + +pre, code, samp { + font-family: 'Source Code Pro', Consolas, monospace; + font-size: inherit; +} + +pre { + margin-top: 0; + margin-bottom: 1rem; + overflow-x: scroll; +} + +h1 { font-size: 2rem } +h2 { font-size: 1.5rem } +h3 { font-size: 1.25rem } +h4 { font-size: 1rem } +h5 { font-size: .875rem } +h6 { font-size: .75rem } + +body { + color: #111; + background-color: #fff; +} + +a { + color: #0074d9; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +pre, code { + background-color: transparent; + border-radius: 3px; +} + +hr { + border: 0; + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.125); +} + +.field { + border-style: solid; + border-width: 1px; + border-color: rgba(0,0,0,.125); + border-radius: 3px; +} + +.field:focus, +.field.is-focused { + outline: none; + border-color: #0074d9; + box-shadow: 0 0 0 2px rgba(0, 116, 217, 0.5); +} + +.field:disabled, +.field.is-disabled { + background-color: rgba(0,0,0,.125); + opacity: .5; +} + +.field:read-only:not(select), +.field.is-read-only { + background-color: rgba(0,0,0,.125); +} + + +.field.is-success { + border-color: #2ecc40; +} + +.field.is-success:focus, +.field.is-success.is-focused { + box-shadow: 0 0 0 2px rgba(46, 204, 64, 0.5); +} + +.field.is-warning { + border-color: #ffdc00; +} + +.field.is-warning:focus, +.field.is-warning.is-focused { + box-shadow: 0 0 0 2px rgba(255, 220, 0, 0.5); +} + +.field:invalid, +.field.is-error { + border-color: #ff4136; +} + +.field:invalid:focus, +.field:invalid.is-focused, +.field.is-error:focus, +.field.is-error.is-focused { + box-shadow: 0 0 0 2px rgba(255, 65, 54, 0.5); +} + +.table-light th, +.table-light td { + border-bottom-width: 1px; + border-bottom-style: solid; + border-bottom-color: rgba(0,0,0,.125); +} + +.table-light tr:last-child td { + border-bottom: 0; +} + +.btn { + font-family: inherit; + font-size: inherit; + font-weight: bold; + text-decoration: none; + cursor: pointer; + display: inline-block; + line-height: 1.125rem; + padding: .5rem 1rem; + margin: 0; + height: auto; + border: 1px solid transparent; + vertical-align: middle; + -webkit-appearance: none; + color: inherit; + background-color: transparent; +} + +.btn:hover { + text-decoration: none; +} + +.btn:focus { + outline: none; + border-color: rgba(0,0,0,.125); + box-shadow: 0 0 0 3px rgba(0,0,0,.25); +} + +::-moz-focus-inner { + border: 0; + padding: 0; +} + +.btn-primary { + color: #fff; + background-color: #0074d9; + border-radius: 3px; +} + +.btn-primary:hover { + box-shadow: inset 0 0 0 20rem rgba(0,0,0,.0625); +} + +.btn-primary:active { + box-shadow: inset 0 0 0 20rem rgba(0,0,0,.125), + inset 0 3px 4px 0 rgba(0,0,0,.25), + 0 0 1px rgba(0,0,0,.125); +} + +.btn-primary:disabled, +.btn-primary.is-disabled { + opacity: .5; +} + +.btn-outline, +.btn-outline:hover { + border-color: currentcolor; +} + +.btn-outline { + border-radius: 3px; +} + +.btn-outline:hover { + box-shadow: inset 0 0 0 20rem rgba(0,0,0,.0625); +} + +.btn-outline:active { + box-shadow: inset 0 0 0 20rem rgba(0,0,0,.125), + inset 0 3px 4px 0 rgba(0,0,0,.25), + 0 0 1px rgba(0,0,0,.125); +} + +.btn-outline:disabled, +.btn-outline.is-disabled { + opacity: .5; +} + +.h1 { font-size: 2rem } +.h2 { font-size: 1.5rem } +.h3 { font-size: 1.25rem } +.h4 { font-size: 1rem } +.h5 { font-size: .875rem } +.h6 { font-size: .75rem } + +.bold { font-weight: bold } +.regular { font-weight: normal } +.italic { font-style: italic } +.caps { text-transform: uppercase; letter-spacing: .2em; } + +.left-align { text-align: left } +.center { text-align: center } +.right-align { text-align: right } +.justify { text-align: justify } + +.nowrap { white-space: nowrap } +.break-word { word-wrap: break-word } + +.truncate { + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.list-reset { + list-style: none; + padding-left: 0; +} + +.inline { display: inline } +.block { display: block } +.inline-block { display: inline-block } +.table { display: table } +.table-cell { display: table-cell } + +.overflow-hidden { overflow: hidden } +.overflow-scroll { overflow: scroll } +.overflow-auto { overflow: auto } + +.clearfix:before, +.clearfix:after { + content: " "; + display: table +} +.clearfix:after { clear: both } + +.left { float: left } +.right { float: right } + +.fit { max-width: 100% } + +.border-box { box-sizing: border-box } + +.align-baseline { vertical-align: baseline } +.align-top { vertical-align: top } +.align-middle { vertical-align: middle } +.align-bottom { vertical-align: bottom } + +.m0 { margin: 0 } +.mt0 { margin-top: 0 } +.mr0 { margin-right: 0 } +.mb0 { margin-bottom: 0 } +.ml0 { margin-left: 0 } + +.m1 { margin: .5rem } +.mt1 { margin-top: .5rem } +.mr1 { margin-right: .5rem } +.mb1 { margin-bottom: .5rem } +.ml1 { margin-left: .5rem } + +.m2 { margin: 1rem } +.mt2 { margin-top: 1rem } +.mr2 { margin-right: 1rem } +.mb2 { margin-bottom: 1rem } +.ml2 { margin-left: 1rem } + +.m3 { margin: 2rem } +.mt3 { margin-top: 2rem } +.mr3 { margin-right: 2rem } +.mb3 { margin-bottom: 2rem } +.ml3 { margin-left: 2rem } + +.m4 { margin: 4rem } +.mt4 { margin-top: 4rem } +.mr4 { margin-right: 4rem } +.mb4 { margin-bottom: 4rem } +.ml4 { margin-left: 4rem } + +.mxn1 { margin-left: -.5rem; margin-right: -.5rem; } +.mxn2 { margin-left: -1rem; margin-right: -1rem; } +.mxn3 { margin-left: -2rem; margin-right: -2rem; } +.mxn4 { margin-left: -4rem; margin-right: -4rem; } + +.mx-auto { margin-left: auto; margin-right: auto; } +.p0 { padding: 0 } + +.p1 { padding: .5rem } +.py1 { padding-top: .5rem; padding-bottom: .5rem } +.px1 { padding-left: .5rem; padding-right: .5rem } + +.p2 { padding: 1rem } +.py2 { padding-top: 1rem; padding-bottom: 1rem } +.px2 { padding-left: 1rem; padding-right: 1rem } + +.p3 { padding: 2rem } +.py3 { padding-top: 2rem; padding-bottom: 2rem } +.px3 { padding-left: 2rem; padding-right: 2rem } + +.p4 { padding: 4rem } +.py4 { padding-top: 4rem; padding-bottom: 4rem } +.px4 { padding-left: 4rem; padding-right: 4rem } + +.relative { position: relative } +.absolute { position: absolute } +.fixed { position: fixed } + +.top-0 { top: 0 } +.right-0 { right: 0 } +.bottom-0 { bottom: 0 } +.left-0 { left: 0 } + +.z1 { z-index: 1 } +.z2 { z-index: 2 } +.z3 { z-index: 3 } +.z4 { z-index: 4 } + +.sm-show, .md-show, .lg-show { + display: none !important +} + +@media (min-width: 40em) { + .sm-show { display: block !important } +} + +@media (min-width: 52em) { + .md-show { display: block !important } +} + +@media (min-width: 64em) { + .lg-show { display: block !important } +} + + +@media (min-width: 40em) { + .sm-hide { display: none !important } +} + +@media (min-width: 52em) { + .md-hide { display: none !important } +} + +@media (min-width: 64em) { + .lg-hide { display: none !important } +} + +.display-none { display: none !important } + +.hide { + position: absolute !important; + height: 1px; + width: 1px; + overflow: hidden; + clip: rect(1px, 1px, 1px, 1px); +} + +.container { + max-width: 64em; + margin-left: auto; + margin-right: auto; +} +.col { + float: left; + box-sizing: border-box; +} + +.col-right { + float: right; + box-sizing: border-box; +} + +.col-1 { + width: 8.33333%; +} + +.col-2 { + width: 16.66667%; +} + +.col-3 { + width: 25%; +} + +.col-4 { + width: 33.33333%; +} + +.col-5 { + width: 41.66667%; +} + +.col-6 { + width: 50%; +} + +.col-7 { + width: 58.33333%; +} + +.col-8 { + width: 66.66667%; +} + +.col-9 { + width: 75%; +} + +.col-10 { + width: 83.33333%; +} + +.col-11 { + width: 91.66667%; +} + +.col-12 { + width: 100%; +} +@media (min-width: 40em) { + + .sm-col { + float: left; + box-sizing: border-box; + } + + .sm-col-right { + float: right; + box-sizing: border-box; + } + + .sm-col-1 { + width: 8.33333%; + } + + .sm-col-2 { + width: 16.66667%; + } + + .sm-col-3 { + width: 25%; + } + + .sm-col-4 { + width: 33.33333%; + } + + .sm-col-5 { + width: 41.66667%; + } + + .sm-col-6 { + width: 50%; + } + + .sm-col-7 { + width: 58.33333%; + } + + .sm-col-8 { + width: 66.66667%; + } + + .sm-col-9 { + width: 75%; + } + + .sm-col-10 { + width: 83.33333%; + } + + .sm-col-11 { + width: 91.66667%; + } + + .sm-col-12 { + width: 100%; + } + +} +@media (min-width: 52em) { + + .md-col { + float: left; + box-sizing: border-box; + } + + .md-col-right { + float: right; + box-sizing: border-box; + } + + .md-col-1 { + width: 8.33333%; + } + + .md-col-2 { + width: 16.66667%; + } + + .md-col-3 { + width: 25%; + } + + .md-col-4 { + width: 33.33333%; + } + + .md-col-5 { + width: 41.66667%; + } + + .md-col-6 { + width: 50%; + } + + .md-col-7 { + width: 58.33333%; + } + + .md-col-8 { + width: 66.66667%; + } + + .md-col-9 { + width: 75%; + } + + .md-col-10 { + width: 83.33333%; + } + + .md-col-11 { + width: 91.66667%; + } + + .md-col-12 { + width: 100%; + } + +} +@media (min-width: 64em) { + + .lg-col { + float: left; + box-sizing: border-box; + } + + .lg-col-right { + float: right; + box-sizing: border-box; + } + + .lg-col-1 { + width: 8.33333%; + } + + .lg-col-2 { + width: 16.66667%; + } + + .lg-col-3 { + width: 25%; + } + + .lg-col-4 { + width: 33.33333%; + } + + .lg-col-5 { + width: 41.66667%; + } + + .lg-col-6 { + width: 50%; + } + + .lg-col-7 { + width: 58.33333%; + } + + .lg-col-8 { + width: 66.66667%; + } + + .lg-col-9 { + width: 75%; + } + + .lg-col-10 { + width: 83.33333%; + } + + .lg-col-11 { + width: 91.66667%; + } + + .lg-col-12 { + width: 100%; + } + +} + +.flex { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex } + +.flex-column { -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column } +.flex-wrap { -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap } + +.flex-center { -webkit-box-align: center; -webkit-align-items: center; -ms-flex-align: center; align-items: center } +.flex-baseline { -webkit-box-align: baseline; -webkit-align-items: baseline; -ms-flex-align: baseline; align-items: baseline } +.flex-stretch { -webkit-box-align: stretch; -webkit-align-items: stretch; -ms-flex-align: stretch; align-items: stretch } +.flex-start { -webkit-box-align: start; -webkit-align-items: flex-start; -ms-flex-align: start; align-items: flex-start } +.flex-end { -webkit-box-align: end; -webkit-align-items: flex-end; -ms-flex-align: end; align-items: flex-end } + +.flex-justify { -webkit-box-pack: justify; -webkit-justify-content: space-between; -ms-flex-pack: justify; justify-content: space-between } + +.flex-auto { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + min-width: 0; + min-height: 0; +} +.flex-grow { -webkit-box-flex: 1; -webkit-flex: 1 0 auto; -ms-flex: 1 0 auto; flex: 1 0 auto } +.flex-none { -webkit-box-flex: 0; -webkit-flex: none; -ms-flex: none; flex: none } + +.flex-first { -webkit-box-ordinal-group: 0; -webkit-order: -1; -ms-flex-order: -1; order: -1 } +.flex-last { -webkit-box-ordinal-group: 100000; -webkit-order: 99999; -ms-flex-order: 99999; order: 99999 } +@media (min-width: 40em) { + .sm-flex { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex } +} +@media (min-width: 52em) { + .md-flex { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex } +} +@media (min-width: 64em) { + .lg-flex { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex } +} + +.border { + border-style: solid; + border-width: 1px; + border-color: rgba(0,0,0,.125); +} + +.border-top { + border-top-style: solid; + border-top-width: 1px; + border-top-color: rgba(0,0,0,.125); +} + +.border-right { + border-right-style: solid; + border-right-width: 1px; + border-right-color: rgba(0,0,0,.125); +} + +.border-bottom { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.125); +} + +.border-left { + border-left-style: solid; + border-left-width: 1px; + border-left-color: rgba(0,0,0,.125); +} + +.border-none { border: 0 } + +.rounded { border-radius: 3px } +.circle { border-radius: 50% } + +.rounded-top { border-radius: 3px 3px 0 0 } +.rounded-right { border-radius: 0 3px 3px 0 } +.rounded-bottom { border-radius: 0 0 3px 3px } +.rounded-left { border-radius: 3px 0 0 3px } + +.not-rounded { border-radius: 0 } + +.black { color: #111 } +.gray { color: #aaa } +.silver { color: #ddd } +.white { color: #fff } + +.aqua { color: #7fdbff } +.blue { color: #0074d9 } +.navy { color: #001f3f } +.teal { color: #39cccc } +.green { color: #2ecc40 } +.olive { color: #3d9970 } +.lime { color: #01ff70 } + +.yellow { color: #ffdc00 } +.orange { color: #ff851b } +.red { color: #ff4136 } +.fuchsia { color: #f012be } +.purple { color: #b10dc9 } +.maroon { color: #85144b } + +.color-inherit { color: inherit } +.muted { opacity: .5 } + +.bg-black { background-color: #111 } +.bg-gray { background-color: #aaa } +.bg-silver { background-color: #ddd } +.bg-white { background-color: #fff } + +.bg-aqua { background-color: #7fdbff } +.bg-blue { background-color: #0074d9 } +.bg-navy { background-color: #001f3f } +.bg-teal { background-color: #39cccc } +.bg-green { background-color: #2ecc40 } +.bg-olive { background-color: #3d9970 } +.bg-lime { background-color: #01ff70 } + +.bg-yellow { background-color: #ffdc00 } +.bg-orange { background-color: #ff851b } +.bg-red { background-color: #ff4136 } +.bg-fuchsia { background-color: #f012be } +.bg-purple { background-color: #b10dc9 } +.bg-maroon { background-color: #85144b } + +.bg-darken-1 { background-color: rgba(0,0,0,.0625) } +.bg-darken-2 { background-color: rgba(0,0,0,.125) } +.bg-darken-3 { background-color: rgba(0,0,0,.25) } +.bg-darken-4 { background-color: rgba(0,0,0,.5) } + +.bg-lighten-1 { background-color: rgba(255,255,255,.0625) } +.bg-lighten-2 { background-color: rgba(255,255,255,.125) } +.bg-lighten-3 { background-color: rgba(255,255,255,.25) } +.bg-lighten-4 { background-color: rgba(255,255,255,.5) } + + diff --git a/docs/assets/github.css b/docs/assets/github.css new file mode 100644 index 0000000..8852abb --- /dev/null +++ b/docs/assets/github.css @@ -0,0 +1,123 @@ +/* + +github.com style (c) Vasily Polovnyov + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #333; + background: #f8f8f8; + -webkit-text-size-adjust: none; +} + +.hljs-comment, +.diff .hljs-header, +.hljs-javadoc { + color: #998; + font-style: italic; +} + +.hljs-keyword, +.css .rule .hljs-keyword, +.hljs-winutils, +.nginx .hljs-title, +.hljs-subst, +.hljs-request, +.hljs-status { + color: #1184CE; +} + +.hljs-number, +.hljs-hexcolor, +.ruby .hljs-constant { + color: #ed225d; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.hljs-dartdoc, +.tex .hljs-formula { + color: #ed225d; +} + +.hljs-title, +.hljs-id, +.scss .hljs-preprocessor { + color: #900; + font-weight: bold; +} + +.hljs-list .hljs-keyword, +.hljs-subst { + font-weight: normal; +} + +.hljs-class .hljs-title, +.hljs-type, +.vhdl .hljs-literal, +.tex .hljs-command { + color: #458; + font-weight: bold; +} + +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-rules .hljs-property, +.django .hljs-tag .hljs-keyword { + color: #000080; + font-weight: normal; +} + +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body { + color: #008080; +} + +.hljs-regexp { + color: #009926; +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.lisp .hljs-keyword, +.clojure .hljs-keyword, +.scheme .hljs-keyword, +.tex .hljs-special, +.hljs-prompt { + color: #990073; +} + +.hljs-built_in { + color: #0086b3; +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-doctype, +.hljs-shebang, +.hljs-cdata { + color: #999; + font-weight: bold; +} + +.hljs-deletion { + background: #fdd; +} + +.hljs-addition { + background: #dfd; +} + +.diff .hljs-change { + background: #0086b3; +} + +.hljs-chunk { + color: #aaa; +} diff --git a/docs/assets/site.js b/docs/assets/site.js new file mode 100644 index 0000000..2cb0fb3 --- /dev/null +++ b/docs/assets/site.js @@ -0,0 +1,40 @@ +/* global anchors */ + +// add anchor links to headers +anchors.options.placement = 'left'; +anchors.add().remove('.no-anchor'); + +// Filter UI +var tocElements = document.getElementById('toc').getElementsByTagName('a'); +document.getElementById('filter-input').addEventListener('keyup', function(e) { + + var i, element; + + // enter key + if (e.keyCode === 13) { + // go to the first displayed item in the toc + for (i = 0; i < tocElements.length; i++) { + element = tocElements[i]; + if (!element.classList.contains('hide')) { + location.replace(element.href); + return e.preventDefault(); + } + } + } + + var match = function() { return true; }, + value = this.value.toLowerCase(); + + if (!value.match(/^\s*$/)) { + match = function(text) { return text.toLowerCase().indexOf(value) !== -1; }; + } + + for (i = 0; i < tocElements.length; i++) { + element = tocElements[i]; + if (match(element.innerHTML)) { + element.classList.remove('hide'); + } else { + element.classList.add('hide'); + } + } +}); diff --git a/docs/assets/style.css b/docs/assets/style.css new file mode 100644 index 0000000..a675e62 --- /dev/null +++ b/docs/assets/style.css @@ -0,0 +1,95 @@ +.documentation a { + color: #1184CE; +} + +.documentation .suppress-p-margin p { + margin:0; +} + +.force-inline p { + display: inline; + color: #222; +} + +.container-small { + max-width: 58rem; + margin-left: auto; + margin-right: auto; +} + +.max-height-100 { + max-height: 100%; +} + +.fade { + opacity:0.50; +} + +.button-indent { + padding: .25rem 1.5rem; + font-size: 90%; +} + +.section-indent { + border-left: 2px solid #eee; +} + +.bg-cloudy { + background: #fafafa; +} + +.force-inline * { + display:inline; +} + +section:target h3 { + font-weight:700; +} + +.documentation, +.documentation h1, +.documentation h2, +.documentation h3, +.documentation h4, +.documentation h5, +.documentation h6 { + font-family: 'Source Sans Pro', Helvetica, sans-serif; +} + +.documentation pre, +.documentation code, +.documentation samp { + font-family: 'Source Code Pro', monospace; + font-size: 90%; +} + +.documentation td, +.documentation th { + padding: .25rem .25rem; +} + +h1:hover .anchorjs-link, +h2:hover .anchorjs-link, +h3:hover .anchorjs-link, +h4:hover .anchorjs-link { + opacity: 1; +} + +.collapsible .collapser { + display:none; +} + +.collapsible:target .collapser { + display: block; +} + +.fix-3 { + width: 25%; + max-width: 244px; +} + +@media (min-width: 52em) { + .fix-margin-3 { + margin-left: 25%; + } +} diff --git a/docs/driver.js.html b/docs/driver.js.html deleted file mode 100644 index 4de251b..0000000 --- a/docs/driver.js.html +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - DocStrap Source: driver.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: driver.js

- -
-
-
'use strict';
-
-var helpers = require('./helpers');
-
-/**
- * Base Database Driver
- *
- * @module driver
- */
-var d = {
-	identifierChar: '"',
-	tablePrefix: null,
-	hasTruncate: true,
-
-	/**
-	 * Low level function for naive quoting of strings
-
-	 * @param {String} str
-	 * @return {String}
-	 * @private
-	 */
-	_quote: function(str) {
-		return (helpers.isString(str) && ! (str.startsWith(d.identifierChar) || str.endsWith(d.identifierChar)))
-			? d.identifierChar + str + d.identifierChar
-			: str;
-	},
-
-	/**
-	 * Set the limit clause
-
-	 * @param {String} sql
-	 * @param {Number} limit
-	 * @param {Number|null} offset
-	 * @return {String}
-	 */
-	limit: function(sql, limit, offset) {
-		sql += " LIMIT " + limit;
-
-		if (helpers.isNumber(offset))
-		{
-			sql += " OFFSET " + offset;
-		}
-
-		return sql;
-	},
-
-	/**
-	 * Quote database table name, and set prefix
-	 *
-	 * @param {String} table
-	 * @return {String}
-	 */
-	quoteTable: function(table) {
-		// Quote after prefix
-		return d.quoteIdentifiers(table);
-	},
-
-	/**
-	 * Use the driver's escape character to quote identifiers
-	 *
-	 * @param {String|Array}
-	 * @return {String|Array}
-	 */
-	quoteIdentifiers: function(str) {
-		var hiers, raw;
-		var pattern = new RegExp(d.identifierChar + '(' + '([a-zA-Z0-9_]+)' + '(\((.*?)\))' + ')' + d.identifierChar, 'ig');
-
-		// Recurse for arrays of identifiiers
-		if (Array.isArray(str))
-		{
-			return str.map(d.quoteIdentifiers);
-		}
-
-		// Handle commas
-		if (str.includes(','))
-		{
-			var parts = str.split(',').map(helpers.stringTrim);
-			str = parts.map(d.quoteIdentifiers).join(',');
-		}
-
-		// Split identifiers by period
-		hiers = str.split('.').map(d._quote);
-		raw = hiers.join('.');
-
-		// Fix functions
-		if (raw.includes('(') && raw.includes(')'))
-		{
-			var funcs = pattern.exec(raw);
-
-			// Unquote the function
-			raw = raw.replace(funcs[0], funcs[1]);
-
-			// Quote the identifiers inside of the parens
-			var inParens = funcs[3].substring(1, funcs[3].length -1);
-			raw = raw.replace(inParens, d.quoteIdentifiers(inParens));
-		}
-
-		return raw;
-	},
-
-	/**
-	 * SQL to truncate the passed table
-	 *
-	 * @param {String} table
-	 * @return {String} - sql
-	 */
-	truncate: function(table) {
-		var sql = (d.hasTruncate)
-			? 'TRUNCATE '
-			: 'DELETE FROM ';
-
-		sql += d.quoteTable(table);
-
-		return sql;
-	},
-
-	/**
-	 * SQL to insert a group of rows
-	 *
-	 * @param {String} table - The table to insert to
-	 * @param {Array} [data] - The array of object containing data to insert
-	 * @return {String}
-	 */
-	insertBatch: function(table, data) {
-
-		// Get the data values to insert, so they can
-		// be parameterized
-		var vals = [];
-		data.forEach(function(obj) {
-			Object.keys(obj).forEach(function(key) {
-				vals.push(obj[key]);
-			});
-		});
-
-		// Get the field names from the keys of the first
-		// object inserted
-		var fields = Object.keys(data[0]);
-		table = d.quoteTable(table);
-
-		var sql = "INSERT INTO " + table + " ("
-			+ d.quoteIdentifiers(fields).join(",")
-			+ ") VALUES ";
-
-		// Create placeholder groups
-		var params = new Array(fields.length).fill('?');
-		var paramString = "(" + params.join(',') + ")";
-		var paramList = new Array(data.length).fill(paramString);
-
-		sql += paramList.join(',');
-
-		return {
-			sql: sql,
-			values: vals
-		};
-	}
-
-};
-
-module.exports = d;
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/drivers_mysql.js.html b/docs/drivers_mysql.js.html deleted file mode 100644 index 7b12565..0000000 --- a/docs/drivers_mysql.js.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - DocStrap Source: drivers/mysql.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: drivers/mysql.js

- -
-
-
"use strict";
-
-/**
- * Driver for MySQL databases
- *
- * @returns {driver}
- */
-module.exports = function() {
-	var driver = require('../driver'),
-		helpers = require('../helpers');
-
-	driver.identifierChar = '`';
-
-	/**
-	 * Override default limit method because mysql likes to be different
-	 */
-	driver.limit = function(sql, limit, offset) {
-		if ( ! helpers.isNumber(offset))
-		{
-			return sql += " LIMIT " + limit;
-		}
-
-		return sql += " LIMIT " + offset + "," + limit;
-	};
-
-	return driver;
-};
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-dev - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/drivers_pg.js.html b/docs/drivers_pg.js.html deleted file mode 100644 index 18f084d..0000000 --- a/docs/drivers_pg.js.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - DocStrap Source: drivers/pg.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: drivers/pg.js

- -
-
-
"use strict";
-
-/**
- * Driver for PostgreSQL databases
- *
- * @returns {driver}
- */
-module.exports = function() {
-	var driver = require('../driver');
-
-	return driver;
-};
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-dev - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/es6-polyfill.js.html b/docs/es6-polyfill.js.html deleted file mode 100644 index 3d0211e..0000000 --- a/docs/es6-polyfill.js.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - DocStrap Source: es6-polyfill.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: es6-polyfill.js

- -
-
-
/**
- * Polyfills for very handy methods that are standardized, but not fully implemented in Javascript engines
- */
-module.exports = (function() {
-	if (!Array.prototype.fill) {
-		Array.prototype.fill = function(value) {
-			// Steps 1-2.
-			if (this == null) {
-				throw new TypeError('this is null or not defined');
-			}
-
-			var O = Object(this);
-
-			// Steps 3-5.
-			var len = O.length >>> 0;
-
-			// Steps 6-7.
-			var start = arguments[1];
-			var relativeStart = start >> 0;
-
-			// Step 8.
-			var k = relativeStart < 0 ?
-				Math.max(len + relativeStart, 0) :
-				Math.min(relativeStart, len);
-
-			// Steps 9-10.
-			var end = arguments[2];
-			var relativeEnd = end === undefined ?
-				len : end >> 0;
-
-			// Step 11.
-			var final = relativeEnd < 0 ?
-				Math.max(len + relativeEnd, 0) :
-				Math.min(relativeEnd, len);
-
-			// Step 12.
-			while (k < final) {
-				O[k] = value;
-				k++;
-			}
-
-			// Step 13.
-			return O;
-		};
-	}
-
-	if ( !String.prototype.contains ) {
-		String.prototype.contains = function() {
-			return String.prototype.indexOf.apply( this, arguments ) !== -1;
-		};
-	}
-
-	if (!String.prototype.startsWith) {
-		Object.defineProperty(String.prototype, 'startsWith', {
-			enumerable: false,
-			configurable: false,
-			writable: false,
-			value: function (searchString, position) {
-				position = position || 0;
-				return this.lastIndexOf(searchString, position) === position;
-			}
-		});
-	}
-
-	if (!String.prototype.endsWith) {
-		Object.defineProperty(String.prototype, 'endsWith', {
-			value: function (searchString, position) {
-				var subjectString = this.toString();
-				if (position === undefined || position > subjectString.length) {
-					position = subjectString.length;
-				}
-				position -= searchString.length;
-				var lastIndex = subjectString.indexOf(searchString, position);
-				return lastIndex !== -1 && lastIndex === position;
-			}
-		});
-	}
-}());
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Tue Oct 28th 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/global.html b/docs/global.html deleted file mode 100644 index 0050eee..0000000 --- a/docs/global.html +++ /dev/null @@ -1,445 +0,0 @@ - - - - - - DocStrap Global - - - - - - - - - -
- - -
- - -
- -
- - - -

Global

-
- -
-

- -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-

init(drivername, connObject, connLib) → {queryBuilder}

- - -
-
- - -
-

Create a query builder object

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
drivername - - -String - - - -

The name of the database type, eg. mysql or pg

connObject - - -Object - - - -

A connection object from the database library you are connecting with

connLib - - -String - - - -

The name of the db connection library you are using, eg. mysql or mysql2

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -queryBuilder - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Thu Oct 23rd 2014 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/helpers.js.html b/docs/helpers.js.html deleted file mode 100644 index 55ef1a0..0000000 --- a/docs/helpers.js.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - DocStrap Source: helpers.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: helpers.js

- -
-
-
"use strict";
-
-/** @module helpers */
-require('es6-shim');
-
-/** @alias module:helpers */
-var h = {
-	/**
-	 * Wrap String.prototype.trim in a way that is easily mappable
-	 *
-	 * @param {String} str - The string to trim
-	 * @return {String} - The trimmed string
-	 */
-	stringTrim: function(str) {
-		return str.trim();
-	},
-	/**
-	 * Get the type of the variable passed
-	 *
-	 * @see https://techblog.badoo.com/blog/2013/11/01/type-checking-in-javascript/
-	 * @see http://toddmotto.com/understanding-javascript-types-and-reliable-type-checking/
-	 * @param {mixed} o
-	 * @return {String}
-	 */
-	type: function (o) {
-	    var type = Object.prototype.toString.call(o).slice(8, -1).toLowerCase();
-
-	    // handle NaN and Infinity
-	    if (type === 'number') {
-	        if (isNaN(o)) {
-	            return 'nan';
-	        }
-	        if (!isFinite(o)) {
-	            return 'infinity';
-	        }
-	    }
-
-	    return type;
-	},
-	/**
-	 * Determine whether an object is scalar
-	 *
-	 * @param {mixed} obj
-	 * @return {bool}
-	 */
-	isScalar: function(obj) {
-		var scalar = ['string', 'number', 'boolean'];
-		return scalar.indexOf(h.type(obj)) !== -1;
-	},
-	/**
-	 * Get a list of values with a common key from an array of objects
-	 *
-	 * @param {Array} arr - The array of objects to search
-	 * @param {String} key - The key of the object to get
-	 * @return {Array}
-	 */
-	arrayPluck: function(arr, key) {
-		var output = [];
-
-		// Empty case
-		if (arr.length === 0) return output;
-
-		arr.forEach(function(obj) {
-			if ( ! h.isUndefined(obj[key]))
-			{
-				output.push(obj[key]);
-			}
-		});
-
-		return output;
-	},
-	/**
-	 * Determine if a value matching the passed regular expression is
-	 * in the passed array
-	 *
-	 * @param {Array} arr - The array to search
-	 * @param {RegExp} pattern - The pattern to match
-	 * @return {Boolean} - If an array item matches the pattern
-	 */
-	regexInArray: function(arr, pattern) {
-		// Empty case(s)
-		if ( ! h.isArray(arr)) return false;
-		if (arr.length === 0) return false;
-
-		var i, l = arr.length;
-
-		for(i=0; i< l; i++)
-		{
-			// Short circuit if any items match
-			if (pattern.test(arr[i])) return true;
-		}
-
-		return false;
-	}
-};
-
-// Define an 'is' method for each type
-var types = ['Null','Undefined','Object','Array','String','Number','Boolean','Function','RegExp','NaN','Infinite'];
-types.forEach(function (t) {
-	/**
-	 * Determine whether a variable is of the type specified in the
-	 * function name, eg isNumber
-	 *
-	 * Types available are Null, Undefined, Object, Array, String, Number, Boolean, Function, RegExp, NaN and Infinite
-	 *
-	 * @name is[type]
-	 * @param {mixed} o
-	 * @return {Boolean}
-	 */
-    h['is' + t] = function (o) {
-	    if (t.toLowerCase() === 'infinite')
-	    {
-		    t = 'infinity';
-	    }
-
-        return h.type(o) === t.toLowerCase();
-    };
-});
-
-module.exports = h;
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/img/glyphicons-halflings-white.png b/docs/img/glyphicons-halflings-white.png deleted file mode 100644 index 3bf6484a29d8da269f9bc874b25493a45fae3bae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8777 zcmZvC1yGz#v+m*$LXcp=A$ZWB0fL7wNbp_U*$~{_gL`my3oP#L!5tQYy99Ta`+g_q zKlj|KJ2f@c)ARJx{q*bbkhN_!|Wn*Vos8{TEhUT@5e;_WJsIMMcG5%>DiS&dv_N`4@J0cnAQ-#>RjZ z00W5t&tJ^l-QC*ST1-p~00u^9XJ=AUl7oW-;2a+x2k__T=grN{+1c4XK0ZL~^z^i$ zp&>vEhr@4fZWb380S18T&!0cQ3I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MYaw`E-rp49-oC1N_uZTo)Cu%RR2QWdHpzQIcNsoDp`3xfP+`gI?tVQZ4X={qU?(n zV>0ASES^Xuc;9JBji{)RnFL(Lez;8XbB1uWaMp@p?7xhXk6V#!6B@aP4Rz7-K%a>i z?fvf}va_DGUXlI#4--`A3qK7J?-HwnG7O~H2;zR~RLW)_^#La!=}+>KW#anZ{|^D3 B7G?kd diff --git a/docs/img/glyphicons-halflings.png b/docs/img/glyphicons-halflings.png deleted file mode 100644 index a9969993201f9cee63cf9f49217646347297b643..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12799 zcma*OWmH^Ivn@*S;K3nSf_t!#;0f+&pm7Po8`nk}2q8f5;M%x$SdAkd9FAvlc$ zx660V9e3Ox@4WZ^?7jZ%QFGU-T~%||Ug4iK6bbQY@zBuF2$hxOw9wF=A)nUSxR_5@ zEX>HBryGrjyuOFFv$Y4<+|3H@gQfEqD<)+}a~mryD|1U9*I_FOG&F%+Ww{SJ-V2BR zjt<81Ek$}Yb*95D4RS0HCps|uLyovt;P05hchQb-u2bzLtmog&f2}1VlNhxXV);S9 zM2buBg~!q9PtF)&KGRgf3#z7B(hm5WlNClaCWFs!-P!4-u*u5+=+D|ZE9e`KvhTHT zJBnLwGM%!u&vlE%1ytJ=!xt~y_YkFLQb6bS!E+s8l7PiPGSt9xrmg?LV&&SL?J~cI zS(e9TF1?SGyh+M_p@o1dyWu7o7_6p;N6hO!;4~ z2B`I;y`;$ZdtBpvK5%oQ^p4eR2L)BH>B$FQeC*t)c`L71gXHPUa|vyu`Bnz)H$ZcXGve(}XvR!+*8a>BLV;+ryG1kt0=)ytl zNJxFUN{V7P?#|Cp85QTa@(*Q3%K-R(Pkv1N8YU*(d(Y}9?PQ(j;NzWoEVWRD-~H$=f>j9~PN^BM2okI(gY-&_&BCV6RP&I$FnSEM3d=0fCxbxA6~l>54-upTrw zYgX@%m>jsSGi`0cQt6b8cX~+02IghVlNblR7eI;0ps}mpWUcxty1yG56C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I$k(Zj$d3(~)u(F%&xb8={N9hKxlZIO1ABsM{Mt|)2 zJ^t9Id;?%4PfR4&Ph9B9cFK~@tG3wlFW-0fXZS_L4U*EiAA%+`h%q2^6BCC;t0iO4V=s4Qug{M|iDV@s zC7|ef-dxiR7T&Mpre!%hiUhHM%3Qxi$Lzw6&(Tvlx9QA_7LhYq<(o~=Y>3ka-zrQa zhGpfFK@)#)rtfz61w35^sN1=IFw&Oc!Nah+8@qhJ0UEGr;JplaxOGI82OVqZHsqfX ze1}r{jy;G?&}Da}a7>SCDsFDuzuseeCKof|Dz2BPsP8? zY;a)Tkr2P~0^2BeO?wnzF_Ul-ekY=-w26VnU%U3f19Z-pj&2 z4J_a|o4Dci+MO)mPQIM>kdPG1xydiR9@#8m zh27D7GF{p|a{8({Q-Pr-;#jV{2zHR>lGoFtIfIpoMo?exuQyX_A;;l0AP4!)JEM$EwMInZkj+8*IHP4vKRd zKx_l-i*>A*C@{u%ct`y~s6MWAfO{@FPIX&sg8H{GMDc{4M3%$@c8&RAlw0-R<4DO3 trJqdc$mBpWeznn?E0M$F`|3v=`3%T2A17h;rxP7$%JLd=6(2u;`(N3pt&so# diff --git a/docs/index.html b/docs/index.html index 859dcd6..ed5f819 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,244 +1,2096 @@ - - - + - - DocStrap Index - - - - - - + + | Documentation + + + + + + +
+
+ +
+
+
+

+ NodeQuery +

+ +
+
+

+ QueryParser(Driver, driver) +

+ +

Parameters

+
    +
  • Driver + : + +

    The driver object for the database in use

    - -
    -
+
+

+ State +

+ +
+
+

+ h(o) +

+

Determine whether a variable is of the type specified in the +function name, eg isNumber

+

Types available are Null, Undefined, Object, Array, String, Number, Boolean, Function, RegExp, NaN and Infinite

- - - - -
-
+ + +
+
+

+ arrayPluck(arr, key) +

+

Get a list of values with a common key from an array of objects

+ +

Parameters

+
    +
  • Array arr + : + +

    The array of objects to search

    + +
    +
  • +
  • String key + : + +

    The key of the object to get

    + +
    +
  • +
+

Returns

+ Array + + + + +
+
+
+
+ + + .isScalar(obj) + + +

Determine whether an object is scalar

-
+ + +
+
+

+ isScalar(obj) +

+

Determine whether an object is scalar

+ +

Parameters

+
    +
  • mixed obj + : + + + +
  • +
+

Returns

+ bool + + + + +
+
+
+
+ + + .regexInArray(arr, pattern) + + +

Determine if a value matching the passed regular expression is +in the passed array

- -
- -
- - - - - Index - - - - - - - - - - - - - - - - - - - - - -
-

CI-Node-query

A node query builder for various SQL databases, based on CodeIgniter's query builder.

-

Build Status

-

Supported adapters

    -
  • mysql
  • -
  • mysql2
  • -
  • pg
  • -
  • dblite
  • -
  • node-firebird
  • -
-

Installation

npm install ci-node-query

Basic use

var nodeQuery = require('ci-node-query');
+            
+          
+          
+
+

+ regexInArray(arr, pattern) +

+

Determine if a value matching the passed regular expression is + in the passed array

+ +

Parameters

+
    +
  • Array arr + : + +

    The array to search

    + +
    +
  • +
  • RegExp pattern + : + +

    The pattern to match

    + +
    +
  • +
+

Returns

+ Boolean + : + +

If an array item matches the pattern

+ +
+
+
+
+
+ + + .stringTrim(str) + + +

Wrap String.prototype.trim in a way that is easily mappable

-var connection = ... // Database module connection +
+
+
+
+

+ stringTrim(str) +

+

Wrap String.prototype.trim in a way that is easily mappable

+ +

Parameters

+
    +
  • String str + : + +

    The string to trim

    + +
    +
  • +
+

Returns

+ String + : + +

The trimmed string

+ +
+
+
+
+ + +
+

+ h(str) +

+ +

Parameters

+
    +
  • str + : + + + +
  • +
+

Static members

+
+ + + .arrayPluck(arr, key) + + +

Get a list of values with a common key from an array of objects

-// The third argument is optional if the database connection library has the same name as the adapter, eg.. -nodeQuery.init('mysql', connection, 'mysql'); -// Can be instead -nodeQuery.init('mysql', connection); +
+
+
+
+

+ arrayPluck(arr, key) +

+

Get a list of values with a common key from an array of objects

+ +

Parameters

+
    +
  • Array arr + : + +

    The array of objects to search

    + +
    +
  • +
  • String key + : + +

    The key of the object to get

    + +
    +
  • +
+

Returns

+ Array + + + + +
+
+
+
+ + + .isScalar(obj) + + +

Determine whether an object is scalar

-// You can also retrieve the instance later -query = nodeQuery.getQuery(); +
+
+
+
+

+ isScalar(obj) +

+

Determine whether an object is scalar

+ +

Parameters

+
    +
  • mixed obj + : + + + +
  • +
+

Returns

+ bool + + + + +
+
+
+
- - - - - - + + +
+
+

+ regexInArray(arr, pattern) +

+

Determine if a value matching the passed regular expression is + in the passed array

+ +

Parameters

+
    +
  • Array arr + : + +

    The array to search

    + +
    +
  • +
  • RegExp pattern + : + +

    The pattern to match

    + +
    +
  • +
+

Returns

+ Boolean + : + +

If an array item matches the pattern

+ +
+
+
+
+ + + +
+
+

+ stringTrim(str) +

+

Wrap String.prototype.trim in a way that is easily mappable

+ +

Parameters

+
    +
  • String str + : + +

    The string to trim

    + +
    +
  • +
+

Returns

+ String + : + +

The trimmed string

+ +
+
+
+
+ + + +
+
+

+ type(o) +

+

Get the type of the variable passed

+ +

Parameters

+
    +
  • mixed o + : + + + +
  • +
+

Returns

+ String + + + + +
+
+
+ +
+

+ compileJoin(condition) +

+

Return the output of the parsing of the join condition

- -
-
-
- -
-
+

Parameters

+
    +
  • String condition + : + +

    The join condition to evalate

    -
- - - - + + + +

Returns

+ String + : + +

The parsed/escaped join condition

- +
+ + +

Returns

+ + : + +

this

+
+ +
+

+ get([table], [limit], [offset], callback) +

+

Get the results of the compiled query

+

Parameters

+
    +
  • [String] table + : + +

    The table to select from

    - - +
    +
  • +
  • [Number] limit + : + +

    A limit for the query

    +
    +
  • +
  • [Number] offset + : + +

    An offset for the query

    - - +
    +
  • +
  • Function callback + : + +

    A callback for receiving the result

    +
    +
  • +
+

Returns

+ + : + +

void

+ +
+
+
+

+ getArgs +

+ +
+
+

+ getCompiledDelete(table, [reset]) +

+

Return generated delete query SQL

+ +

Parameters

+
    +
  • String table + : + +

    the name of the table to delete from

    + +
    +
  • +
  • [Boolean] reset + (default true) + : + +

    Whether to reset the query builder so another query can be built

    + +
    +
  • +
+

Returns

+ String + + + + +
+
+

+ getCompiledInsert(table, [reset]) +

+

Return generated insert query SQL

+ +

Parameters

+
    +
  • String table + : + +

    the name of the table to insert into

    + +
    +
  • +
  • [Boolean] reset + (default true) + : + +

    Whether to reset the query builder so another query can be built

    + +
    +
  • +
+

Returns

+ String + + + + +
+
+

+ getCompiledSelect([table], [reset]) +

+

Return generated select query SQL

+ +

Parameters

+
    +
  • [String] table + : + +

    the name of the table to retrieve from

    + +
    +
  • +
  • [Boolean] reset + (default true) + : + +

    Whether to reset the query builder so another query can be built

    + +
    +
  • +
+

Returns

+ + : + +

String

+ +
+
+
+

+ getCompiledUpdate(table, [reset]) +

+

Return generated update query SQL

+ +

Parameters

+
    +
  • String table + : + +

    the name of the table to update

    + +
    +
  • +
  • [Boolean] reset + (default true) + : + +

    Whether to reset the query builder so another query can be built

    + +
    +
  • +
+

Returns

+ String + + + + +
+
+

+ getQuery +

+

Return an existing query builder instance

+ +

Returns

+ queryBuilder + + + + +
+
+

+ groupBy(field) +

+

Group the results by the selected field(s)

+ +

Parameters

+ +

Returns

+ + : + +

this

+ +
+
+
+

+ groupEnd +

+

Ends a logical grouping started with one of the groupStart methods

+ +

Returns

+ + : + +

this

+ +
+
+
+

+ groupStart +

+

Adds an open paren to the current query for logical grouping

+ +

Returns

+ + : + +

this

+ +
+
+
+

+ hasOperator(string) +

+

Check if the string contains an operator, and if so, return the operator(s). +If there are no matches, return null

+ +

Parameters

+
    +
  • String string + : + +

    the string to check

    + +
    +
  • +
+

Returns

+ Array or + + + + +
+
+

+ having(key, [val]) +

+

Add a 'having' clause

+ +

Parameters

+
    +
  • String or Object key + : + +

    The name of the field and the comparision operator, or an object

    + +
    +
  • +
  • [String or Number] val + : + +

    The value to compare if the value of key is a string

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ helpers(str) +

+ +

Parameters

+
    +
  • str + : + + + +
  • +
+
+
+

+ init(drivername, driverType, connObject, [connLib]) +

+

Create a query builder object

+ +

Parameters

+
    +
  • String drivername + : + +

    The name of the database type, eg. mysql or pg

    + +
    +
  • +
  • driverType + : + + + +
  • +
  • Object connObject + : + +

    A connection object from the database library you are connecting with

    + +
    +
  • +
  • [String] connLib + : + +

    The name of the db connection library you are using, eg. mysql or mysql2. Optional if the same as drivername

    + +
    +
  • +
+

Returns

+ queryBuilder + + + + +
+
+

+ insert(table, [data], callback) +

+

Run the generated insert query

+ +

Parameters

+
    +
  • String table + : + +

    The table to insert into

    + +
    +
  • +
  • [Object] data + : + +

    Data to insert, if not already added with the 'set' method

    + +
    +
  • +
  • Function callback + : + +

    Callback for handling response from the database

    + +
    +
  • +
+

Returns

+ + : + +

void

+ +
+
+
+

+ insertBatch(table, data, callback) +

+

Insert multiple sets of rows at a time

+ +

Parameters

+
    +
  • String table + : + +

    The table to insert into

    + +
    +
  • +
  • Array data + : + +

    The array of objects containing data rows to insert

    + +
    +
  • +
  • Function callback + : + +

    Callback for handling database response

    + +
    +
  • +
+

Returns

+ + : + +

void

+ +
+

Examples

+
query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}], callbackFunction);
+
+
+

+ join(table, cond, [type]) +

+

Add a join clause to the query

+ +

Parameters

+
    +
  • String table + : + +

    The table you are joining

    + +
    +
  • +
  • String cond + : + +

    The join condition.

    + +
    +
  • +
  • [String] type + (default 'inner') + : + +

    The type of join, which defaults to inner

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ like(field, val, [pos]) +

+

Add a 'like/ and like' clause to the query

+ +

Parameters

+
    +
  • String field + : + +

    The name of the field to compare to

    + +
    +
  • +
  • String val + : + +

    The value to compare to

    + +
    +
  • +
  • [String] pos + (default both) + : + +

    The placement of the wildcard character(s): before, after, or both

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ limit(limit, [offset]) +

+

Put a limit on the query

+ +

Parameters

+
    +
  • Number limit + : + +

    The maximum number of rows to fetch

    + +
    +
  • +
  • [Number] offset + : + +

    The row number to start from

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ notLike(field, val, [pos]) +

+

Add a 'not like/ and not like' clause to the query

+ +

Parameters

+
    +
  • String field + : + +

    The name of the field to compare to

    + +
    +
  • +
  • String val + : + +

    The value to compare to

    + +
    +
  • +
  • [String] pos + (default both) + : + +

    The placement of the wildcard character(s): before, after, or both

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orGroupStart +

+

Adds an open paren to the current query for logical grouping, +prefixed with 'OR'

+ +

Returns

+ + : + +

this

+ +
+
+
+

+ orHaving(key, [val]) +

+

Add an 'or having' clause

+ +

Parameters

+
    +
  • String or Object key + : + +

    The name of the field and the comparision operator, or an object

    + +
    +
  • +
  • [String or Number] val + : + +

    The value to compare if the value of key is a string

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orLike(field, val, [pos]) +

+

Add an 'or like' clause to the query

+ +

Parameters

+
    +
  • String field + : + +

    The name of the field to compare to

    + +
    +
  • +
  • String val + : + +

    The value to compare to

    + +
    +
  • +
  • [String] pos + (default both) + : + +

    The placement of the wildcard character(s): before, after, or both

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orNotGroupStart +

+

Adds an open paren to the current query for logical grouping, +prefixed with 'OR NOT'

+ +

Returns

+ + : + +

this

+ +
+
+
+

+ orNotLike(field, val, [pos]) +

+

Add an 'or not like' clause to the query

+ +

Parameters

+
    +
  • String field + : + +

    The name of the field to compare to

    + +
    +
  • +
  • String val + : + +

    The value to compare to

    + +
    +
  • +
  • [String] pos + (default both) + : + +

    The placement of the wildcard character(s): before, after, or both

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orWhere(key, [val]) +

+

Set a 'or where' clause

+ +

Parameters

+
    +
  • String or Object key + : + +

    The name of the field and the comparision operator, or an object

    + +
    +
  • +
  • [String or Number] val + : + +

    The value to compare if the value of key is a string

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orWhereIn(key, val) +

+

Set a 'or where in' clause

+ +

Parameters

+
    +
  • String key + : + +

    the field to search

    + +
    +
  • +
  • Array val + : + +

    the array of items to search in

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orWhereIsNotNull(field) +

+

Field is not null prefixed with 'OR'

+ +

Parameters

+
    +
  • String field + : + + + +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orWhereIsNull(field) +

+

Field is null prefixed with 'OR'

+ +

Parameters

+
    +
  • String field + : + + + +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orWhereNotIn(key, val) +

+

Set a 'or where not in' clause

+ +

Parameters

+
    +
  • String key + : + +

    the field to search

    + +
    +
  • +
  • Array val + : + +

    the array of items to search in

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ orderBy(field, [type]) +

+

Order the results by the selected field(s)

+ +

Parameters

+
    +
  • String field + : + +

    The field(s) to order by

    + +
    +
  • +
  • [String] type + (default 'ASC') + : + +

    The order direction, ASC or DESC

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ parseJoin(sql) +

+

Tokenize the sql into parts for additional processing

+ +

Parameters

+ +

Returns

+ Object + + + + +
+
+

+ parseWhere(driver, state) +

+

Parse a where clause to separate functions from values

+ +

Parameters

+
    +
  • Object driver + : + + + +
  • +
  • State state + : + + + +
  • +
+

Returns

+ String + : + +

The parsed/escaped where condition

+ +
+
+
+

+ resetQuery +

+

Reset the object state for a new query

+ +

Returns

+ + : + +

void

+ +
+
+
+

+ select(fields) +

+

Specify rows to select in the query

+ +

Parameters

+
    +
  • String or Array fields + : + +

    The fields to select from the current table

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ set(key, [val]) +

+

Set values for insertion or updating

+ +

Parameters

+
    +
  • String or Object key + : + +

    The key or object to use

    + +
    +
  • +
  • [String] val + : + +

    The value if using a scalar key

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ update(table, [data], callback) +

+

Run the generated update query

+ +

Parameters

+
    +
  • String table + : + +

    The table to insert into

    + +
    +
  • +
  • [Object] data + : + +

    Data to insert, if not already added with the 'set' method

    + +
    +
  • +
  • Function callback + : + +

    Callback for handling response from the database

    + +
    +
  • +
+

Returns

+ + : + +

void

+ +
+
+
+

+ where(key, [val]) +

+

Set a 'where' clause

+ +

Parameters

+
    +
  • String or Object key + : + +

    The name of the field and the comparision operator, or an object

    + +
    +
  • +
  • [String or Number] val + : + +

    The value to compare if the value of key is a string

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ whereIn(key, val) +

+

Set a 'where in' clause

+ +

Parameters

+
    +
  • String key + : + +

    the field to search

    + +
    +
  • +
  • Array val + : + +

    the array of items to search in

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ whereIsNotNull(field) +

+

Specify that a field IS NOT NULL

+ +

Parameters

+
    +
  • String field + : + + + +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ whereIsNull(field) +

+

Select a field that is Null

+ +

Parameters

+
    +
  • String field + : + +

    The name of the field that has a NULL value

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+

+ whereNotIn(key, val) +

+

Set a 'where not in' clause

+ +

Parameters

+
    +
  • String key + : + +

    the field to search

    + +
    +
  • +
  • Array val + : + +

    the array of items to search in

    + +
    +
  • +
+

Returns

+ + : + +

this

+ +
+
+
+ + + + + + - \ No newline at end of file + diff --git a/docs/module-State.html b/docs/module-State.html deleted file mode 100644 index 615644c..0000000 --- a/docs/module-State.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - DocStrap Module: State - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: State

-
- -
-

- State -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-adapter.html b/docs/module-adapter.html deleted file mode 100644 index 87b9db9..0000000 --- a/docs/module-adapter.html +++ /dev/null @@ -1,445 +0,0 @@ - - - - - - DocStrap Module: adapter - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: adapter

-
- -
-

- adapter -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-

<static> execute(sql, params, callback)

- - -
-
- - -
-

Run the sql query as a prepared statement

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
sql - - -String - - - -

The sql with placeholders

params - - -Array - - - -

The values to insert into the query

callback - - -function - - - -

Callback to run when a response is recieved

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

void

-
- - - - - - - -
- -
- - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-adapters_mysql.html b/docs/module-adapters_mysql.html deleted file mode 100644 index 942f655..0000000 --- a/docs/module-adapters_mysql.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - DocStrap Module: adapters/mysql - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: adapters/mysql

-
- -
-

- adapters/mysql -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-dev - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-adapters_mysql2.html b/docs/module-adapters_mysql2.html deleted file mode 100644 index 0571c05..0000000 --- a/docs/module-adapters_mysql2.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - DocStrap Module: adapters/mysql2 - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: adapters/mysql2

-
- -
-

- adapters/mysql2 -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-dev - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-driver.html b/docs/module-driver.html deleted file mode 100644 index a473fff..0000000 --- a/docs/module-driver.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - DocStrap Module: driver - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: driver

-
- -
-

- driver -

- -
- -
-
- - - - -

Base Database Driver

- - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-helpers.html b/docs/module-helpers.html deleted file mode 100644 index 456fd04..0000000 --- a/docs/module-helpers.html +++ /dev/null @@ -1,1118 +0,0 @@ - - - - - - DocStrap Module: helpers - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: helpers

-
- -
-

- helpers -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - -

Members

- -
- -
-

<inner> is[type]

- - -
-
- -
-

Determine whether a variable is of the type specified in the -function name, eg isNumber

-

Types available are Null, Undefined, Object, Array, String, Number, Boolean, Function, RegExp, NaN and Infinite

-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - -
- -
- - - -

Methods

- -
- -
-

<static> arrayPluck(arr, key) → {Array}

- - -
-
- - -
-

Get a list of values with a common key from an array of objects

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arr - - -Array - - - -

The array of objects to search

key - - -String - - - -

The key of the object to get

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Array - - -
-
- - - - - -
- - - -
-

<static> isScalar(obj) → {bool}

- - -
-
- - -
-

Determine whether an object is scalar

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
obj - - -mixed - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -bool - - -
-
- - - - - -
- - - -
-

<static> regexInArray(arr, pattern) → {Boolean}

- - -
-
- - -
-

Determine if a value matching the passed regular expression is -in the passed array

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
arr - - -Array - - - -

The array to search

pattern - - -RegExp - - - -

The pattern to match

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-
    -
  • If an array item matches the pattern
  • -
-
- - - -
-
- Type -
-
- -Boolean - - -
-
- - - - - -
- - - -
-

<static> stringTrim(str) → {String}

- - -
-
- - -
-

Wrap String.prototype.trim in a way that is easily mappable

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
str - - -String - - - -

The string to trim

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-
    -
  • The trimmed string
  • -
-
- - - -
-
- Type -
-
- -String - - -
-
- - - - - -
- - - -
-

<static> type(o) → {String}

- - -
-
- - -
-

Get the type of the variable passed

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
o - - -mixed - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -String - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-node-query.html b/docs/module-node-query.html deleted file mode 100644 index c71a318..0000000 --- a/docs/module-node-query.html +++ /dev/null @@ -1,576 +0,0 @@ - - - - - - DocStrap Module: node-query - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: node-query

-
- -
-

- node-query -

- -
- -
-
- - -
-

require("node-query")(drivername, connObject, connLib) → {queryBuilder}

- - -
-
- - -
-

Create a query builder object

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
drivername - - -String - - - - - - - - - -

The name of the database type, eg. mysql or pg

connObject - - -Object - - - - - - - - - -

A connection object from the database library you are connecting with

connLib - - -String - - - - - - <optional>
- - - - - -

The name of the db connection library you are using, eg. mysql or mysql2. Optional if the same as drivername

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -queryBuilder - - -
-
- - - - - -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-

getQuery() → {queryBuilder}

- - -
-
- - -
-

Return an existing query builder instance

-
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -queryBuilder - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-query-builder.html b/docs/module-query-builder.html deleted file mode 100644 index cf0354c..0000000 --- a/docs/module-query-builder.html +++ /dev/null @@ -1,6729 +0,0 @@ - - - - - - DocStrap Module: query-builder - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: query-builder

-
- -
-

- query-builder -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - -

Members

- -
- -
-

<private, inner> state

- - -
-
- -
-

Variables controlling the sql building

-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - -
- -
- - - -

Methods

- -
- -
-

delete(table, where, callback)

- - -
-
- - -
-

Run the generated delete query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
table - - -String - - - - - - - - - -

The table to insert into

where - - -Object - - - - - - <optional>
- - - - - -

Where clause for delete statement

callback - - -function - - - - - - - - - -

Callback for handling response from the database

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

void

-
- - - - - - - -
- - - -
-

end()

- - -
-
- - -
-

Closes the database connection for the current adapter

-
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

void

-
- - - - - - - -
- - - -
-

from(tableName)

- - -
-
- - -
-

Specify the database table to select from

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
tableName - - -String - - - -

The table to use for the current query

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

get(table, limit, offset, callback)

- - -
-
- - -
-

Get the results of the compiled query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
table - - -String - - - - - - <optional>
- - - - - -

The table to select from

limit - - -Number - - - - - - <optional>
- - - - - -

A limit for the query

offset - - -Number - - - - - - <optional>
- - - - - -

An offset for the query

callback - - -function - - - - - - - - - -

A callback for receiving the result

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

void

-
- - - - - - - -
- - - -
-

getCompiledDelete(table, reset) → {String}

- - -
-
- - -
-

Return generated delete query SQL

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
table - - -String - - - - - - - - - - - -

the name of the table to delete from

reset - - -Boolean - - - - - - <optional>
- - - - - -
- - true - -

Whether to reset the query builder so another query can be built

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -String - - -
-
- - - - - -
- - - -
-

getCompiledInsert(table, reset) → {String}

- - -
-
- - -
-

Return generated insert query SQL

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
table - - -String - - - - - - - - - - - -

the name of the table to insert into

reset - - -Boolean - - - - - - <optional>
- - - - - -
- - true - -

Whether to reset the query builder so another query can be built

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -String - - -
-
- - - - - -
- - - -
-

getCompiledSelect(table, reset)

- - -
-
- - -
-

Return generated select query SQL

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
table - - -String - - - - - - <optional>
- - - - - -
- -

the name of the table to retrieve from

reset - - -Boolean - - - - - - <optional>
- - - - - -
- - true - -

Whether to reset the query builder so another query can be built

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

String

-
- - - - - - - -
- - - -
-

getCompiledUpdate(table, reset) → {String}

- - -
-
- - -
-

Return generated update query SQL

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
table - - -String - - - - - - - - - - - -

the name of the table to update

reset - - -Boolean - - - - - - <optional>
- - - - - -
- - true - -

Whether to reset the query builder so another query can be built

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -String - - -
-
- - - - - -
- - - -
-

<private> getState() → {Object}

- - -
-
- - -
-

Returns the current class state for testing or other purposes

-
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - -
-
- - - - - -
- - - -
-

groupBy(field)

- - -
-
- - -
-

Group the results by the selected field(s)

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
field - - -String -| - -Array - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

groupEnd()

- - -
-
- - -
-

Ends a logical grouping started with one of the groupStart methods

-
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

groupStart()

- - -
-
- - -
-

Adds an open paren to the current query for logical grouping

-
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

having(key, val)

- - -
-
- - -
-

Add a 'having' clause

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
key - - -String -| - -Object - - - - - - - - - -

The name of the field and the comparision operator, or an object

val - - -String -| - -Number - - - - - - <optional>
- - - - - -

The value to compare if the value of key is a string

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

insert(table, data, callback)

- - -
-
- - -
-

Run the generated insert query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
table - - -String - - - - - - - - - -

The table to insert into

data - - -Object - - - - - - <optional>
- - - - - -

Data to insert, if not already added with the 'set' method

callback - - -function - - - - - - - - - -

Callback for handling response from the database

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

void

-
- - - - - - - -
- - - -
-

insertBatch(table, data, callback)

- - -
-
- - -
-

Insert multiple sets of rows at a time

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
table - - -String - - - -

The table to insert into

data - - -Array - - - -

The array of objects containing data rows to insert

callback - - -function - - - -

Callback for handling database response

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

void

-
- - - - - - - -
Example
- -
query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}], callbackFunction);
- - - -
- - - -
-

join(table, cond, type)

- - -
-
- - -
-

Add a join clause to the query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
table - - -String - - - - - - - - - - - -

The table you are joining

cond - - -String - - - - - - - - - - - -

The join condition.

type - - -String - - - - - - <optional>
- - - - - -
- - 'inner' - -

The type of join, which defaults to inner

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

like(field, val, pos)

- - -
-
- - -
-

Add a 'like/ and like' clause to the query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
field - - -String - - - - - - - - - - - -

The name of the field to compare to

val - - -String - - - - - - - - - - - -

The value to compare to

pos - - -String - - - - - - <optional>
- - - - - -
- - both - -

The placement of the wildcard character(s): before, after, or both

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

limit(limit, offset)

- - -
-
- - -
-

Put a limit on the query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
limit - - -Number - - - - - - - - - -

The maximum number of rows to fetch

offset - - -Number - - - - - - <optional>
- - - - - -

The row number to start from

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

notLike(field, val, pos)

- - -
-
- - -
-

Add a 'not like/ and not like' clause to the query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
field - - -String - - - - - - - - - - - -

The name of the field to compare to

val - - -String - - - - - - - - - - - -

The value to compare to

pos - - -String - - - - - - <optional>
- - - - - -
- - both - -

The placement of the wildcard character(s): before, after, or both

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orderBy(field, type)

- - -
-
- - -
-

Order the results by the selected field(s)

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
field - - -String - - - - - - - - - - - -

The field(s) to order by

type - - -String - - - - - - <optional>
- - - - - -
- - 'ASC' - -

The order direction, ASC or DESC

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orGroupStart()

- - -
-
- - -
-

Adds an open paren to the current query for logical grouping, -prefixed with 'OR'

-
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orHaving(key, val)

- - -
-
- - -
-

Add an 'or having' clause

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
key - - -String -| - -Object - - - - - - - - - -

The name of the field and the comparision operator, or an object

val - - -String -| - -Number - - - - - - <optional>
- - - - - -

The value to compare if the value of key is a string

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orLike(field, val, pos)

- - -
-
- - -
-

Add an 'or like' clause to the query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
field - - -String - - - - - - - - - - - -

The name of the field to compare to

val - - -String - - - - - - - - - - - -

The value to compare to

pos - - -String - - - - - - <optional>
- - - - - -
- - both - -

The placement of the wildcard character(s): before, after, or both

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orNotGroupStart()

- - -
-
- - -
-

Adds an open paren to the current query for logical grouping, -prefixed with 'OR NOT'

-
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orNotLike(field, val, pos)

- - -
-
- - -
-

Add an 'or not like' clause to the query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
field - - -String - - - - - - - - - - - -

The name of the field to compare to

val - - -String - - - - - - - - - - - -

The value to compare to

pos - - -String - - - - - - <optional>
- - - - - -
- - both - -

The placement of the wildcard character(s): before, after, or both

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orWhere(key, val)

- - -
-
- - -
-

Set a 'or where' clause

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
key - - -String -| - -Object - - - - - - - - - -

The name of the field and the comparision operator, or an object

val - - -String -| - -Number - - - - - - <optional>
- - - - - -

The value to compare if the value of key is a string

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orWhereIn(key, val)

- - -
-
- - -
-

Set a 'or where in' clause

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -String - - - -

the field to search

val - - -Array - - - -

the array of items to search in

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orWhereIsNotNull(field)

- - -
-
- - -
-

Field is not null prefixed with 'OR'

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
field - - -String - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orWhereIsNull(field)

- - -
-
- - -
-

Field is null prefixed with 'OR'

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
field - - -String - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

orWhereNotIn(key, val)

- - -
-
- - -
-

Set a 'or where not in' clause

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -String - - - -

the field to search

val - - -Array - - - -

the array of items to search in

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

select(fields)

- - -
-
- - -
-

Specify rows to select in the query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
fields - - -String -| - -Array - - - -

The fields to select from the current table

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

set(key, val)

- - -
-
- - -
-

Set values for insertion or updating

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
key - - -String -| - -Object - - - - - - - - - -

The key or object to use

val - - -String - - - - - - <optional>
- - - - - -

The value if using a scalar key

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

update(table, data, callback)

- - -
-
- - -
-

Run the generated update query

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
table - - -String - - - - - - - - - -

The table to insert into

data - - -Object - - - - - - <optional>
- - - - - -

Data to insert, if not already added with the 'set' method

callback - - -function - - - - - - - - - -

Callback for handling response from the database

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

void

-
- - - - - - - -
- - - -
-

where(key, val)

- - -
-
- - -
-

Set a 'where' clause

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDescription
key - - -String -| - -Object - - - - - - - - - -

The name of the field and the comparision operator, or an object

val - - -String -| - -Number - - - - - - <optional>
- - - - - -

The value to compare if the value of key is a string

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

whereIn(key, val)

- - -
-
- - -
-

Set a 'where in' clause

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -String - - - -

the field to search

val - - -Array - - - -

the array of items to search in

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

whereIsNotNull(field)

- - -
-
- - -
-

Specify that a field IS NOT NULL

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
field - - -String - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

whereIsNull(field)

- - -
-
- - -
-

Select a field that is Null

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
field - - -String - - - -

The name of the field that has a NULL value

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- - - -
-

whereNotIn(key, val)

- - -
-
- - -
-

Set a 'where not in' clause

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -String - - - -

the field to search

val - - -Array - - - -

the array of items to search in

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

this

-
- - - - - - - -
- -
- - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/module-query-parser.html b/docs/module-query-parser.html deleted file mode 100644 index 7f02d77..0000000 --- a/docs/module-query-parser.html +++ /dev/null @@ -1,878 +0,0 @@ - - - - - - DocStrap Module: query-parser - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: query-parser

-
- -
-

- query-parser -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - -

Methods

- -
- -
-

compileJoin(condition) → {String}

- - -
-
- - -
-

Return the output of the parsing of the join condition

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
condition - - -String - - - -

The join condition to evalate

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-
    -
  • The parsed/escaped join condition
  • -
-
- - - -
-
- Type -
-
- -String - - -
-
- - - - - -
- - - -
-

hasOperator(string) → {Array|null}

- - -
-
- - -
-

Check if the string contains an operator, and if so, return the operator(s). -If there are no matches, return null

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
string - - -String - - - -

the string to check

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Array -| - -null - - -
-
- - - - - -
- - - -
-

parseJoin(sql) → {Object}

- - -
-
- - -
-

Tokenize the sql into parts for additional processing

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
sql - - -String - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Object - - -
-
- - - - - -
- - - -
-

parseWhere(driver, state) → {String}

- - -
-
- - -
-

Parse a where clause to separate functions from values

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
driver - - -Object - - - -
state - - -State - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-
    -
  • The parsed/escaped where condition
  • -
-
- - - -
-
- Type -
-
- -String - - -
-
- - - - - -
- -
- - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/modules.list.html b/docs/modules.list.html deleted file mode 100644 index a859238..0000000 --- a/docs/modules.list.html +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - DocStrap Modules - - - - - - - - - -
- - -
- - -
- -
- - - -

Modules

-
- -
-

- -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/mysql.html b/docs/mysql.html deleted file mode 100644 index e2a46ef..0000000 --- a/docs/mysql.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - DocStrap Module: drivers/mysql - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: drivers/mysql

-
- -
-

- drivers/mysql -

- -
- -
-
- - - - -

Driver for MySQL databases

- - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Thu Oct 23rd 2014 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/mysql.js.html b/docs/mysql.js.html deleted file mode 100644 index 873e73e..0000000 --- a/docs/mysql.js.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - DocStrap Source: drivers/mysql.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: drivers/mysql.js

- -
-
-
"use strict";
-
-/**
- * Driver for MySQL databases
- *
- * @module drivers/mysql
- */
-module.exports = (function() {
-
-	var driver = require('../driver'),
-		helpers = require('../helpers');
-
-	driver.identifierChar = '`';
-
-	/**
-	 * Override default limit method because mysql likes to be different
-	 */
-	driver.limit = function(sql, limit, offset) {
-		if ( ! helpers.isNumber(offset))
-		{
-			return sql += " LIMIT " + limit;
-		}
-
-		return sql += " LIMIT " + offset + "," + limit;
-	};
-
-	return driver;
-
-}());
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Thu Oct 23rd 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/mysql.js_.html b/docs/mysql.js_.html deleted file mode 100644 index 9868cfc..0000000 --- a/docs/mysql.js_.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - DocStrap Source: adapters/mysql.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: adapters/mysql.js

- -
-
-
'use strict';
-
-var adapter = require('../lib/adapter.js');
-
-/** @module adapters/mysql */
-module.exports = function(instance) {
-
-	adapter.execute = function(sql, params, callback) {
-		instance.query(sql, params, callback);
-	};
-
-	return adapter;
-}
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/mysql2.html b/docs/mysql2.html deleted file mode 100644 index 8dc4d7d..0000000 --- a/docs/mysql2.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - DocStrap Module: adapters/mysql2 - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: adapters/mysql2

-
- -
-

- adapters/mysql2 -

- -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/mysql2.js.html b/docs/mysql2.js.html deleted file mode 100644 index 6484c2b..0000000 --- a/docs/mysql2.js.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - DocStrap Source: adapters/mysql2.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: adapters/mysql2.js

- -
-
-
'use strict';
-
-var adapter = require('../lib/adapter.js');
-
-/** @module adapters/mysql2 */
-module.exports = function(instance) {
-
-	/**
-	 * Run the sql query as a prepared statement
-	 *
-	 * @param {String} sql - The sql with placeholders
-	 * @param {Array} params - The values to insert into the query
-	 * @param {Function} callback - Callback to run when a response is recieved
-	 * @return void
-	 */
-	adapter.execute = function(sql, params, callback) {
-		instance.execute(sql, params, callback);
-	};
-
-	return adapter;
-}
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Tue Oct 21st 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/node-query.js.html b/docs/node-query.js.html deleted file mode 100644 index 56397a1..0000000 --- a/docs/node-query.js.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - DocStrap Source: node-query.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: node-query.js

- -
-
-
"use strict";
-
-/** @module node-query */
-var NodeQuery = function() {
-
-	var instance = null;
-
-	/**
-	 * Create a query builder object
-	 *
-	 * @alias module:node-query
-	 * @param {String} drivername - The name of the database type, eg. mysql or pg
-	 * @param {Object} connObject - A connection object from the database library you are connecting with
-	 * @param {String} [connLib] - The name of the db connection library you are using, eg. mysql or mysql2. Optional if the same as drivername
-	 * @return {queryBuilder}
-	 */
-	this.init = function (driverType, connObject, connLib) {
-		connLib = connLib || driverType;
-
-		var fs = require('fs'),
-			qb = require('./query-builder');
-
-		var paths = {
-			driver: __dirname + '/drivers/' + driverType + '.js',
-			adapter: __dirname + '/adapters/' + connLib + '.js'
-		};
-
-		Object.keys(paths).forEach(function(type) {
-			if ( ! fs.existsSync(paths[type]))
-			{
-				console.log(paths[type]);
-				throw new Error('Selected ' + type + ' does not exist!');
-			}
-		});
-
-		instance = qb(require(paths.driver), require(paths.adapter)(connObject));
-
-		return instance;
-	};
-
-	/**
-	 * Return an existing query builder instance
-	 *
-	 * @return {queryBuilder}
-	 */
-	this.getQuery = function () {
-		if ( ! instance) {
-			throw new Error("No Query Builder instance to return");
-		}
-
-		return instance;
-	};
-
-};
-
-
-
-module.exports = new NodeQuery();
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/pg.html b/docs/pg.html deleted file mode 100644 index 5df9b6d..0000000 --- a/docs/pg.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - DocStrap Module: drivers/pg - - - - - - - - - -
- - -
- - -
- -
- - - -

Module: drivers/pg

-
- -
-

- drivers/pg -

- -
- -
-
- - - - -

Driver for PostgreSQL databases

- - - -
- - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Thu Oct 23rd 2014 using the DocStrap template. - -
-
- - -
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/pg.js.html b/docs/pg.js.html deleted file mode 100644 index 8e42118..0000000 --- a/docs/pg.js.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - DocStrap Source: drivers/pg.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: drivers/pg.js

- -
-
-
"use strict";
-
-/**
- * Driver for PostgreSQL databases
- *
- * @module drivers/pg
- */
-module.exports = (function() {
-	var driver = require('../driver');
-
-	return driver;
-}());
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-alpha9 - on Thu Oct 23rd 2014 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/query-builder.js.html b/docs/query-builder.js.html deleted file mode 100644 index 3f528fc..0000000 --- a/docs/query-builder.js.html +++ /dev/null @@ -1,1108 +0,0 @@ - - - - - - DocStrap Source: query-builder.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: query-builder.js

- -
-
-
'use strict';
-
-/** @module query-builder */
-var getArgs = require('getargs'),
-	helpers = require('./helpers'),
-	State = require('./state');
-
-/**
- * Variables controlling the sql building
- *
- * @private
- */
-var state = new State();
-
-/*
- * SQL generation object
- *
- * @param {driver} - The syntax driver for the database
- * @param {adapter} - The database module adapter for running queries
- * @constructor
- */
-var QueryBuilder = function(driver, adapter) {
-
-	// That 'new' keyword is annoying
-	if ( ! (this instanceof QueryBuilder)) return new QueryBuilder(driver, adapter);
-
-	var parser = require('./query-parser')(driver);
-
-	this.driver = driver;
-	this.adapter = adapter;
-
-	/**
-	 * "Private" methods
-	 *
-	 * @private
-	 */
-	var _p = {
-		/**
-		 * Complete the sql building based on the type provided
-		 *
-		 * @param {String} type
-		 * @param {String} table
-		 * @private
-		 * @return {String}
-		 */
-		compile: function (type, table) {
-			// Put together the basic query
-			var sql = _p.compileType(type, table);
-
-			// Set each subClause
-			['queryMap', 'groupString', 'orderString', 'havingMap'].forEach(function(clause) {
-				var param = state[clause];
-
-				if ( ! helpers.isScalar(param))
-				{
-					Object.keys(param).forEach(function(part) {
-						sql += param[part].conjunction + param[part].string;
-					});
-				}
-				else
-				{
-					sql += param;
-				}
-			});
-
-			// Append the limit, if it exists
-			if (helpers.isNumber(state.limit))
-			{
-				sql = driver.limit(sql, state.limit, state.offset);
-			}
-
-			return sql;
-		},
-		compileType: function (type, table) {
-			var sql = '';
-
-			switch(type) {
-				case "insert":
-					var params = new Array(state.setArrayKeys.length);
-					params.fill('?');
-
-					sql = "INSERT INTO " + table + " (";
-					sql += state.setArrayKeys.join(',');
-					sql += ") VALUES (";
-					sql += params.join(',') + ')';
-				break;
-
-				case "update":
-					sql = "UPDATE " + table + " SET " + state.setString;
-				break;
-
-				case "delete":
-					sql = "DELETE FROM " + table;
-				break;
-
-				default:
-					sql = "SELECT * FROM " + state.fromString;
-
-					// Set the select string
-					if (state.selectString.length > 0)
-					{
-						// Replace the star with the selected fields
-						sql = sql.replace('*', state.selectString);
-					}
-				break;
-			}
-
-			return sql;
-		},
-		like: function (field, val, pos, like, conj) {
-			field = driver.quoteIdentifiers(field);
-
-			like = field + " " + like + " ?";
-
-			if (pos == 'before')
-			{
-				val = "%" + val;
-			}
-			else if (pos == 'after')
-			{
-				val = val + "%";
-			}
-			else
-			{
-				val = "%" + val + "%";
-			}
-
-			conj = (state.queryMap.length < 1) ? ' WHERE ' : ' ' + conj + ' ';
-			_p.appendMap(conj, like, 'like');
-
-			state.whereValues.push(val);
-		},
-		/**
-		 * Append a clause to the query map
-		 *
-		 * @param {String} conjunction
-		 * @param {String} string
-		 * @param {String} type
-		 * @return void
-		 */
-		appendMap: function(conjunction, string, type) {
-			state.queryMap.push({
-				type: type,
-				conjunction: conjunction,
-				string: string
-			});
-		},
-		/**
-		 * Handle key/value pairs in an object the same way as individual arguments,
-		 * when appending to state
-		 *
-		 * @private
-		 */
-		mixedSet: function(/* $varName, $valType, $key, [$val] */) {
-			var args = getArgs('$varName:string, $valType:string, $key:object|string|number, [$val]', arguments);
-
-			var obj = {};
-
-
-			if (helpers.isScalar(args.$key) && !helpers.isUndefined(args.$val))
-			{
-				// Convert key/val pair to a simple object
-				obj[args.$key] = args.$val;
-			}
-			else if (helpers.isScalar(args.$key) && helpers.isUndefined(args.$val))
-			{
-				// If just a string for the key, and no value, create a simple object with duplicate key/val
-				obj[args.$key] = args.$key;
-			}
-			else
-			{
-				obj = args.$key;
-			}
-
-			Object.keys(obj).forEach(function(k) {
-				// If a single value for the return
-				if (['key','value'].indexOf(args.$valType) !== -1)
-				{
-					var pushVal = (args.$valType === 'key') ? k : obj[k];
-					state[args.$varName].push(pushVal);
-				}
-				else
-				{
-					state[args.$varName][k] = obj[k];
-				}
-			});
-
-
-			return state[args.$varName];
-		},
-		whereMixedSet: function(/*key, val*/) {
-			var args = getArgs('key:string|object, [val]', arguments);
-
-			state.whereMap = [];
-			state.rawWhereValues = [];
-
-			_p.mixedSet('whereMap', 'both', args.key, args.val);
-			_p.mixedSet('rawWhereValues', 'value', args.key, args.val);
-		},
-		fixConjunction: function(conj) {
-			var lastItem = state.queryMap[state.queryMap.length - 1];
-			var conjunctionList = helpers.arrayPluck(state.queryMap, 'conjunction');
-
-			if (state.queryMap.length === 0 || ( ! helpers.regexInArray(conjunctionList, /^ ?WHERE/i)))
-			{
-				conj = " WHERE ";
-			}
-			else if (lastItem.type === 'groupStart')
-			{
-				conj = '';
-			}
-			else
-			{
-				conj = ' ' + conj + ' ';
-			}
-
-			return conj;
-		},
-		where: function(key, val, defaultConj) {
-			// Normalize key and value and insert into state.whereMap
-			_p.whereMixedSet(key, val);
-
-			// Parse the where condition to account for operators,
-			// functions, identifiers, and literal values
-			state = parser.parseWhere(driver, state);
-
-			state.whereMap.forEach(function(clause) {
-				var conj = _p.fixConjunction(defaultConj);
-				_p.appendMap(conj, clause, 'where');
-			});
-
-			state.whereMap = {};
-		},
-		whereNull: function(field, stmt, conj) {
-			field = driver.quoteIdentifiers(field);
-			var item = field + ' ' + stmt;
-
-			_p.appendMap(_p.fixConjunction(conj), item, 'whereNull');
-		},
-		having: function(/*key, val, conj*/) {
-			var args = getArgs('key:string|object, [val]:string|number, [conj]:string', arguments);
-			args.conj = args.conj || 'AND';
-			args.val = args.val || null;
-
-			// Normalize key/val and put in state.whereMap
-			_p.whereMixedSet(args.key, args.val);
-
-			// Parse the having condition to account for operators,
-			// functions, identifiers, and literal values
-			state = parser.parseWhere(driver, state);
-
-			state.whereMap.forEach(function(clause) {
-				// Put in the having map
-				state.havingMap.push({
-					conjunction: (state.havingMap.length > 0) ? " " + args.conj + " " : ' HAVING ',
-					string: clause
-				});
-			});
-
-			// Clear the where Map
-			state.whereMap = {};
-		},
-		whereIn: function(/*key, val, inClause, conj*/) {
-			var args = getArgs('key:string, val:array, inClause:string, conj:string', arguments);
-
-			args.key = driver.quoteIdentifiers(args.key);
-			var params = new Array(args.val.length);
-			params.fill('?');
-
-			args.val.forEach(function(value) {
-				state.whereValues.push(value);
-			});
-
-			args.conj = (state.queryMap.length > 0) ? " " + args.conj + " " : ' WHERE ';
-			var str = args.key + " " + args.inClause + " (" + params.join(',') + ") ";
-
-			_p.appendMap(args.conj, str, 'whereIn');
-		},
-		run: function(type, table, callback, sql, vals) {
-
-			if ( ! sql)
-			{
-				sql = _p.compile(type, table);
-			}
-
-			if ( ! vals)
-			{
-				vals = state.values.concat(state.whereValues);
-			}
-
-//console.log(state);
-//console.log(sql);
-//console.log(vals);
-//console.log(callback);
-//console.log('------------------------');
-
-			// Reset the state so another query can be built
-			_p.resetState();
-
-			// Pass the sql and values to the adapter to run on the database
-			adapter.execute(sql, vals, callback);
-
-		},
-		getCompile: function(type, table, reset) {
-			reset = reset || false;
-
-			var sql = _p.compile(type, table);
-
-			if (reset) _p.resetState();
-
-			return sql;
-		},
-		resetState: function() {
-			state = new State();
-		}
-	};
-
-	// ----------------------------------------------------------------------------
-	// ! Miscellaneous Methods
-	// ----------------------------------------------------------------------------
-
-	/**
-	 * Reset the object state for a new query
-	 *
-	 * @memberOf query-builder
-	 * @return void
-	 */
-	this.resetQuery = function() {
-		_p.resetState();
-	};
-
-	/**
-	 * Returns the current class state for testing or other purposes
-	 *
-	 * @private
-	 * @return {Object}
-	 */
-	this.getState = function() {
-		return state;
-	};
-
-	/**
-	 * Closes the database connection for the current adapter
-	 *
-	 * @return void
-	 */
-	this.end = function() {
-		adapter.close();
-	};
-
-	// ------------------------------------------------------------------------
-	// ! Query Builder Methods
-	// ------------------------------------------------------------------------
-
-	/**
-	 * Specify rows to select in the query
-	 *
-	 * @param {String|Array} fields - The fields to select from the current table
-	 * @return this
-	 */
-	this.select = function(fields) {
-
-		// Split/trim fields by comma
-		fields = (Array.isArray(fields)) ? fields : fields.split(",").map(helpers.stringTrim);
-
-		// Split on 'As'
-		fields.forEach(function (field, index) {
-			if (field.match(/as/i))
-			{
-				fields[index] = field.split(/ as /i).map(helpers.stringTrim);
-			}
-		});
-
-		var safeArray = driver.quoteIdentifiers(fields);
-
-		// Join the strings back together
-		safeArray.forEach(function (field, index) {
-			if (Array.isArray(field))
-			{
-				safeArray[index] = safeArray[index].join(' AS ');
-			}
-		});
-
-		state.selectString += safeArray.join(', ');
-
-		return this;
-	};
-
-	/**
-	 * Specify the database table to select from
-	 *
-	 * @param {String} tableName - The table to use for the current query
-	 * @return this
-	 */
-	this.from = function(tableName) {
-		// Split identifiers on spaces
-		var identArray = tableName.trim().split(' ').map(helpers.stringTrim);
-
-		// Quote/prefix identifiers
-		identArray[0] = driver.quoteTable(identArray[0]);
-		identArray = driver.quoteIdentifiers(identArray);
-
-		// Put it back together
-		state.fromString = identArray.join(' ');
-
-		return this;
-	};
-
-	/**
-	 * Add a 'like/ and like' clause to the query
-	 *
-	 * @param {String} field - The name of the field  to compare to
-	 * @param {String} val - The value to compare to
-	 * @param {String} [pos=both] - The placement of the wildcard character(s): before, after, or both
-	 * @return this
-	 */
-	this.like = function(field, val, pos) {
-		_p.like(field, val, pos, ' LIKE ', 'AND');
-		return this;
-	};
-
-	/**
-	 * Add a 'not like/ and not like' clause to the query
-	 *
-	 * @param {String} field - The name of the field  to compare to
-	 * @param {String} val - The value to compare to
-	 * @param {String} [pos=both] - The placement of the wildcard character(s): before, after, or both
-	 * @return this
-	 */
-	this.notLike = function(field, val, pos) {
-		_p.like(field, val, pos, ' NOT LIKE ', 'AND');
-		return this;
-	};
-
-	/**
-	 * Add an 'or like' clause to the query
-	 *
-	 * @param {String} field - The name of the field  to compare to
-	 * @param {String} val - The value to compare to
-	 * @param {String} [pos=both] - The placement of the wildcard character(s): before, after, or both
-	 * @return this
-	 */
-	this.orLike = function(field, val, pos) {
-		_p.like(field, val, pos, ' LIKE ', 'OR');
-		return this;
-	};
-
-	/**
-	 * Add an 'or not like' clause to the query
-	 *
-	 * @param {String} field - The name of the field  to compare to
-	 * @param {String} val - The value to compare to
-	 * @param {String} [pos=both] - The placement of the wildcard character(s): before, after, or both
-	 * @return this
-	 */
-	this.orNotLike = function(field, val, pos) {
-		_p.like(field, val, pos, ' NOT LIKE ', 'OR');
-		return this;
-	};
-
-	/**
-	 * Add a 'having' clause
-	 *
-	 * @param {String|Object} key - The name of the field and the comparision operator, or an object
-	 * @param {String|Number} [val] - The value to compare if the value of key is a string
-	 * @return this
-	 */
-	this.having = function(/*key, [val]*/) {
-		var args = getArgs('key:string|object, [val]:string|number', arguments);
-
-		_p.having(args.key, args.val, 'AND');
-		return this;
-	};
-
-	/**
-	 * Add an 'or having' clause
-	 *
-	 * @param {String|Object} key - The name of the field and the comparision operator, or an object
-	 * @param {String|Number} [val] - The value to compare if the value of key is a string
-	 * @return this
-	 */
-	this.orHaving = function(/*key, [val]*/) {
-		var args = getArgs('key:string|object, [val]:string|number', arguments);
-
-		_p.having(args.key, args.val, 'OR');
-		return this;
-	};
-
-	/**
-	 * Set a 'where' clause
-	 *
-	 * @param {String|Object} key - The name of the field and the comparision operator, or an object
-	 * @param {String|Number} [val] - The value to compare if the value of key is a string
-	 * @return this
-	 */
-	this.where = function(key, val) {
-		_p.where(key, val, 'AND');
-		return this;
-	};
-
-	/**
-	 * Set a 'or where' clause
-	 *
-	 * @param {String|Object} key - The name of the field and the comparision operator, or an object
-	 * @param {String|Number} [val] - The value to compare if the value of key is a string
-	 * @return this
-	 */
-	this.orWhere = function(key, val) {
-		_p.where(key, val, 'OR');
-		return this;
-	};
-
-	/**
-	 * Select a field that is Null
-	 *
-	 * @param {String} field - The name of the field that has a NULL value
-	 * @return this
-	 */
-	this.whereIsNull = function(field) {
-		_p.whereNull(field, 'IS NULL', 'AND');
-		return this;
-	}
-
-	/**
-	 * Specify that a field IS NOT NULL
-	 *
-	 * @param {String} field
-	 * @return this
-	 */
-	this.whereIsNotNull = function(field) {
-		_p.whereNull(field, 'IS NOT NULL', 'AND');
-		return this;
-	}
-
-	/**
-	 * Field is null prefixed with 'OR'
-	 *
-	 * @param {String} field
-	 * @return this
-	 */
-	this.orWhereIsNull = function(field) {
-		_p.whereNull(field, 'IS NULL', 'OR');
-		return this;
-	}
-
-	/**
-	 * Field is not null prefixed with 'OR'
-	 *
-	 * @param {String} field
-	 * @return this
-	 */
-	this.orWhereIsNotNull = function(field) {
-		_p.whereNull(field, 'IS NOT NULL', 'OR');
-		return this;
-	}
-
-	/**
-	 * Set a 'where in' clause
-	 *
-	 * @param {String} key - the field to search
-	 * @param {Array} val - the array of items to search in
-	 * @return this
-	 */
-	this.whereIn = function(key, val) {
-		_p.whereIn(key, val, 'IN', 'AND');
-		return this;
-	};
-
-	/**
-	 * Set a 'or where in' clause
-	 *
-	 * @param {String} key - the field to search
-	 * @param {Array} val - the array of items to search in
-	 * @return this
-	 */
-	this.orWhereIn = function(key, val) {
-		_p.whereIn(key, val, 'IN', 'OR');
-		return this;
-	};
-
-	/**
-	 * Set a 'where not in' clause
-	 *
-	 * @param {String} key - the field to search
-	 * @param {Array} val - the array of items to search in
-	 * @return this
-	 */
-	this.whereNotIn = function(key, val) {
-		_p.whereIn(key, val, 'NOT IN', 'AND');
-		return this;
-	};
-
-	/**
-	 * Set a 'or where not in' clause
-	 *
-	 * @param {String} key - the field to search
-	 * @param {Array} val - the array of items to search in
-	 * @return this
-	 */
-	this.orWhereNotIn = function(key, val) {
-		_p.whereIn(key, val, 'NOT IN', 'OR');
-		return this;
-	};
-
-	/**
-	 * Set values for insertion or updating
-	 *
-	 * @param {String|Object} key - The key or object to use
-	 * @param {String} [val] - The value if using a scalar key
-	 * @return this
-	 */
-	this.set = function(/* $key, [$val] */) {
-		var args = getArgs('$key, [$val]', arguments);
-
-		// Set the appropriate state variables
-		_p.mixedSet('setArrayKeys', 'key', args.$key, args.$val);
-		_p.mixedSet('values', 'value', args.$key, args.$val);
-
-		// Use the keys of the array to make the insert/update string
-		// and escape the field names
-		state.setArrayKeys = state.setArrayKeys.map(driver._quote);
-
-		// Generate the "set" string
-		state.setString = state.setArrayKeys.join('=?,');
-		state.setString += '=?';
-
-		return this;
-	};
-
-	/**
-	 * Add a join clause to the query
-	 *
-	 * @param {String} table - The table you are joining
-	 * @param {String} cond - The join condition.
-	 * @param {String} [type='inner'] - The type of join, which defaults to inner
-	 * @return this
-	 */
-	this.join = function(table, cond, type) {
-		type = type || "inner";
-
-		// Prefix/quote table name
-		var table = table.split(' ').map(helpers.stringTrim);
-		table[0] = driver.quoteTable(table[0]);
-		table = table.map(driver.quoteIdentifiers);
-		table = table.join(' ');
-
-		// Parse out the join condition
-		var parsedCondition = parser.compileJoin(cond);
-		var condition = table + ' ON ' + parsedCondition;
-
-		// Append the join condition to the query map
-		_p.appendMap("\n" + type.toUpperCase() + ' JOIN ', condition, 'join');
-
-		return this;
-	};
-
-	/**
-	 * Group the results by the selected field(s)
-	 *
-	 * @param {String|Array} field
-	 * @return this
-	 */
-	this.groupBy = function(field) {
-		if ( ! helpers.isScalar(field))
-		{
-			var newGroupArray = field.map(driver.quoteIdentifiers);
-			state.groupArray = state.groupArray.concat(newGroupArray);
-		}
-		else
-		{
-			state.groupArray.push(driver.quoteIdentifiers(field));
-		}
-
-		state.groupString = ' GROUP BY ' + state.groupArray.join(',');
-
-		return this;
-	};
-
-	/**
-	 * Order the results by the selected field(s)
-	 *
-	 * @param {String} field - The field(s) to order by
-	 * @param {String} [type='ASC'] - The order direction, ASC or DESC
-	 * @return this
-	 */
-	this.orderBy = function(field, type) {
-		type = type || 'ASC';
-
-		// Set the fields for later manipulation
-		field = driver.quoteIdentifiers(field);
-
-		state.orderArray[field] = type;
-
-		var orderClauses = [];
-
-		// Flatten key/val pairs into an array of space-separated pairs
-		Object.keys(state.orderArray).forEach(function(key) {
-			orderClauses.push(key + ' ' + state.orderArray[key].toUpperCase());
-		});
-
-		// Set the final string
-		state.orderString = ' ORDER BY ' + orderClauses.join(', ');
-
-		return this;
-	};
-
-	/**
-	 * Put a limit on the query
-	 *
-	 * @param {Number} limit - The maximum number of rows to fetch
-	 * @param {Number} [offset] - The row number to start from
-	 * @return this
-	 */
-	this.limit = function(limit, offset) {
-		state.limit = limit;
-		state.offset = offset || null;
-
-		return this;
-	};
-
-	/**
-	 * Adds an open paren to the current query for logical grouping
-	 *
-	 * @return this
-	 */
-	this.groupStart = function() {
-		var conj = (state.queryMap.length < 1) ? ' WHERE ' : ' AND ';
-		_p.appendMap(conj, '(', 'groupStart');
-
-		return this;
-	};
-
-	/**
-	 * Adds an open paren to the current query for logical grouping,
-	 * prefixed with 'OR'
-	 *
-	 * @return this
-	 */
-	this.orGroupStart = function() {
-		_p.appendMap('', ' OR (', 'groupStart');
-
-		return this;
-	};
-
-	/**
-	 * Adds an open paren to the current query for logical grouping,
-	 * prefixed with 'OR NOT'
-	 *
-	 * @return this
-	 */
-	this.orNotGroupStart = function() {
-		_p.appendMap('', ' OR NOT (', 'groupStart');
-
-		return this;
-	};
-
-	/**
-	 * Ends a logical grouping started with one of the groupStart methods
-	 *
-	 * @return this
-	 */
-	this.groupEnd = function() {
-		_p.appendMap('', ')', 'groupEnd');
-
-		return this;
-	};
-
-	// ------------------------------------------------------------------------
-	// ! Result Methods
-	// ------------------------------------------------------------------------
-
-	/**
-	 * Get the results of the compiled query
-	 *
-	 * @param {String} [table] - The table to select from
-	 * @param {Number} [limit] - A limit for the query
-	 * @param {Number} [offset] - An offset for the query
-	 * @param {Function} callback - A callback for receiving the result
-	 * @return void
-	 */
-	this.get = function(/* [table], [limit], [offset], callback */) {
-		var args = getArgs('[table]:string, [limit]:number, [offset]:number, callback:function', arguments);
-
-		if (args.table) {
-			this.from(args.table);
-		}
-
-		if (args.limit) {
-			this.limit(args.limit, args.offset);
-		}
-
-		// Run the query
-		_p.run('get', args.table, args.callback);
-	};
-
-	/**
-	 * Run the generated insert query
-	 *
-	 * @param {String} table - The table to insert into
-	 * @param {Object} [data] - Data to insert, if not already added with the 'set' method
-	 * @param {Function} callback - Callback for handling response from the database
-	 * @return void
-	 */
-	this.insert = function(/* table, data, callback */) {
-		var args = getArgs('table:string, [data]:object, callback:function', arguments);
-
-		if (args.data) {
-			this.set(args.data);
-		}
-
-		// Run the query
-		_p.run('insert', driver.quoteTable(args.table), args.callback);
-	};
-
-	/**
-	 * Insert multiple sets of rows at a time
-	 *
-	 * @param {String} table - The table to insert into
-	 * @param {Array} data - The array of objects containing data rows to insert
-	 * @param {Function} callback - Callback for handling database response
-	 * @example query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}], callbackFunction);
-	 * @return void
-	 */
-	this.insertBatch = function(/* table, data, callback */) {
-		var args = getArgs('table:string, data:array, callback:function', arguments);
-		var batch = driver.insertBatch(args.table, args.data);
-
-		// Run the query
-		_p.run('', '', args.callback, batch.sql, batch.values);
-	};
-
-	/**
-	 * Run the generated update query
-	 *
-	 * @param {String} table - The table to insert into
-	 * @param {Object} [data] - Data to insert, if not already added with the 'set' method
-	 * @param {Function} callback - Callback for handling response from the database
-	 * @return void
-	 */
-	this.update = function(/*table, data, callback*/) {
-		var args = getArgs('table:string, [data]:object, callback:function', arguments);
-
-		if (args.data) {
-			this.set(args.data);
-		}
-
-		// Run the query
-		_p.run('update', driver.quoteTable(args.table), args.callback);
-	};
-
-	/**
-	 * Run the generated delete query
-	 *
-	 * @param {String} table - The table to insert into
-	 * @param {Object} [where] - Where clause for delete statement
-	 * @param {Function} callback - Callback for handling response from the database
-	 * @return void
-	 */
-	this.delete = function (/*table, [where], callback*/) {
-		var args = getArgs('table:string, [where]:object, callback:function', arguments);
-
-		if (args.where)
-		{
-			this.where(args.where);
-		}
-
-		// Run the query
-		_p.run('delete', driver.quoteTable(args.table), args.callback);
-	};
-
-	// ------------------------------------------------------------------------
-	// ! Methods returning SQL
-	// ------------------------------------------------------------------------
-
-	/**
-	 * Return generated select query SQL
-	 *
-	 * @param {String} [table] - the name of the table to retrieve from
-	 * @param {Boolean} [reset=true] - Whether to reset the query builder so another query can be built
-	 * @return String
-	 */
-	this.getCompiledSelect = function(/*table, reset*/) {
-		var args = getArgs('[table]:string, [reset]:boolean', arguments);
-		if (args.table)
-		{
-			this.from(args.table);
-		}
-
-		return _p.getCompile('get', args.table, args.reset);
-	};
-
-	/**
-	 * Return generated insert query SQL
-	 *
-	 * @param {String} table - the name of the table to insert into
-	 * @param {Boolean} [reset=true] - Whether to reset the query builder so another query can be built
-	 * @return {String}
-	 */
-	this.getCompiledInsert = function(table, reset) {
-		return _p.getCompile('insert', driver.quoteTable(table), reset);
-	};
-
-	/**
-	 * Return generated update query SQL
-	 *
-	 * @param {String} table - the name of the table to update
-	 * @param {Boolean} [reset=true] - Whether to reset the query builder so another query can be built
-	 * @return {String}
-	 */
-	this.getCompiledUpdate = function(table, reset) {
-		return _p.getCompile('update', driver.quoteTable(table), reset);
-	};
-
-	/**
-	 * Return generated delete query SQL
-	 *
-	 * @param {String} table - the name of the table to delete from
-	 * @param {Boolean} [reset=true] - Whether to reset the query builder so another query can be built
-	 * @return {String}
-	 */
-	this.getCompiledDelete = function(table, reset) {
-		return _p.getCompile('delete', driver.quoteTable(table), reset);
-	};
-
-	return this;
-};
-
-module.exports = QueryBuilder;
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/query-parser.js.html b/docs/query-parser.js.html deleted file mode 100644 index abac203..0000000 --- a/docs/query-parser.js.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - - DocStrap Source: query-parser.js - - - - - - - - - -
- - -
- - -
- -
- - - -

Source: query-parser.js

- -
-
-
'use strict';
-
-var helpers = require('./helpers');
-
-var matchPatterns = {
-	'function': /([a-z0-9_]+\((.*)\))/i,
-	operator: /\!=?|\=|\+|&&?|~|\|\|?|\^|\/|<>|>=?|<=?|\-|%|OR|AND|NOT|XOR/ig,
-	literal: /([0-9]+)|'(.*?)'|true|false/ig
-};
-
-// Full pattern for identifiers
-// Making sure that literals and functions aren't matched
-matchPatterns.identifier = new RegExp(
-	'('
-		+ '(?!'
-			+ matchPatterns['function'].source + '|'
-			+ matchPatterns.literal.source
-		+ ')'
-		+ '([a-z_\-]+[0-9]*\\.?)'
-	+ ')+'
-, 'ig');
-
-// Full pattern for determining ordering of the pieces
-matchPatterns.joinCombined = new RegExp(
-	matchPatterns['function'].source + "+|"
-	+ matchPatterns.literal.source + '+|'
-	+ matchPatterns.identifier.source
-	+ '|(' + matchPatterns.operator.source + ')+'
-, 'ig');
-
-var identifierBlacklist = ['true','false','null'];
-
-var filterMatches = function(array) {
-	var output = [];
-
-	// Return non-array matches
-	if (helpers.isNull(array)) return null;
-	if (helpers.isScalar(array) || helpers.isUndefined(array)) return output;
-
-	array.forEach(function(item) {
-		output.push(item);
-	});
-
-	return output;
-};
-
-// --------------------------------------------------------------------------
-
-/**
- * @constructor
- * @param {Driver} - The driver object for the database in use
- * @module query-parser
- */
-var QueryParser = function(driver) {
-
-	// That 'new' keyword is annoying
-	if ( ! (this instanceof QueryParser)) return new QueryParser(driver);
-
-	/**
-	 * Check if the string contains an operator, and if so, return the operator(s).
-	 * If there are no matches, return null
-	 *
-	 * @param {String} string - the string to check
-	 * @return {Array|null}
-	 */
-	this.hasOperator = function(string) {
-		return filterMatches(string.match(matchPatterns.operator));
-	}
-
-	/**
-	 * Tokenize the sql into parts for additional processing
-	 *
-	 * @param {String} sql
-	 * @return {Object}
-	 */
-	this.parseJoin = function(sql) {
-		var matches = {};
-		var output = {};
-
-		// Get clause components
-		matches.functions = sql.match(new RegExp(matchPatterns['function'].source, 'ig'));
-		matches.identifiers = sql.match(matchPatterns.identifier);
-		matches.operators = sql.match(matchPatterns.operator);
-		matches.literals = sql.match(matchPatterns.literal);
-
-		// Get everything at once for ordering
-		matches.combined = sql.match(matchPatterns.joinCombined);
-
-		// Flatten the matches to increase relevance
-		Object.keys(matches).forEach(function(key) {
-			output[key] = filterMatches(matches[key]);
-		});
-
-		return output;
-	};
-
-	/**
-	 * Return the output of the parsing of the join condition
-	 *
-	 * @param {String} condition - The join condition to evalate
-	 * @return {String} - The parsed/escaped join condition
-	 */
-	this.compileJoin = function(condition) {
-		var parts = this.parseJoin(condition);
-		var count = parts.identifiers.length;
-		var i;
-
-		// Quote the identifiers
-		parts.combined.forEach(function(part, i) {
-			if (parts.identifiers.indexOf(part) !== -1 && ! helpers.isNumber(part))
-			{
-				parts.combined[i] = driver.quoteIdentifiers(part);
-			}
-		});
-
-		return parts.combined.join(' ');
-	};
-
-	/**
-	 * Parse a where clause to separate functions from values
-	 *
-	 * @param {Object} driver
-	 * @param {State} state
-	 * @return {String} - The parsed/escaped where condition
-	 */
-	this.parseWhere = function(driver, state) {
-		var whereMap = state.whereMap,
-			whereValues = state.rawWhereValues;
-
-		var outputMap = [];
-		var outputValues = [];
-
-		Object.keys(whereMap).forEach(function(key) {
-			// Combine fields, operators, functions and values into a full clause
-			// to have a common starting flow
-			var fullClause = '';
-
-			// Add an explicit = sign where one is inferred
-			if ( ! this.hasOperator(key))
-			{
-				fullClause = key + ' = ' + whereMap[key];
-			}
-			else if (whereMap[key] === key)
-			{
-				fullClause = key;
-			}
-			else
-			{
-				fullClause = key + ' ' + whereMap[key];
-			}
-
-			// Separate the clause into separate pieces
-			var parts = this.parseJoin(fullClause);
-
-			// Filter explicit literals from lists of matches
-			if (whereValues.indexOf(whereMap[key]) !== -1)
-			{
-				var value = whereMap[key];
-				var identIndex = (helpers.isArray(parts.identifiers)) ? parts.identifiers.indexOf(value) : -1;
-				var litIndex = (helpers.isArray(parts.literals)) ? parts.literals.indexOf(value) : -1;
-				var combIndex = (helpers.isArray(parts.combined)) ? parts.combined.indexOf(value) : -1;
-				var funcIndex = (helpers.isArray(parts.functions)) ? parts.functions.indexOf(value) : -1;
-				var inOutputArray = outputValues.indexOf(value) !== -1;
-
-				// Remove the identifier in question,
-				// and add to the output values array
-				if (identIndex !== -1)
-				{
-					parts.identifiers.splice(identIndex, 1);
-
-					if ( ! inOutputArray)
-					{
-						outputValues.push(value);
-						inOutputArray = true;
-					}
-				}
-
-				// Remove the value from the literals list
-				// so it is not added twice
-				if (litIndex !== -1)
-				{
-					parts.literals.splice(litIndex, 1);
-
-					if ( ! inOutputArray)
-					{
-						outputValues.push(value);
-						inOutputArray = true;
-					}
-				}
-
-				// Remove the value from the combined list
-				// and replace it with a placeholder
-				if (combIndex !== -1)
-				{
-					// Make sure to skip functions when replacing values
-					if (funcIndex === -1)
-					{
-						parts.combined[combIndex] = '?';
-
-						if ( ! inOutputArray)
-						{
-							outputValues.push(value);
-							inOutputArray = true;
-						}
-					}
-				}
-			}
-
-			// Filter false positive identifiers
-			parts.identifiers = parts.identifiers.filter(function(item) {
-				var isInCombinedMatches = parts.combined.indexOf(item) !== -1;
-				var isNotInBlackList = identifierBlacklist.indexOf(item.toLowerCase()) === -1;
-
-				return isInCombinedMatches && isNotInBlackList;
-			});
-
-			// Quote identifiers
-			if (helpers.isArray(parts.identifiers))
-			{
-				parts.identifiers.forEach(function(ident) {
-					var index = parts.combined.indexOf(ident);
-					if (index !== -1)
-					{
-						parts.combined[index] = driver.quoteIdentifiers(ident);
-					}
-				});
-			}
-
-			// Replace each literal with a placeholder in the map
-			// and add the literal to the values,
-			// This should only apply to literal values that are not
-			// explicitly mapped to values, but have to be parsed from
-			// a where condition,
-			if (helpers.isArray(parts.literals))
-			{
-				parts.literals.forEach(function(lit) {
-					var litIndex = parts.combined.indexOf(lit);
-
-					if (litIndex !== -1)
-					{
-						parts.combined[litIndex] = (helpers.isArray(parts.operators)) ? '?' : '= ?';
-						outputValues.push(lit);
-					}
-				});
-			}
-
-			outputMap.push(parts.combined.join(' '));
-		}, this);
-
-		state.rawWhereValues = [];
-		state.whereValues = state.whereValues.concat(outputValues);
-		state.whereMap = outputMap;
-
-		return state;
-	};
-};
-
-module.exports = QueryParser;
-
-
- - - - - -
- -
-
- - - - DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. - -
- - - Documentation generated by JSDoc 3.3.0-beta1 - on Wed Jan 28th 2015 using the DocStrap template. - -
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - diff --git a/docs/scripts/URI.js b/docs/scripts/URI.js deleted file mode 100644 index f8546c7..0000000 --- a/docs/scripts/URI.js +++ /dev/null @@ -1,1429 +0,0 @@ -/*! - * URI.js - Mutating URLs - * - * Version: 1.8.3 - * - * Author: Rodney Rehm - * Web: http://medialize.github.com/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * GPL v3 http://opensource.org/licenses/GPL-3.0 - * - */ -(function(root, factory) { - // https://github.com/umdjs/umd/blob/master/returnExports.js - if (typeof exports === 'object') { - // Node - module.exports = factory(require('./punycode'), require('./IPv6'), require('./SecondLevelDomains')); - } else if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['./punycode', './IPv6', './SecondLevelDomains'], factory); - } else { - // Browser globals (root is window) - root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains); - } -}(this, function(punycode, IPv6, SLD) { - "use strict"; - - function URI(url, base) { - // Allow instantiation without the 'new' keyword - if (!(this instanceof URI)) { - return new URI(url, base); - } - if (url === undefined) { - if (typeof location !== 'undefined') { - url = location.href + ""; - } else { - url = ""; - } - } - this.href(url); - // resolve to base according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#constructor - if (base !== undefined) { - return this.absoluteTo(base); - } - return this; - }; - var p = URI.prototype; - var hasOwn = Object.prototype.hasOwnProperty; - - function escapeRegEx(string) { - // https://github.com/medialize/URI.js/commit/85ac21783c11f8ccab06106dba9735a31a86924d#commitcomment-821963 - return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); - } - - function isArray(obj) { - return String(Object.prototype.toString.call(obj)) === "[object Array]"; - } - - function filterArrayValues(data, value) { - var lookup = {}; - var i, length; - if (isArray(value)) { - for (i = 0, length = value.length; i < length; i++) { - lookup[value[i]] = true; - } - } else { - lookup[value] = true; - } - for (i = 0, length = data.length; i < length; i++) { - if (lookup[data[i]] !== undefined) { - data.splice(i, 1); - length--; - i--; - } - } - return data; - } - URI._parts = function() { - return { - protocol: null, - username: null, - password: null, - hostname: null, - urn: null, - port: null, - path: null, - query: null, - fragment: null, - // state - duplicateQueryParameters: URI.duplicateQueryParameters - }; - }; - // state: allow duplicate query parameters (a=1&a=1) - URI.duplicateQueryParameters = false; - // static properties - URI.protocol_expression = /^[a-z][a-z0-9-+-]*$/i; - URI.idn_expression = /[^a-z0-9\.-]/i; - URI.punycode_expression = /(xn--)/i; - // well, 333.444.555.666 matches, but it sure ain't no IPv4 - do we care? - URI.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; - // credits to Rich Brown - // source: http://forums.intermapper.com/viewtopic.php?p=1096#1096 - // specification: http://www.ietf.org/rfc/rfc4291.txt - URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; - // gruber revised expression - http://rodneyrehm.de/t/url-regex.html - URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig; - // http://www.iana.org/assignments/uri-schemes.html - // http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports - URI.defaultPorts = { - http: "80", - https: "443", - ftp: "21", - gopher: "70", - ws: "80", - wss: "443" - }; - // allowed hostname characters according to RFC 3986 - // ALPHA DIGIT "-" "." "_" "~" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" %encoded - // I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . - - URI.invalid_hostname_characters = /[^a-zA-Z0-9\.-]/; - // encoding / decoding according to RFC3986 - - function strictEncodeURIComponent(string) { - // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent - return encodeURIComponent(string).replace(/[!'()*]/g, escape).replace(/\*/g, "%2A"); - } - URI.encode = strictEncodeURIComponent; - URI.decode = decodeURIComponent; - URI.iso8859 = function() { - URI.encode = escape; - URI.decode = unescape; - }; - URI.unicode = function() { - URI.encode = strictEncodeURIComponent; - URI.decode = decodeURIComponent; - }; - URI.characters = { - pathname: { - encode: { - // RFC3986 2.1: For consistency, URI producers and normalizers should - // use uppercase hexadecimal digits for all percent-encodings. - expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig, - map: { - // -._~!'()* - "%24": "$", - "%26": "&", - "%2B": "+", - "%2C": ",", - "%3B": ";", - "%3D": "=", - "%3A": ":", - "%40": "@" - } - }, - decode: { - expression: /[\/\?#]/g, - map: { - "/": "%2F", - "?": "%3F", - "#": "%23" - } - } - }, - reserved: { - encode: { - // RFC3986 2.1: For consistency, URI producers and normalizers should - // use uppercase hexadecimal digits for all percent-encodings. - expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig, - map: { - // gen-delims - "%3A": ":", - "%2F": "/", - "%3F": "?", - "%23": "#", - "%5B": "[", - "%5D": "]", - "%40": "@", - // sub-delims - "%21": "!", - "%24": "$", - "%26": "&", - "%27": "'", - "%28": "(", - "%29": ")", - "%2A": "*", - "%2B": "+", - "%2C": ",", - "%3B": ";", - "%3D": "=" - } - } - } - }; - URI.encodeQuery = function(string) { - return URI.encode(string + "").replace(/%20/g, '+'); - }; - URI.decodeQuery = function(string) { - return URI.decode((string + "").replace(/\+/g, '%20')); - }; - URI.recodePath = function(string) { - var segments = (string + "").split('/'); - for (var i = 0, length = segments.length; i < length; i++) { - segments[i] = URI.encodePathSegment(URI.decode(segments[i])); - } - return segments.join('/'); - }; - URI.decodePath = function(string) { - var segments = (string + "").split('/'); - for (var i = 0, length = segments.length; i < length; i++) { - segments[i] = URI.decodePathSegment(segments[i]); - } - return segments.join('/'); - }; - // generate encode/decode path functions - var _parts = { - 'encode': 'encode', - 'decode': 'decode' - }; - var _part; - var generateAccessor = function(_group, _part) { - return function(string) { - return URI[_part](string + "").replace(URI.characters[_group][_part].expression, function(c) { - return URI.characters[_group][_part].map[c]; - }); - }; - }; - for (_part in _parts) { - URI[_part + "PathSegment"] = generateAccessor("pathname", _parts[_part]); - } - URI.encodeReserved = generateAccessor("reserved", "encode"); - URI.parse = function(string, parts) { - var pos, t; - if (!parts) { - parts = {}; - } - // [protocol"://"[username[":"password]"@"]hostname[":"port]"/"?][path]["?"querystring]["#"fragment] - // extract fragment - pos = string.indexOf('#'); - if (pos > -1) { - // escaping? - parts.fragment = string.substring(pos + 1) || null; - string = string.substring(0, pos); - } - // extract query - pos = string.indexOf('?'); - if (pos > -1) { - // escaping? - parts.query = string.substring(pos + 1) || null; - string = string.substring(0, pos); - } - // extract protocol - if (string.substring(0, 2) === '//') { - // relative-scheme - parts.protocol = ''; - string = string.substring(2); - // extract "user:pass@host:port" - string = URI.parseAuthority(string, parts); - } else { - pos = string.indexOf(':'); - if (pos > -1) { - parts.protocol = string.substring(0, pos); - if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) { - // : may be within the path - parts.protocol = undefined; - } else if (parts.protocol === 'file') { - // the file scheme: does not contain an authority - string = string.substring(pos + 3); - } else if (string.substring(pos + 1, pos + 3) === '//') { - string = string.substring(pos + 3); - // extract "user:pass@host:port" - string = URI.parseAuthority(string, parts); - } else { - string = string.substring(pos + 1); - parts.urn = true; - } - } - } - // what's left must be the path - parts.path = string; - // and we're done - return parts; - }; - URI.parseHost = function(string, parts) { - // extract host:port - var pos = string.indexOf('/'); - var bracketPos; - var t; - if (pos === -1) { - pos = string.length; - } - if (string[0] === "[") { - // IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6 - // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts - // IPv6+port in the format [2001:db8::1]:80 (for the time being) - bracketPos = string.indexOf(']'); - parts.hostname = string.substring(1, bracketPos) || null; - parts.port = string.substring(bracketPos + 2, pos) || null; - } else if (string.indexOf(':') !== string.lastIndexOf(':')) { - // IPv6 host contains multiple colons - but no port - // this notation is actually not allowed by RFC 3986, but we're a liberal parser - parts.hostname = string.substring(0, pos) || null; - parts.port = null; - } else { - t = string.substring(0, pos).split(':'); - parts.hostname = t[0] || null; - parts.port = t[1] || null; - } - if (parts.hostname && string.substring(pos)[0] !== '/') { - pos++; - string = "/" + string; - } - return string.substring(pos) || '/'; - }; - URI.parseAuthority = function(string, parts) { - string = URI.parseUserinfo(string, parts); - return URI.parseHost(string, parts); - }; - URI.parseUserinfo = function(string, parts) { - // extract username:password - var pos = string.indexOf('@'); - var firstSlash = string.indexOf('/'); - var t; - // authority@ must come before /path - if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) { - t = string.substring(0, pos).split(':'); - parts.username = t[0] ? URI.decode(t[0]) : null; - t.shift(); - parts.password = t[0] ? URI.decode(t.join(':')) : null; - string = string.substring(pos + 1); - } else { - parts.username = null; - parts.password = null; - } - return string; - }; - URI.parseQuery = function(string) { - if (!string) { - return {}; - } - // throw out the funky business - "?"[name"="value"&"]+ - string = string.replace(/&+/g, '&').replace(/^\?*&*|&+$/g, ''); - if (!string) { - return {}; - } - var items = {}; - var splits = string.split('&'); - var length = splits.length; - var v, name, value; - for (var i = 0; i < length; i++) { - v = splits[i].split('='); - name = URI.decodeQuery(v.shift()); - // no "=" is null according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#collect-url-parameters - value = v.length ? URI.decodeQuery(v.join('=')) : null; - if (items[name]) { - if (typeof items[name] === "string") { - items[name] = [items[name]]; - } - items[name].push(value); - } else { - items[name] = value; - } - } - return items; - }; - URI.build = function(parts) { - var t = ""; - if (parts.protocol) { - t += parts.protocol + ":"; - } - if (!parts.urn && (t || parts.hostname)) { - t += '//'; - } - t += (URI.buildAuthority(parts) || ''); - if (typeof parts.path === "string") { - if (parts.path[0] !== '/' && typeof parts.hostname === "string") { - t += '/'; - } - t += parts.path; - } - if (typeof parts.query === "string" && parts.query) { - t += '?' + parts.query; - } - if (typeof parts.fragment === "string" && parts.fragment) { - t += '#' + parts.fragment; - } - return t; - }; - URI.buildHost = function(parts) { - var t = ""; - if (!parts.hostname) { - return ""; - } else if (URI.ip6_expression.test(parts.hostname)) { - if (parts.port) { - t += "[" + parts.hostname + "]:" + parts.port; - } else { - // don't know if we should always wrap IPv6 in [] - // the RFC explicitly says SHOULD, not MUST. - t += parts.hostname; - } - } else { - t += parts.hostname; - if (parts.port) { - t += ':' + parts.port; - } - } - return t; - }; - URI.buildAuthority = function(parts) { - return URI.buildUserinfo(parts) + URI.buildHost(parts); - }; - URI.buildUserinfo = function(parts) { - var t = ""; - if (parts.username) { - t += URI.encode(parts.username); - if (parts.password) { - t += ':' + URI.encode(parts.password); - } - t += "@"; - } - return t; - }; - URI.buildQuery = function(data, duplicates) { - // according to http://tools.ietf.org/html/rfc3986 or http://labs.apache.org/webarch/uri/rfc/rfc3986.html - // being »-._~!$&'()*+,;=:@/?« %HEX and alnum are allowed - // the RFC explicitly states ?/foo being a valid use case, no mention of parameter syntax! - // URI.js treats the query string as being application/x-www-form-urlencoded - // see http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type - var t = ""; - var unique, key, i, length; - for (key in data) { - if (hasOwn.call(data, key) && key) { - if (isArray(data[key])) { - unique = {}; - for (i = 0, length = data[key].length; i < length; i++) { - if (data[key][i] !== undefined && unique[data[key][i] + ""] === undefined) { - t += "&" + URI.buildQueryParameter(key, data[key][i]); - if (duplicates !== true) { - unique[data[key][i] + ""] = true; - } - } - } - } else if (data[key] !== undefined) { - t += '&' + URI.buildQueryParameter(key, data[key]); - } - } - } - return t.substring(1); - }; - URI.buildQueryParameter = function(name, value) { - // http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type -- application/x-www-form-urlencoded - // don't append "=" for null values, according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#url-parameter-serialization - return URI.encodeQuery(name) + (value !== null ? "=" + URI.encodeQuery(value) : ""); - }; - URI.addQuery = function(data, name, value) { - if (typeof name === "object") { - for (var key in name) { - if (hasOwn.call(name, key)) { - URI.addQuery(data, key, name[key]); - } - } - } else if (typeof name === "string") { - if (data[name] === undefined) { - data[name] = value; - return; - } else if (typeof data[name] === "string") { - data[name] = [data[name]]; - } - if (!isArray(value)) { - value = [value]; - } - data[name] = data[name].concat(value); - } else { - throw new TypeError("URI.addQuery() accepts an object, string as the name parameter"); - } - }; - URI.removeQuery = function(data, name, value) { - var i, length, key; - if (isArray(name)) { - for (i = 0, length = name.length; i < length; i++) { - data[name[i]] = undefined; - } - } else if (typeof name === "object") { - for (key in name) { - if (hasOwn.call(name, key)) { - URI.removeQuery(data, key, name[key]); - } - } - } else if (typeof name === "string") { - if (value !== undefined) { - if (data[name] === value) { - data[name] = undefined; - } else if (isArray(data[name])) { - data[name] = filterArrayValues(data[name], value); - } - } else { - data[name] = undefined; - } - } else { - throw new TypeError("URI.addQuery() accepts an object, string as the first parameter"); - } - }; - URI.commonPath = function(one, two) { - var length = Math.min(one.length, two.length); - var pos; - // find first non-matching character - for (pos = 0; pos < length; pos++) { - if (one[pos] !== two[pos]) { - pos--; - break; - } - } - if (pos < 1) { - return one[0] === two[0] && one[0] === '/' ? '/' : ''; - } - // revert to last / - if (one[pos] !== '/') { - pos = one.substring(0, pos).lastIndexOf('/'); - } - return one.substring(0, pos + 1); - }; - URI.withinString = function(string, callback) { - // expression used is "gruber revised" (@gruber v2) determined to be the best solution in - // a regex sprint we did a couple of ages ago at - // * http://mathiasbynens.be/demo/url-regex - // * http://rodneyrehm.de/t/url-regex.html - return string.replace(URI.find_uri_expression, callback); - }; - URI.ensureValidHostname = function(v) { - // Theoretically URIs allow percent-encoding in Hostnames (according to RFC 3986) - // they are not part of DNS and therefore ignored by URI.js - if (v.match(URI.invalid_hostname_characters)) { - // test punycode - if (!punycode) { - throw new TypeError("Hostname '" + v + "' contains characters other than [A-Z0-9.-] and Punycode.js is not available"); - } - if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) { - throw new TypeError("Hostname '" + v + "' contains characters other than [A-Z0-9.-]"); - } - } - }; - p.build = function(deferBuild) { - if (deferBuild === true) { - this._deferred_build = true; - } else if (deferBuild === undefined || this._deferred_build) { - this._string = URI.build(this._parts); - this._deferred_build = false; - } - return this; - }; - p.clone = function() { - return new URI(this); - }; - p.valueOf = p.toString = function() { - return this.build(false)._string; - }; - // generate simple accessors - _parts = { - protocol: 'protocol', - username: 'username', - password: 'password', - hostname: 'hostname', - port: 'port' - }; - generateAccessor = function(_part) { - return function(v, build) { - if (v === undefined) { - return this._parts[_part] || ""; - } else { - this._parts[_part] = v; - this.build(!build); - return this; - } - }; - }; - for (_part in _parts) { - p[_part] = generateAccessor(_parts[_part]); - } - // generate accessors with optionally prefixed input - _parts = { - query: '?', - fragment: '#' - }; - generateAccessor = function(_part, _key) { - return function(v, build) { - if (v === undefined) { - return this._parts[_part] || ""; - } else { - if (v !== null) { - v = v + ""; - if (v[0] === _key) { - v = v.substring(1); - } - } - this._parts[_part] = v; - this.build(!build); - return this; - } - }; - }; - for (_part in _parts) { - p[_part] = generateAccessor(_part, _parts[_part]); - } - // generate accessors with prefixed output - _parts = { - search: ['?', 'query'], - hash: ['#', 'fragment'] - }; - generateAccessor = function(_part, _key) { - return function(v, build) { - var t = this[_part](v, build); - return typeof t === "string" && t.length ? (_key + t) : t; - }; - }; - for (_part in _parts) { - p[_part] = generateAccessor(_parts[_part][1], _parts[_part][0]); - } - p.pathname = function(v, build) { - if (v === undefined || v === true) { - var res = this._parts.path || (this._parts.urn ? '' : '/'); - return v ? URI.decodePath(res) : res; - } else { - this._parts.path = v ? URI.recodePath(v) : "/"; - this.build(!build); - return this; - } - }; - p.path = p.pathname; - p.href = function(href, build) { - var key; - if (href === undefined) { - return this.toString(); - } - this._string = ""; - this._parts = URI._parts(); - var _URI = href instanceof URI; - var _object = typeof href === "object" && (href.hostname || href.path); - // window.location is reported to be an object, but it's not the sort - // of object we're looking for: - // * location.protocol ends with a colon - // * location.query != object.search - // * location.hash != object.fragment - // simply serializing the unknown object should do the trick - // (for location, not for everything...) - if (!_URI && _object && Object.prototype.toString.call(href) !== "[object Object]") { - href = href.toString(); - } - if (typeof href === "string") { - this._parts = URI.parse(href, this._parts); - } else if (_URI || _object) { - var src = _URI ? href._parts : href; - for (key in src) { - if (hasOwn.call(this._parts, key)) { - this._parts[key] = src[key]; - } - } - } else { - throw new TypeError("invalid input"); - } - this.build(!build); - return this; - }; - // identification accessors - p.is = function(what) { - var ip = false; - var ip4 = false; - var ip6 = false; - var name = false; - var sld = false; - var idn = false; - var punycode = false; - var relative = !this._parts.urn; - if (this._parts.hostname) { - relative = false; - ip4 = URI.ip4_expression.test(this._parts.hostname); - ip6 = URI.ip6_expression.test(this._parts.hostname); - ip = ip4 || ip6; - name = !ip; - sld = name && SLD && SLD.has(this._parts.hostname); - idn = name && URI.idn_expression.test(this._parts.hostname); - punycode = name && URI.punycode_expression.test(this._parts.hostname); - } - switch (what.toLowerCase()) { - case 'relative': - return relative; - case 'absolute': - return !relative; - // hostname identification - case 'domain': - case 'name': - return name; - case 'sld': - return sld; - case 'ip': - return ip; - case 'ip4': - case 'ipv4': - case 'inet4': - return ip4; - case 'ip6': - case 'ipv6': - case 'inet6': - return ip6; - case 'idn': - return idn; - case 'url': - return !this._parts.urn; - case 'urn': - return !!this._parts.urn; - case 'punycode': - return punycode; - } - return null; - }; - // component specific input validation - var _protocol = p.protocol; - var _port = p.port; - var _hostname = p.hostname; - p.protocol = function(v, build) { - if (v !== undefined) { - if (v) { - // accept trailing :// - v = v.replace(/:(\/\/)?$/, ''); - if (v.match(/[^a-zA-z0-9\.+-]/)) { - throw new TypeError("Protocol '" + v + "' contains characters other than [A-Z0-9.+-]"); - } - } - } - return _protocol.call(this, v, build); - }; - p.scheme = p.protocol; - p.port = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (v !== undefined) { - if (v === 0) { - v = null; - } - if (v) { - v += ""; - if (v[0] === ":") { - v = v.substring(1); - } - if (v.match(/[^0-9]/)) { - throw new TypeError("Port '" + v + "' contains characters other than [0-9]"); - } - } - } - return _port.call(this, v, build); - }; - p.hostname = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (v !== undefined) { - var x = {}; - URI.parseHost(v, x); - v = x.hostname; - } - return _hostname.call(this, v, build); - }; - // compound accessors - p.host = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (v === undefined) { - return this._parts.hostname ? URI.buildHost(this._parts) : ""; - } else { - URI.parseHost(v, this._parts); - this.build(!build); - return this; - } - }; - p.authority = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (v === undefined) { - return this._parts.hostname ? URI.buildAuthority(this._parts) : ""; - } else { - URI.parseAuthority(v, this._parts); - this.build(!build); - return this; - } - }; - p.userinfo = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (v === undefined) { - if (!this._parts.username) { - return ""; - } - var t = URI.buildUserinfo(this._parts); - return t.substring(0, t.length - 1); - } else { - if (v[v.length - 1] !== '@') { - v += '@'; - } - URI.parseUserinfo(v, this._parts); - this.build(!build); - return this; - } - }; - p.resource = function(v, build) { - var parts; - if (v === undefined) { - return this.path() + this.search() + this.hash(); - } - parts = URI.parse(v); - this._parts.path = parts.path; - this._parts.query = parts.query; - this._parts.fragment = parts.fragment; - this.build(!build); - return this; - }; - // fraction accessors - p.subdomain = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - // convenience, return "www" from "www.example.org" - if (v === undefined) { - if (!this._parts.hostname || this.is('IP')) { - return ""; - } - // grab domain and add another segment - var end = this._parts.hostname.length - this.domain().length - 1; - return this._parts.hostname.substring(0, end) || ""; - } else { - var e = this._parts.hostname.length - this.domain().length; - var sub = this._parts.hostname.substring(0, e); - var replace = new RegExp('^' + escapeRegEx(sub)); - if (v && v[v.length - 1] !== '.') { - v += "."; - } - if (v) { - URI.ensureValidHostname(v); - } - this._parts.hostname = this._parts.hostname.replace(replace, v); - this.build(!build); - return this; - } - }; - p.domain = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (typeof v === 'boolean') { - build = v; - v = undefined; - } - // convenience, return "example.org" from "www.example.org" - if (v === undefined) { - if (!this._parts.hostname || this.is('IP')) { - return ""; - } - // if hostname consists of 1 or 2 segments, it must be the domain - var t = this._parts.hostname.match(/\./g); - if (t && t.length < 2) { - return this._parts.hostname; - } - // grab tld and add another segment - var end = this._parts.hostname.length - this.tld(build).length - 1; - end = this._parts.hostname.lastIndexOf('.', end - 1) + 1; - return this._parts.hostname.substring(end) || ""; - } else { - if (!v) { - throw new TypeError("cannot set domain empty"); - } - URI.ensureValidHostname(v); - if (!this._parts.hostname || this.is('IP')) { - this._parts.hostname = v; - } else { - var replace = new RegExp(escapeRegEx(this.domain()) + "$"); - this._parts.hostname = this._parts.hostname.replace(replace, v); - } - this.build(!build); - return this; - } - }; - p.tld = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (typeof v === 'boolean') { - build = v; - v = undefined; - } - // return "org" from "www.example.org" - if (v === undefined) { - if (!this._parts.hostname || this.is('IP')) { - return ""; - } - var pos = this._parts.hostname.lastIndexOf('.'); - var tld = this._parts.hostname.substring(pos + 1); - if (build !== true && SLD && SLD.list[tld.toLowerCase()]) { - return SLD.get(this._parts.hostname) || tld; - } - return tld; - } else { - var replace; - if (!v) { - throw new TypeError("cannot set TLD empty"); - } else if (v.match(/[^a-zA-Z0-9-]/)) { - if (SLD && SLD.is(v)) { - replace = new RegExp(escapeRegEx(this.tld()) + "$"); - this._parts.hostname = this._parts.hostname.replace(replace, v); - } else { - throw new TypeError("TLD '" + v + "' contains characters other than [A-Z0-9]"); - } - } else if (!this._parts.hostname || this.is('IP')) { - throw new ReferenceError("cannot set TLD on non-domain host"); - } else { - replace = new RegExp(escapeRegEx(this.tld()) + "$"); - this._parts.hostname = this._parts.hostname.replace(replace, v); - } - this.build(!build); - return this; - } - }; - p.directory = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (v === undefined || v === true) { - if (!this._parts.path && !this._parts.hostname) { - return ''; - } - if (this._parts.path === '/') { - return '/'; - } - var end = this._parts.path.length - this.filename().length - 1; - var res = this._parts.path.substring(0, end) || (this._parts.hostname ? "/" : ""); - return v ? URI.decodePath(res) : res; - } else { - var e = this._parts.path.length - this.filename().length; - var directory = this._parts.path.substring(0, e); - var replace = new RegExp('^' + escapeRegEx(directory)); - // fully qualifier directories begin with a slash - if (!this.is('relative')) { - if (!v) { - v = '/'; - } - if (v[0] !== '/') { - v = "/" + v; - } - } - // directories always end with a slash - if (v && v[v.length - 1] !== '/') { - v += '/'; - } - v = URI.recodePath(v); - this._parts.path = this._parts.path.replace(replace, v); - this.build(!build); - return this; - } - }; - p.filename = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (v === undefined || v === true) { - if (!this._parts.path || this._parts.path === '/') { - return ""; - } - var pos = this._parts.path.lastIndexOf('/'); - var res = this._parts.path.substring(pos + 1); - return v ? URI.decodePathSegment(res) : res; - } else { - var mutatedDirectory = false; - if (v[0] === '/') { - v = v.substring(1); - } - if (v.match(/\.?\//)) { - mutatedDirectory = true; - } - var replace = new RegExp(escapeRegEx(this.filename()) + "$"); - v = URI.recodePath(v); - this._parts.path = this._parts.path.replace(replace, v); - if (mutatedDirectory) { - this.normalizePath(build); - } else { - this.build(!build); - } - return this; - } - }; - p.suffix = function(v, build) { - if (this._parts.urn) { - return v === undefined ? '' : this; - } - if (v === undefined || v === true) { - if (!this._parts.path || this._parts.path === '/') { - return ""; - } - var filename = this.filename(); - var pos = filename.lastIndexOf('.'); - var s, res; - if (pos === -1) { - return ""; - } - // suffix may only contain alnum characters (yup, I made this up.) - s = filename.substring(pos + 1); - res = (/^[a-z0-9%]+$/i).test(s) ? s : ""; - return v ? URI.decodePathSegment(res) : res; - } else { - if (v[0] === '.') { - v = v.substring(1); - } - var suffix = this.suffix(); - var replace; - if (!suffix) { - if (!v) { - return this; - } - this._parts.path += '.' + URI.recodePath(v); - } else if (!v) { - replace = new RegExp(escapeRegEx("." + suffix) + "$"); - } else { - replace = new RegExp(escapeRegEx(suffix) + "$"); - } - if (replace) { - v = URI.recodePath(v); - this._parts.path = this._parts.path.replace(replace, v); - } - this.build(!build); - return this; - } - }; - p.segment = function(segment, v, build) { - var separator = this._parts.urn ? ':' : '/'; - var path = this.path(); - var absolute = path.substring(0, 1) === '/'; - var segments = path.split(separator); - if (typeof segment !== 'number') { - build = v; - v = segment; - segment = undefined; - } - if (segment !== undefined && typeof segment !== 'number') { - throw new Error("Bad segment '" + segment + "', must be 0-based integer"); - } - if (absolute) { - segments.shift(); - } - if (segment < 0) { - // allow negative indexes to address from the end - segment = Math.max(segments.length + segment, 0); - } - if (v === undefined) { - return segment === undefined ? segments : segments[segment]; - } else if (segment === null || segments[segment] === undefined) { - if (isArray(v)) { - segments = v; - } else if (v || (typeof v === "string" && v.length)) { - if (segments[segments.length - 1] === "") { - // empty trailing elements have to be overwritten - // to prefent results such as /foo//bar - segments[segments.length - 1] = v; - } else { - segments.push(v); - } - } - } else { - if (v || (typeof v === "string" && v.length)) { - segments[segment] = v; - } else { - segments.splice(segment, 1); - } - } - if (absolute) { - segments.unshift(""); - } - return this.path(segments.join(separator), build); - }; - // mutating query string - var q = p.query; - p.query = function(v, build) { - if (v === true) { - return URI.parseQuery(this._parts.query); - } else if (v !== undefined && typeof v !== "string") { - this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters); - this.build(!build); - return this; - } else { - return q.call(this, v, build); - } - }; - p.addQuery = function(name, value, build) { - var data = URI.parseQuery(this._parts.query); - URI.addQuery(data, name, value === undefined ? null : value); - this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters); - if (typeof name !== "string") { - build = value; - } - this.build(!build); - return this; - }; - p.removeQuery = function(name, value, build) { - var data = URI.parseQuery(this._parts.query); - URI.removeQuery(data, name, value); - this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters); - if (typeof name !== "string") { - build = value; - } - this.build(!build); - return this; - }; - p.addSearch = p.addQuery; - p.removeSearch = p.removeQuery; - // sanitizing URLs - p.normalize = function() { - if (this._parts.urn) { - return this.normalizeProtocol(false).normalizeQuery(false).normalizeFragment(false).build(); - } - return this.normalizeProtocol(false).normalizeHostname(false).normalizePort(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build(); - }; - p.normalizeProtocol = function(build) { - if (typeof this._parts.protocol === "string") { - this._parts.protocol = this._parts.protocol.toLowerCase(); - this.build(!build); - } - return this; - }; - p.normalizeHostname = function(build) { - if (this._parts.hostname) { - if (this.is('IDN') && punycode) { - this._parts.hostname = punycode.toASCII(this._parts.hostname); - } else if (this.is('IPv6') && IPv6) { - this._parts.hostname = IPv6.best(this._parts.hostname); - } - this._parts.hostname = this._parts.hostname.toLowerCase(); - this.build(!build); - } - return this; - }; - p.normalizePort = function(build) { - // remove port of it's the protocol's default - if (typeof this._parts.protocol === "string" && this._parts.port === URI.defaultPorts[this._parts.protocol]) { - this._parts.port = null; - this.build(!build); - } - return this; - }; - p.normalizePath = function(build) { - if (this._parts.urn) { - return this; - } - if (!this._parts.path || this._parts.path === '/') { - return this; - } - var _was_relative; - var _was_relative_prefix; - var _path = this._parts.path; - var _parent, _pos; - // handle relative paths - if (_path[0] !== '/') { - if (_path[0] === '.') { - _was_relative_prefix = _path.substring(0, _path.indexOf('/')); - } - _was_relative = true; - _path = '/' + _path; - } - // resolve simples - _path = _path.replace(/(\/(\.\/)+)|\/{2,}/g, '/'); - // resolve parents - while (true) { - _parent = _path.indexOf('/../'); - if (_parent === -1) { - // no more ../ to resolve - break; - } else if (_parent === 0) { - // top level cannot be relative... - _path = _path.substring(3); - break; - } - _pos = _path.substring(0, _parent).lastIndexOf('/'); - if (_pos === -1) { - _pos = _parent; - } - _path = _path.substring(0, _pos) + _path.substring(_parent + 3); - } - // revert to relative - if (_was_relative && this.is('relative')) { - if (_was_relative_prefix) { - _path = _was_relative_prefix + _path; - } else { - _path = _path.substring(1); - } - } - _path = URI.recodePath(_path); - this._parts.path = _path; - this.build(!build); - return this; - }; - p.normalizePathname = p.normalizePath; - p.normalizeQuery = function(build) { - if (typeof this._parts.query === "string") { - if (!this._parts.query.length) { - this._parts.query = null; - } else { - this.query(URI.parseQuery(this._parts.query)); - } - this.build(!build); - } - return this; - }; - p.normalizeFragment = function(build) { - if (!this._parts.fragment) { - this._parts.fragment = null; - this.build(!build); - } - return this; - }; - p.normalizeSearch = p.normalizeQuery; - p.normalizeHash = p.normalizeFragment; - p.iso8859 = function() { - // expect unicode input, iso8859 output - var e = URI.encode; - var d = URI.decode; - URI.encode = escape; - URI.decode = decodeURIComponent; - this.normalize(); - URI.encode = e; - URI.decode = d; - return this; - }; - p.unicode = function() { - // expect iso8859 input, unicode output - var e = URI.encode; - var d = URI.decode; - URI.encode = strictEncodeURIComponent; - URI.decode = unescape; - this.normalize(); - URI.encode = e; - URI.decode = d; - return this; - }; - p.readable = function() { - var uri = this.clone(); - // removing username, password, because they shouldn't be displayed according to RFC 3986 - uri.username("").password("").normalize(); - var t = ''; - if (uri._parts.protocol) { - t += uri._parts.protocol + '://'; - } - if (uri._parts.hostname) { - if (uri.is('punycode') && punycode) { - t += punycode.toUnicode(uri._parts.hostname); - if (uri._parts.port) { - t += ":" + uri._parts.port; - } - } else { - t += uri.host(); - } - } - if (uri._parts.hostname && uri._parts.path && uri._parts.path[0] !== '/') { - t += '/'; - } - t += uri.path(true); - if (uri._parts.query) { - var q = ''; - for (var i = 0, qp = uri._parts.query.split('&'), l = qp.length; i < l; i++) { - var kv = (qp[i] || "").split('='); - q += '&' + URI.decodeQuery(kv[0]).replace(/&/g, '%26'); - if (kv[1] !== undefined) { - q += "=" + URI.decodeQuery(kv[1]).replace(/&/g, '%26'); - } - } - t += '?' + q.substring(1); - } - t += uri.hash(); - return t; - }; - // resolving relative and absolute URLs - p.absoluteTo = function(base) { - var resolved = this.clone(); - var properties = ['protocol', 'username', 'password', 'hostname', 'port']; - var basedir, i, p; - if (this._parts.urn) { - throw new Error('URNs do not have any generally defined hierachical components'); - } - if (this._parts.hostname) { - return resolved; - } - if (!(base instanceof URI)) { - base = new URI(base); - } - for (i = 0, p; p = properties[i]; i++) { - resolved._parts[p] = base._parts[p]; - } - properties = ['query', 'path']; - for (i = 0, p; p = properties[i]; i++) { - if (!resolved._parts[p] && base._parts[p]) { - resolved._parts[p] = base._parts[p]; - } - } - if (resolved.path()[0] !== '/') { - basedir = base.directory(); - resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path; - resolved.normalizePath(); - } - resolved.build(); - return resolved; - }; - p.relativeTo = function(base) { - var relative = this.clone(); - var properties = ['protocol', 'username', 'password', 'hostname', 'port']; - var common, _base, _this, _base_diff, _this_diff; - if (this._parts.urn) { - throw new Error('URNs do not have any generally defined hierachical components'); - } - if (!(base instanceof URI)) { - base = new URI(base); - } - if (this.path()[0] !== '/' || base.path()[0] !== '/') { - throw new Error('Cannot calculate common path from non-relative URLs'); - } - // determine common sub path - common = URI.commonPath(relative.path(), base.path()); - // no relation if there's nothing in common - if (!common || common === '/') { - return relative; - } - // relative paths don't have authority - for (var i = 0, p; p = properties[i]; i++) { - relative._parts[p] = null; - } - _base = base.directory(); - _this = this.directory(); - // base and this are on the same level - if (_base === _this) { - relative._parts.path = './' + relative.filename(); - return relative.build(); - } - _base_diff = _base.substring(common.length); - _this_diff = _this.substring(common.length); - // this is a descendant of base - if (_base + '/' === common) { - if (_this_diff) { - _this_diff += '/'; - } - relative._parts.path = './' + _this_diff + relative.filename(); - return relative.build(); - } - // this is a descendant of base - var parents = '../'; - var _common = new RegExp('^' + escapeRegEx(common)); - var _parents = _base.replace(_common, '/').match(/\//g).length - 1; - while (_parents--) { - parents += '../'; - } - relative._parts.path = relative._parts.path.replace(_common, parents); - return relative.build(); - }; - // comparing URIs - p.equals = function(uri) { - var one = this.clone(); - var two = new URI(uri); - var one_map = {}; - var two_map = {}; - var checked = {}; - var one_query, two_query, key; - one.normalize(); - two.normalize(); - // exact match - if (one.toString() === two.toString()) { - return true; - } - // extract query string - one_query = one.query(); - two_query = two.query(); - one.query(""); - two.query(""); - // definitely not equal if not even non-query parts match - if (one.toString() !== two.toString()) { - return false; - } - // query parameters have the same length, even if they're permutated - if (one_query.length !== two_query.length) { - return false; - } - one_map = URI.parseQuery(one_query); - two_map = URI.parseQuery(two_query); - for (key in one_map) { - if (hasOwn.call(one_map, key)) { - if (!isArray(one_map[key])) { - if (one_map[key] !== two_map[key]) { - return false; - } - } else { - if (!isArray(two_map[key])) { - return false; - } - // arrays can't be equal if they have different amount of content - if (one_map[key].length !== two_map[key].length) { - return false; - } - one_map[key].sort(); - two_map[key].sort(); - for (var i = 0, l = one_map[key].length; i < l; i++) { - if (one_map[key][i] !== two_map[key][i]) { - return false; - } - } - } - checked[key] = true; - } - } - for (key in two_map) { - if (hasOwn.call(two_map, key)) { - if (!checked[key]) { - // two contains a parameter not present in one - return false; - } - } - } - return true; - }; - // state - p.duplicateQueryParameters = function(v) { - this._parts.duplicateQueryParameters = !! v; - return this; - }; - return URI; -})); \ No newline at end of file diff --git a/docs/scripts/bootstrap-dropdown.js b/docs/scripts/bootstrap-dropdown.js deleted file mode 100644 index d04da5d..0000000 --- a/docs/scripts/bootstrap-dropdown.js +++ /dev/null @@ -1,169 +0,0 @@ -/* ============================================================ - * bootstrap-dropdown.js v2.3.2 - * http://getbootstrap.com/2.3.2/javascript.html#dropdowns - * ============================================================ - * Copyright 2013 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* DROPDOWN CLASS DEFINITION - * ========================= */ - - var toggle = '[data-toggle=dropdown]' - , Dropdown = function (element) { - var $el = $(element).on('click.dropdown.data-api', this.toggle) - $('html').on('click.dropdown.data-api', function () { - $el.parent().removeClass('open') - }) - } - - Dropdown.prototype = { - - constructor: Dropdown - - , toggle: function (e) { - var $this = $(this) - , $parent - , isActive - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - if ('ontouchstart' in document.documentElement) { - // if mobile we we use a backdrop because click events don't delegate - $('