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

foxhound

Package Overview
Dependencies
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

foxhound - npm Package Compare versions

Comparing version 1.0.41 to 1.0.42

2

package.json
{
"name": "foxhound",
"version": "1.0.41",
"version": "1.0.42",
"description": "A Database Query generation library.",

@@ -5,0 +5,0 @@ "main": "source/FoxHound.js",

@@ -116,8 +116,17 @@ /**

{
return "`" + cleanseQuoting(pFieldNames[0]) + "`.`" + cleanseQuoting(pFieldNames[1]) + "`";
const cleansedFieldName = cleanseQuoting(pFieldNames[1]);
if (cleansedFieldName === '*')
{
// do not put * as `*`
return "`" + cleanseQuoting(pFieldNames[0]) + "`.*";
}
return "`" + cleanseQuoting(pFieldNames[0]) + "`.`" + cleansedFieldName + "`";
}
else
const cleansedFieldName = cleanseQuoting(pFieldNames[0]);
if (cleansedFieldName === '*')
{
return "`" + cleanseQuoting(pFieldNames[0]) + "`";
// do not put * as `*`
return '*';
}
return "`" + cleanseQuoting(pFieldNames[0]) + "`";
}

@@ -124,0 +133,0 @@

@@ -165,2 +165,24 @@ /**

(
'Complex Read Query with qualified and unqualified "SELECT *" cases',
function()
{
var tmpQuery = libFoxHound.new(libFable)
.setDialect('MySQL')
.setScope('Animal')
.setCap(10)
.setBegin(0)
.setDataElements(['*', 'Name', 'Age', 'Cost', 'Animal.*'])
.setSort([{Column:'Age',Direction:'Ascending'}])
.setFilter({Column:'Age',Operator:'=',Value:'15',Connector:'AND',Parameter:'Age'});
tmpQuery.addSort('Cost');
// Build the query
tmpQuery.buildReadQuery();
// This is the query generated by the MySQL dialect
libFable.log.trace('Select Query', tmpQuery.query);
Expect(tmpQuery.query.body)
.to.equal('SELECT *, `Name`, `Age`, `Cost`, `Animal`.* FROM `Animal` WHERE Age = :Age_w0 ORDER BY Age, Cost LIMIT 0, 10;');
}
);
test
(
'Complex Read Query 2',

@@ -167,0 +189,0 @@ function()

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