Socket
Socket
Sign inDemoInstall

knex-on-duplicate-update

Package Overview
Dependencies
26
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.1.3

8

lib/index.js

@@ -1,5 +0,5 @@

const KnexQueryBuilder = require('knex/lib/query/builder');
const Knex = require('knex');
module.exports.attachOnDuplicateUpdate = function attachOnDuplicateUpdate() {
KnexQueryBuilder.prototype.onDuplicateUpdate = function (...columns) {
Knex.QueryBuilder.extend('onDuplicateUpdate', function onDuplicateUpdate(...columns) {
if (this._method !== 'insert') {

@@ -34,3 +34,3 @@ throw new Error('onDuplicateUpdate error: should be used only with insert query.');

const newBindings = [ ...originalBindings, ...bindings ];
const newBindings = [...originalBindings, ...bindings];

@@ -41,3 +41,3 @@ return this.client.raw(

);
};
});
};
{
"name": "knex-on-duplicate-update",
"version": "1.1.2",
"version": "1.1.3",
"description": "Simple patcher for Knex. It adds the .onDuplicateUpdate() function to knex's query builder.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc