Socket
Socket
Sign inDemoInstall

@evershop/mysql-query-builder

Package Overview
Dependencies
12
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.4 to 1.3.5

60

index.js
const uniqid = require('uniqid');
const util = require('util');
const { toString } = require('./toString');
const { fieldResolve } = require('./fieldResolve');

@@ -71,3 +73,3 @@ class Select {

const key = uniqid();
this._binding[key] = value;
this._binding[key] = toString(value);
this._value = `:${key}`;

@@ -77,3 +79,3 @@ }

this._link = link;
this._field = field;
this._field = fieldResolve(field);
this._operator = operator.toUpperCase();

@@ -156,3 +158,3 @@ this._parent = node;

element._link === link &&
element._field === field &&
element._field === fieldResolve(field) &&
element._binding[field] === value

@@ -370,3 +372,3 @@ )

add(field) {
this._fields.push(field);
this._fields.push(fieldResolve(field));

@@ -566,2 +568,5 @@ return this;

async execute(connection, releaseConnection = true) {
if (connection.constructor.name === 'Pool') {
connection = await getConnection(connection);
}
let sql = await this.sql(connection);

@@ -617,3 +622,10 @@ let binding = [];

given(data) {
this._data = data;
if (typeof data !== "object" || data === null) {
throw new Error("Data must be an object and not null");
}
let copy = {};
Object.keys(data).forEach(key => {
copy[key] = toString(data[key]);
})
this._data = copy;

@@ -624,3 +636,3 @@ return this;

prime(field, value) {
this._data[field] = value;
this._data[field] = toString(value);

@@ -650,6 +662,4 @@ return this;

return;
if (field['Null'] === 'NO' && field['Default'] !== null && !this._data[field["Field"]])
return
let key = uniqid();
set.push(`${field["Field"]} = :${key}`);
set.push(`\`${field["Field"]}\` = :${key}`);
this._binding[key] = this._data[field["Field"]];

@@ -675,3 +685,10 @@ });

given(data) {
this._data = data;
if (typeof data !== "object" || data === null) {
throw new Error("Data must be an object and not null");
}
let copy = {};
Object.keys(data).forEach(key => {
copy[key] = toString(data[key]);
})
this._data = copy;

@@ -682,3 +699,3 @@ return this;

prime(field, value) {
this._data[field] = value;
this._data[field] = toString(value);

@@ -710,6 +727,4 @@ return this;

return;
if (field['Null'] === 'NO' && field['Default'] !== null && !this._data[field["Field"]])
return
let key = uniqid();
fs.push(`${field["Field"]}`);
fs.push(`\`${field["Field"]}\``);
vs.push(`:${key}`);

@@ -734,3 +749,10 @@ this._binding[key] = this._data[field["Field"]];

given(data) {
this._data = data;
if (typeof data !== "object" || data === null) {
throw new Error("Data must be an object and not null");
}
let copy = {};
Object.keys(data).forEach(key => {
copy[key] = toString(data[key]);
})
this._data = copy;

@@ -741,3 +763,3 @@ return this;

prime(field, value) {
this._data[field] = value;
this._data[field] = toString(value);;

@@ -769,9 +791,7 @@ return this;

return;
if (field['Null'] === 'NO' && field['Default'] !== null && !this._data[field["Field"]])
return
let key = uniqid();
let ukey = uniqid();
fs.push(`${field["Field"]}`);
fs.push(`\`${field["Field"]}\``);
vs.push(`:${key}`);
us.push(`${field["Field"]} = :${ukey}`);
us.push(`\`${field["Field"]}\` = :${ukey}`);
usp[ukey] = this._data[field["Field"]];

@@ -778,0 +798,0 @@ this._binding[key] = this._data[field["Field"]];

{
"name": "@evershop/mysql-query-builder",
"version": "1.3.4",
"version": "1.3.5",
"description": "A MySQL query builder for NodeJS",

@@ -5,0 +5,0 @@ "main": "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