From 9c1d7e09b3e37844c8c907435be256f28359dd73 Mon Sep 17 00:00:00 2001
From: "Timothy J. Warren"
Date: Thu, 30 Oct 2014 11:10:47 -0400
Subject: [PATCH] Update docs
---
README.md | 1 +
docs/index.html | 1 +
docs/module-query-builder.html | 68 +++++++++++++++++-----------------
docs/query-builder.js.html | 8 ++--
package.json | 2 +-
5 files changed, 42 insertions(+), 38 deletions(-)
diff --git a/README.md b/README.md
index 261f56e..89da254 100755
--- a/README.md
+++ b/README.md
@@ -39,4 +39,5 @@ A node query builder for various SQL databases, based on CodeIgniter's query bui
* Generated documentation is in the docs/ folder
* `tests/query-builder-base.js` contains a lot of usage examples
* The `tests/adapters` folder contains examples of how to set up a connection for the appropriate database library
+* The documentation generated for the latest dev build is also [Available](https://github.timshomepage.net/node-query/docs/)
diff --git a/docs/index.html b/docs/index.html
index eeed6be..65a6523 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -119,6 +119,7 @@ query.select('foo')
Generated documentation is in the docs/ folder
tests/query-builder-base.js
contains a lot of usage examples
The tests/adapters
folder contains examples of how to set up a connection for the appropriate database library
+The documentation generated for the latest dev build is also Available
diff --git a/docs/module-query-builder.html b/docs/module-query-builder.html
index 1c9d7cb..26db52a 100644
--- a/docs/module-query-builder.html
+++ b/docs/module-query-builder.html
@@ -383,7 +383,7 @@
@@ -519,7 +519,7 @@
@@ -764,7 +764,7 @@
@@ -955,7 +955,7 @@
@@ -1154,7 +1154,7 @@
@@ -1355,7 +1355,7 @@
@@ -1546,7 +1546,7 @@
@@ -1641,7 +1641,7 @@
@@ -1788,7 +1788,7 @@
@@ -1875,7 +1875,7 @@
@@ -1962,7 +1962,7 @@
@@ -2147,7 +2147,7 @@
@@ -2357,7 +2357,7 @@
@@ -2539,7 +2539,7 @@
@@ -2577,7 +2577,7 @@
Example
- query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}], callbackFunction);S
+ query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}], callbackFunction);
@@ -2771,7 +2771,7 @@
@@ -2997,7 +2997,7 @@
@@ -3176,7 +3176,7 @@
@@ -3402,7 +3402,7 @@
@@ -3593,7 +3593,7 @@
@@ -3681,7 +3681,7 @@ prefixed with 'OR'
@@ -3866,7 +3866,7 @@ prefixed with 'OR'
@@ -4092,7 +4092,7 @@ prefixed with 'OR'
@@ -4180,7 +4180,7 @@ prefixed with 'OR NOT'
@@ -4406,7 +4406,7 @@ prefixed with 'OR NOT'
@@ -4591,7 +4591,7 @@ prefixed with 'OR NOT'
@@ -4750,7 +4750,7 @@ prefixed with 'OR NOT'
@@ -4909,7 +4909,7 @@ prefixed with 'OR NOT'
@@ -5048,7 +5048,7 @@ prefixed with 'OR NOT'
@@ -5230,7 +5230,7 @@ prefixed with 'OR NOT'
@@ -5440,7 +5440,7 @@ prefixed with 'OR NOT'
@@ -5625,7 +5625,7 @@ prefixed with 'OR NOT'
@@ -5784,7 +5784,7 @@ prefixed with 'OR NOT'
@@ -5943,7 +5943,7 @@ prefixed with 'OR NOT'
diff --git a/docs/query-builder.js.html b/docs/query-builder.js.html
index 8730819..422b7b5 100644
--- a/docs/query-builder.js.html
+++ b/docs/query-builder.js.html
@@ -262,7 +262,7 @@ var QueryBuilder = function(driver, adapter) {
_p.mixedSet('whereMap', 'both', args.key, args.val);
_p.mixedSet('whereValues', 'value', args.key, args.val);
},
- where: function(key, val, conj) {
+ where: function(key, val, defaultConj) {
// Normalize key and value and insert into state.whereMap
_p.whereMixedSet(key, val);
@@ -280,7 +280,8 @@ var QueryBuilder = function(driver, adapter) {
lastItem = state.queryMap[state.queryMap.length - 1];
// Determine the correct conjunction
- if (state.queryMap.length < 1 || firstItem.conjunction.contains('JOIN'))
+ var conj = defaultConj;
+ if (state.queryMap.length === 0 || firstItem.conjunction.contains('JOIN'))
{
conj = " WHERE ";
}
@@ -355,6 +356,7 @@ var QueryBuilder = function(driver, adapter) {
vals = state.values.concat(state.whereValues);
}
+//console.log(state.queryMap);
//console.log(sql);
//console.log(vals);
//console.log('------------------------');
@@ -856,7 +858,7 @@ var QueryBuilder = function(driver, adapter) {
* @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);S
+ * @example query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}], callbackFunction);
* @return void
*/
this.insertBatch = function(/* table, data, callback */) {
diff --git a/package.json b/package.json
index b7659e7..b35dd94 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ci-node-query",
- "version": "0.1.0",
+ "version": "0.1.1",
"description": "A query builder for node based on the one in CodeIgniter",
"author": "Timothy J Warren ",
"engines": {