pg-promise
Advanced tools
Comparing version 0.4.4 to 0.4.5
16
index.js
@@ -186,12 +186,2 @@ // Cannot declare 'use strict' here, because queryResult | ||
// Checks if the object is empty (has no properties); | ||
function $isEmptyObject(obj) { | ||
return Object.keys(obj).length === 0; | ||
} | ||
// Fixes single-quote symbols in text fields; | ||
function $fixQuotes(val) { | ||
return val.replace("'", "''"); | ||
} | ||
// Wraps up text in single quotes; | ||
@@ -249,3 +239,3 @@ function $wrapText(text) { | ||
if (s === null) { | ||
throw new Error("Cannot convert the value of type '" + typeof(values) + "'"); | ||
throw new Error("Cannot convert a value of type '" + typeof(values) + "'"); | ||
} | ||
@@ -263,3 +253,5 @@ } | ||
} | ||
return $wrapText($fixQuotes(txt)); | ||
// replacing single-quote symbols with two of them, and then | ||
// wrapping in quotes, for compatibility with PostgreSQL. | ||
return $wrapText(txt.replace("'", "''")); | ||
}, | ||
@@ -266,0 +258,0 @@ bool: function (val) { |
{ | ||
"name": "pg-promise", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"description": "PG + Promise made easy, with transactions support.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Introduction | ||
<img align="right" width="190" height="190" src="https://lh6.googleusercontent.com/UggPXQ3ArL4rXdSFG6xVbUY8QLNnBPBr8C2r0ITTBM_KHu1G0JXfNmvX_q_98QRYsF6smpWZc2w=w1896-h912"> | ||
<img align="right" width="190" height="190" src="https://upload.wikimedia.org/wikipedia/commons/a/a8/Pg-promise.jpg"> | ||
@@ -118,2 +118,3 @@ This library joins [Promise] and [PG] to help writing easy-to-read database code that relies on promises: | ||
Example of a detached transaction: | ||
@@ -120,0 +121,0 @@ ```javascript |
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
47954
325
483