pg-promise
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -178,3 +178,3 @@ // Cannot declare 'use strict' here, because queryResult | ||
if (qrm) { | ||
return dbInst.query(query); | ||
return dbInst.query(query, qrm); | ||
} else { | ||
@@ -299,3 +299,3 @@ return dbInst.one(query); | ||
if (qrm) { | ||
return tx.query(query); | ||
return tx.query(query, qrm); | ||
} else { | ||
@@ -302,0 +302,0 @@ return tx.one(query); |
{ | ||
"name": "pg-promise", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "PG + Promise made easy, with transactions support.", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
"transaction", | ||
"postgresql" | ||
"postgres" | ||
], | ||
@@ -24,0 +24,0 @@ "author": { |
@@ -17,7 +17,7 @@ # Introduction | ||
```javascript | ||
var pgpLib = require('pg-promise'); // loading the library; | ||
var pgpLib = require('pg-promise'); // loading the library | ||
``` | ||
### 2. Initialize the library | ||
```javascript | ||
var pgp = pgpLib(/*options*/); // initializing the library, with optional global settings; | ||
var pgp = pgpLib(/*options*/); // initializing the library, with optional global settings | ||
``` | ||
@@ -48,3 +48,3 @@ You can pass additional ```options``` parameter when initilizing the library (see chapter Advanced for details). | ||
```javascript | ||
var db = new pgp(cn); // create a new database instance based on the connection details | ||
var db = new pgp(cn); // create a new database instance from the connection details | ||
``` | ||
@@ -72,3 +72,3 @@ There can be multiple database objects instantiated in the application from different connection details. | ||
```javascript | ||
db.query("select * from users", queryResult.none | queryResult.many); | ||
db.query("select * from users", queryResult.many | queryResult.none); | ||
``` | ||
@@ -92,3 +92,3 @@ which is equivalent to calling: | ||
```javascript | ||
db.many("select * from users") | ||
db.manyOrNone("select * from users") | ||
.then(function(data){ | ||
@@ -135,3 +135,3 @@ console.log(data); // printing the data returned | ||
// returning a promise that determines a successful transaction: | ||
return promise.all([q1, q2]); // all of the queries are to be resolved; | ||
return promise.all([q1, q2]); // all of the queries are to be resolved | ||
@@ -138,0 +138,0 @@ }).then(function(data){ |
Sorry, the diff of this file is not supported yet
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
39594