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

@qrvey/data-persistence

Package Overview
Dependencies
Maintainers
11
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qrvey/data-persistence - npm Package Compare versions

Comparing version 0.0.6-6 to 0.0.6-7

16

dist/cjs/services/cruds/postgresql/postgreSqlClient.service.js

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

}
isKeyword(attribute) {
var _a;
return (_a = this.crudSchema.columns[attribute]) === null || _a === void 0 ? void 0 : _a.keyword;
}
buildClause(operator, attribute, value) {

@@ -51,5 +47,3 @@ const formattedValue = pg_format_1.default.literal(value);

throw new Error(`Unsupported filter operator: ${operator}`);
const filterProperty = this.isKeyword(attribute)
? `'${attribute}'`
: pg_format_1.default.ident(attribute);
const filterProperty = pg_format_1.default.ident(attribute);
if (operator === constants_1.FilterOperator.IN) {

@@ -70,2 +64,10 @@ const formattedValues = Array.isArray(value)

}
if (operator === constants_1.FilterOperator.NOT_EXIST ||
operator === constants_1.FilterOperator.EXIST) {
const columnExists = !!this.crudSchema.columns[attribute];
const property = columnExists
? filterProperty
: `("qvAttributes" ->> '${attribute}')`;
return `${property} ${postgresOperator}`;
}
const wildcardValue = this.getWildcardValue(operator, value);

@@ -72,0 +74,0 @@ return `${filterProperty} ${postgresOperator} ${pg_format_1.default.literal(wildcardValue)}`;

@@ -54,2 +54,4 @@ "use strict";

FilterOperator["BETWEEN"] = "BETWEEN";
FilterOperator["EXIST"] = "EXIST";
FilterOperator["NOT_EXIST"] = "NOT_EXIST";
})(FilterOperator || (exports.FilterOperator = FilterOperator = {}));

@@ -72,2 +74,4 @@ exports.POSTGRES_FILTER_OPERATOR_MAP = {

BETWEEN: 'BETWEEN',
EXIST: 'IS NOT NULL',
NOT_EXIST: 'IS NULL',
};

@@ -74,0 +78,0 @@ exports.DEFAULT_PG_SCHEMA = 'public';

@@ -93,3 +93,2 @@ interface IFilter {

default?: any;
keyword?: boolean;
};

@@ -118,3 +117,3 @@ }

findCount(options: IFindOptions): Promise<number>;
buildFilter(attribute: string, value: string, operator?: string): {
buildFilter(attribute: string, value: any, operator?: string): {
attribute: string;

@@ -121,0 +120,0 @@ operator: string;

@@ -5,3 +5,3 @@ {

"main": "dist/cjs/index.js",
"version": "0.0.6-6",
"version": "0.0.6-7",
"license": "MIT",

@@ -8,0 +8,0 @@ "exports": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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