Comparing version 0.0.1 to 0.0.2
@@ -10,3 +10,3 @@ var Node = function(type) { | ||
Node.prototype.add = function(node) { | ||
this.nodes.push(node); | ||
this.nodes.push(typeof node === 'string' ? new TextNode(node) : node.toNode()); | ||
return this; | ||
@@ -32,1 +32,2 @@ } | ||
module.exports = Node; | ||
var TextNode = require(__dirname + '/text'); |
@@ -13,3 +13,3 @@ var Node = require(__dirname); | ||
//arg could be a column instead of a node | ||
select.add(args[i].toNode()); | ||
select.add(args[i]); | ||
} | ||
@@ -19,3 +19,3 @@ return this.add(select) | ||
from: function(tableNode) { | ||
var from = new From().add(tableNode.toNode()); | ||
var from = new From().add(tableNode); | ||
return this.add(from); | ||
@@ -22,0 +22,0 @@ }, |
{ | ||
"author": "Brian Carlson <brian.m.carlson@gmail.com>", | ||
"author": "brianc <brian.m.carlson@gmail.com>", | ||
"name": "sql", | ||
"description": "SQL generation", | ||
"version": "0.0.1", | ||
"description": "sql builder", | ||
"version": "0.0.2", | ||
"homepage": "https://github.com/brianc/node-sql", | ||
@@ -11,3 +11,3 @@ "repository": { | ||
}, | ||
"main": "lib/index.js", | ||
"main": "lib/", | ||
"scripts": { | ||
@@ -21,2 +21,2 @@ "test": "node test/" | ||
"devDependencies": {} | ||
} | ||
} |
@@ -85,1 +85,5 @@ var assert = require('assert'); | ||
assert.textEqual(q, 'SELECT p."content", u."name" FROM "user" AS u INNER JOIN post AS p ON ((u."id" = p."userId") AND (p."content" IS NOT NULL))'); | ||
console.log("inserting plain SQL"); | ||
var q = user.select('name').from('user').where('name <> NULL'); | ||
assert.textEqual(q, 'SELECT name FROM user WHERE name <> NULL'); |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
17848
541
23
40