New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@balena/abstract-sql-compiler

Package Overview
Dependencies
Maintainers
4
Versions
475
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@balena/abstract-sql-compiler - npm Package Compare versions

Comparing version 7.8.1 to 7.8.2-fix-schema-optimizations-bb989d17aa9308aa6bfba56065cff391d0023608

4

CHANGELOG.md

@@ -7,2 +7,6 @@ # Change Log

## 7.8.2 - 2021-01-15
* Fix schema optimizations when table and resource names are different [Pagan Gazzard]
## 7.8.1 - 2021-01-04

@@ -9,0 +13,0 @@

19

out/AbstractSQLSchemaOptimiser.js

@@ -12,2 +12,3 @@ "use strict";

const sbvrTypes = require("@balena/sbvr-types");
const _ = require("lodash");
const AbstractSQLCompiler_1 = require("./AbstractSQLCompiler");

@@ -32,3 +33,2 @@ const countFroms = (n) => {

var _a;
var _b;
const ruleBodyNode = rule.find((r) => r[0] === 'Body');

@@ -86,9 +86,12 @@ if (ruleBodyNode == null || typeof ruleBodyNode === 'string') {

const sha = sbvrTypes.SHA.validateSync(`${tableName}$${JSON.stringify(ruleBody)}`).replace(/^\$sha256\$/, '');
(_a = (_b = abstractSqlModel.tables[tableName]).checks) !== null && _a !== void 0 ? _a : (_b.checks = []);
abstractSqlModel.tables[tableName].checks.push({
description: ruleSE,
name: `${tableName.slice(0, 30)}$${sha}`.slice(0, 63),
abstractSql: whereNode,
});
return;
const table = _.find(abstractSqlModel.tables, (t) => t.name === tableName);
if (table) {
(_a = table.checks) !== null && _a !== void 0 ? _a : (table.checks = []);
table.checks.push({
description: ruleSE,
name: `${tableName.slice(0, 30)}$${sha}`.slice(0, 63),
abstractSql: whereNode,
});
return;
}
}

@@ -95,0 +98,0 @@ }

{
"name": "@balena/abstract-sql-compiler",
"version": "7.8.1",
"version": "7.8.2-fix-schema-optimizations-bb989d17aa9308aa6bfba56065cff391d0023608",
"description": "A translator for abstract sql into sql.",

@@ -5,0 +5,0 @@ "main": "out/AbstractSQLCompiler.js",

@@ -112,10 +112,16 @@ export const enum Engines {

abstractSqlModel.tables[tableName].checks ??= [];
abstractSqlModel.tables[tableName].checks!.push({
description: ruleSE,
// Trim the trigger to a max of 63 characters, reserving at least 32 characters for the hash
name: `${tableName.slice(0, 30)}$${sha}`.slice(0, 63),
abstractSql: whereNode,
});
return;
const table = _.find(
abstractSqlModel.tables,
(t) => t.name === tableName,
);
if (table) {
table.checks ??= [];
table.checks!.push({
description: ruleSE,
// Trim the trigger to a max of 63 characters, reserving at least 32 characters for the hash
name: `${tableName.slice(0, 30)}$${sha}`.slice(0, 63),
abstractSql: whereNode,
});
return;
}
}

@@ -122,0 +128,0 @@ }

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