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.2-fix-schema-optimizations-bb989d17aa9308aa6bfba56065cff391d0023608 to 7.8.2

2

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

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

@@ -173,1 +173,74 @@ import * as AbstractSQLCompiler from '../..';

});
it('should work with differing table/resource names', () => {
expect(
generateSchema({
synonyms: {},
relationships: {},
tables: {
some_other_resource_name: {
name: 'test',
resourceName: 'some_other_resource_name',
idField: 'id',
fields: [
{
fieldName: 'id',
dataType: 'Integer',
index: 'PRIMARY KEY',
},
],
indexes: [],
primitive: false,
},
},
rules: [
[
'Rule',
[
'Body',
[
'Not',
[
'Exists',
[
'SelectQuery',
['Select', []],
['From', ['test', 'test.0']],
[
'Where',
[
'Not',
[
'And',
[
'LessThan',
['Integer', 0],
['ReferencedField', 'test.0', 'id'],
],
['Exists', ['ReferencedField', 'test.0', 'id']],
],
],
],
],
],
],
] as AbstractSQLCompiler.AbstractSqlQuery,
[
'StructuredEnglish',
'It is necessary that each test has an id that is greater than 0.',
],
],
],
}),
)
.to.have.property('createSchema')
.that.deep.equals([
`\
CREATE TABLE IF NOT EXISTS "test" (
"id" INTEGER NULL PRIMARY KEY
, -- It is necessary that each test has an id that is greater than 0.
CONSTRAINT "test$hkEwz3pzAqalNu6crijhhdWJ0ffUvqRGK8rMkQbViPg=" CHECK (0 < "id"
AND "id" IS NOT NULL)
);`,
]);
});

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