Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mysql-rest

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-rest - npm Package Compare versions

Comparing version 0.6.7 to 0.6.8

19

lib/xsql.js

@@ -1340,2 +1340,6 @@ "use strict";

let ids = [].concat(results).map((o) => o[items[0]]);
ids = lodash.compact(lodash.uniq(ids));
if (ids.length === 0) {
return;
}
let sql = `

@@ -1349,3 +1353,3 @@ SELECT ${items[2]} FROM ${items[1]}

results.map((o) => {
o[items[3]] = refs.includes(o[items[0]]);
o[items[3]] = (refs || []).includes(o[items[0]]);
return o;

@@ -1361,10 +1365,19 @@ });

let ids = [].concat(results).map((o) => o[items[0]]);
ids = lodash.compact(lodash.uniq(ids));
if (ids.length === 0) {
return;
}
let sql = `
SELECT * FROM ${items[1]}
WHERE ${items[2]} IN (${lodash.uniq(ids).join(",")});
WHERE ${items[2]} IN (${ids.join(",")});
`;
let includeResults = await this.exec(sql, []);
if (includeResults.length === 0) {
return;
}
results.map((o) => {
let foud = includeResults.filter((i) => i[items[2]] === o[items[0]]);
o[items[0]] = foud.length > 0 ? foud[0] : null;
if (foud.length > 0) {
o[items[0]] = foud[0];
}
return o;

@@ -1371,0 +1384,0 @@ });

2

package.json
{
"name": "mysql-rest",
"version": "0.6.7",
"version": "0.6.8",
"description": "One command to generate REST APIs for any MySql database, support multi databases",

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc