knex-on-duplicate-update
Advanced tools
Comparing version 1.1.0 to 1.1.1
const KnexQueryBuilder = require('knex/lib/query/builder'); | ||
const escapeKnexBinding = input => input.replace(/\?/g, '\\?'); | ||
module.exports.attachOnDuplicateUpdate = function attachOnDuplicateUpdate() { | ||
@@ -30,3 +32,3 @@ KnexQueryBuilder.prototype.onDuplicateUpdate = function (...columns) { | ||
return this.client.raw( | ||
`${this.toString()} on duplicate key update ${placeholders.join(', ')}`, | ||
`${escapeKnexBinding(this.toString())} on duplicate key update ${placeholders.join(', ')}`, | ||
bindings | ||
@@ -33,0 +35,0 @@ ); |
{ | ||
"name": "knex-on-duplicate-update", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Simple patcher for Knex. It adds the .onDuplicateUpdate() function to knex's query builder.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
5077
37