Comparing version 7.8.1 to 7.8.2
@@ -279,3 +279,3 @@ 'use strict' | ||
if (self.activeQuery.name) { | ||
con.parsedStatements[self.activeQuery.name] = true | ||
con.parsedStatements[self.activeQuery.name] = self.activeQuery.text | ||
} | ||
@@ -282,0 +282,0 @@ }) |
@@ -142,2 +142,6 @@ 'use strict' | ||
if (client.namedQueries[this.name]) { | ||
if (this.text && client.namedQueries[this.name] !== this.text) { | ||
const err = new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`) | ||
return after(err) | ||
} | ||
return client.native.execute(this.name, values, after) | ||
@@ -148,3 +152,3 @@ } | ||
if (err) return after(err) | ||
client.namedQueries[self.name] = true | ||
client.namedQueries[self.name] = self.text | ||
return self.native.execute(self.name, values, after) | ||
@@ -151,0 +155,0 @@ }) |
@@ -151,2 +151,6 @@ 'use strict' | ||
} | ||
const previous = connection.parsedStatements[this.name] | ||
if (this.text && previous && this.text !== previous) { | ||
return new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`) | ||
} | ||
if (this.values && !Array.isArray(this.values)) { | ||
@@ -153,0 +157,0 @@ return new Error('Query values must be an array') |
{ | ||
"name": "pg", | ||
"version": "7.8.1", | ||
"version": "7.8.2", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -70,3 +70,3 @@ # node-postgres | ||
Copyright (c) 2010-2018 Brian Carlson (brian.m.carlson@gmail.com) | ||
Copyright (c) 2010-2019 Brian Carlson (brian.m.carlson@gmail.com) | ||
@@ -73,0 +73,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
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
89203
2060