Socket
Socket
Sign inDemoInstall

@krishnapawar/kp-mysql-models

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.2 to 1.2.3

22

lib/index.js

@@ -681,3 +681,4 @@ var pool;

};
const withdata = (errThrow, result, resData, datas) => {
const withdata = (errThrow, result, resData, datas,dbcon=null) => {
let db = dbcon ?? pool;
if(isCheck(datas)) return result(resData);

@@ -694,3 +695,3 @@ if (datas.with !== undefined && isCheck(datas.with) && datas.with.length <= 0)

let data = datas.with[key];
pool.query(
db.query(
`SELECT ${selectOption(data)} FROM ${data.table} ${whereClause(

@@ -705,3 +706,3 @@ data,

if (data!= undefined && (!isCheck(data.pagination) || data.pagination >= 0)) {
pool.query(
db.query(
`SELECT count(*) as totalData FROM ${data.table} ${whereClause(

@@ -734,3 +735,4 @@ data,

};
const withdataForGet = (errThrow, resData, datas) => {
const withdataForGet = (errThrow, resData, datas,dbcon=null) => {
let db = dbcon ?? pool;
return new Promise((resolve, reject) => {

@@ -746,5 +748,5 @@ if(isCheck(datas)) return resolve(resData);

for (const key in datas.with) {
console.log(key);
// console.log(key);
let data = datas.with[key];
pool.query(
db.query(
`SELECT ${selectOption(data)} FROM ${data.table} ${whereClause(

@@ -759,3 +761,3 @@ data,

if (data!= undefined && (!isCheck(data.pagination) || data.pagination >= 0)) {
pool.query(
db.query(
`SELECT count(*) as totalData FROM ${data.table} ${whereClause(

@@ -867,3 +869,3 @@ data,

for (const iterator of res) {
const item = await withdataForGet(reject, iterator, data);
const item = await withdataForGet(reject, iterator, data,this._connection);
resw.push(item);

@@ -876,3 +878,3 @@ }

for (const iterator of res) {
const item = await withdataForGet(reject, iterator, data);
const item = await withdataForGet(reject, iterator, data,this._connection);
resw.push(item);

@@ -902,3 +904,3 @@ }

if (res.length > 0) {
return withdata(reject, resolve, res[0], data);
return withdata(reject, resolve, res[0], data,this._connection);
}

@@ -905,0 +907,0 @@ return resolve({});

{
"name": "@krishnapawar/kp-mysql-models",
"version": "1.2.2",
"version": "1.2.3",
"description": "The `kp-mysql-models` library simplifies MySQL database interaction, streamlining tasks such as creating, inserting, updating, and deleting records, as well as handling complex queries like joins, pagination, and conditional operations. By offering an intuitive and efficient approach, it significantly reduces development time and effort.",

@@ -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