Comparing version 0.1.0 to 0.1.1
var sq = ""; | ||
var pg; | ||
module.exports = { | ||
"then": function(promise) { | ||
return promise(sq); | ||
if (!pg) { | ||
var s = sq; | ||
sq = ""; | ||
return promise(sq); | ||
} else { | ||
pg.query(sq, function(err,result) { | ||
sq = ""; | ||
return promise(err,result); | ||
}) | ||
} | ||
}, | ||
"new": function() { | ||
"new": function(postgres) { | ||
sq = ""; | ||
pg = postgres; | ||
return module.exports; | ||
@@ -9,0 +21,0 @@ }, |
{ | ||
"name": "chaingres", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Postgres: Unchained. Use cascading style programming to structure your Postgres queries.", | ||
@@ -5,0 +5,0 @@ "main": "chaingres.js", |
@@ -16,5 +16,9 @@ # chaingres | ||
var chaingres = require("./chaingres"); | ||
var postgres = require("pg"); | ||
var queryConn = "postgres://"+name+":"+password+"@"+host+":"+port+"/"+db+""; | ||
client = new pg.Client(queryConn); | ||
chaingres | ||
.new() | ||
.new(client) | ||
.select(["c1", "c2"]) | ||
@@ -38,5 +42,6 @@ .from("table") | ||
.offset(0) | ||
.then(function(query) { | ||
console.log(query); | ||
.then(function(err,result) { | ||
//This will return a bunch of rows | ||
console.log(result); | ||
}) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5949
99
46