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

@altangent/graphql-filter-mysql

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@altangent/graphql-filter-mysql - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

package.json
{
"name": "@altangent/graphql-filter-mysql",
"version": "1.1.0",
"version": "1.2.0",
"description": "Graphql filtering exection to generate mysql query syntax",

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

@@ -77,5 +77,11 @@ let mysqlClient = require('mysql');

}
if (op._neq) {
return processNeqOp(column, op._neq);
}
if (op._like) {
return processLikeOp(column, op._like);
}
if (op._in) {

@@ -85,2 +91,6 @@ return processInOp(column, op._in);

if (op._nin) {
return processNinOp(column, op._nin);
}
if (op._gt !== undefined) {

@@ -111,2 +121,6 @@ return processGtOp(column, op._gt);

function processNeqOp(column, value) {
return `${column} != ${mysqlClient.escape(value)}`;
}
function processLikeOp(column, value) {

@@ -120,2 +134,6 @@ return `${column} like ${mysqlClient.escape(value)}`;

function processNinOp(column, value) {
return `${column} not in (${value.map(mysqlClient.escape)})`;
}
function processGtOp(column, value) {

@@ -122,0 +140,0 @@ return `${column} > ${mysqlClient.escape(value)}`;

@@ -26,2 +26,7 @@ const { expect } = require('chai');

{
desc: 'should construct not equal filter',
input: { currencyName: { _neq: 'bitcoin' } },
expected: " and currency_name != 'bitcoin'", // eslint-disable-line quotes
},
{
desc: 'should construct like filter',

@@ -37,2 +42,7 @@ input: { currencyName: { _like: '*bitcoin*' } },

{
desc: 'should construct not in filter',
input: { currencySymbol: { _nin: ['BTC', 'LTC'] } },
expected: " and currency_symbol not in ('BTC','LTC')", // eslint-disable-line quotes
},
{
desc: 'should and multiple filters',

@@ -39,0 +49,0 @@ input: { currencyName: { _eq: 'bitcoin' }, currencySymbol: { _eq: 'BTC' } },

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