Make third init argument optional in some cases
This commit is contained in:
parent
bc959b4952
commit
da085f9e14
@ -11,10 +11,12 @@ var NodeQuery = function() {
|
||||
* @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
|
||||
* @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');
|
||||
|
||||
|
@ -230,7 +230,6 @@ var QueryBuilder = function(driver, adapter) {
|
||||
});
|
||||
},
|
||||
whereNull: function(field, stmt, conj) {
|
||||
conj = conj || 'AND';
|
||||
field = driver.quoteIdentifiers(field);
|
||||
var item = field + ' ' + stmt;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ci-node-query",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "A query builder for node based on the one in CodeIgniter",
|
||||
"author": "Timothy J Warren <tim@timshomepage.net>",
|
||||
"engines": {
|
||||
|
@ -17,7 +17,7 @@ var connection = mysql.createConnection(config.conn);
|
||||
|
||||
// Set up the query builder object
|
||||
var nodeQuery = require('../../lib/node-query');
|
||||
var qb = nodeQuery.init('mysql', connection, adapterName);
|
||||
var qb = nodeQuery.init('mysql', connection);
|
||||
|
||||
// Set up the test base
|
||||
testBase._setUp(qb, function(test, err, rows) {
|
||||
|
@ -22,7 +22,7 @@ connection.connect(function(err) {
|
||||
|
||||
// Set up the query builder object
|
||||
var nodeQuery = require('../../lib/node-query');
|
||||
var qb = nodeQuery.init('pg', connection, adapterName);
|
||||
var qb = nodeQuery.init('pg', connection);
|
||||
|
||||
|
||||
// Set up the test base
|
||||
|
Loading…
Reference in New Issue
Block a user