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
478
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.4.0-definitions-480da0c6225ce0eb484522f6d3a65e31b47bd88b to 7.4.0

4

out/AbstractSQLCompiler.d.ts

@@ -153,6 +153,6 @@ export declare const enum Engines {

}
export declare type Definition = FromTypeNodes | {
export interface Definition {
binds?: BindVars;
abstractSql: FromTypeNodes;
};
}
export interface AbstractSqlTable {

@@ -159,0 +159,0 @@ name: string;

@@ -243,12 +243,6 @@ "use strict";

if (definition != null) {
let definitionAbstractSql;
if (Array.isArray(definition)) {
definitionAbstractSql = definition;
if (definition.binds != null && definition.binds.length > 0) {
return;
}
else {
if (definition.binds != null && definition.binds.length > 0) {
return;
}
definitionAbstractSql = definition.abstractSql;
}
let definitionAbstractSql = definition.abstractSql;
if (containsNode(definitionAbstractSql, exports.isResourceNode)) {

@@ -255,0 +249,0 @@ return;

{
"name": "@balena/abstract-sql-compiler",
"version": "7.4.0-definitions-480da0c6225ce0eb484522f6d3a65e31b47bd88b",
"version": "7.4.0",
"description": "A translator for abstract sql into sql.",

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

@@ -256,8 +256,6 @@ export const enum Engines {

}
export type Definition =
| FromTypeNodes
| {
binds?: BindVars;
abstractSql: FromTypeNodes;
};
export interface Definition {
binds?: BindVars;
abstractSql: FromTypeNodes;
}
export interface AbstractSqlTable {

@@ -677,12 +675,7 @@ name: string;

if (definition != null) {
let definitionAbstractSql;
if (Array.isArray(definition)) {
definitionAbstractSql = definition;
} else {
if (definition.binds != null && definition.binds.length > 0) {
// If there are any binds then it's a dynamic definition and cannot become a view
return;
}
definitionAbstractSql = definition.abstractSql;
if (definition.binds != null && definition.binds.length > 0) {
// If there are any binds then it's a dynamic definition and cannot become a view
return;
}
let definitionAbstractSql = definition.abstractSql;
// If there are any resource nodes then it's a dynamic definition and cannot become a view

@@ -689,0 +682,0 @@ if (

@@ -23,37 +23,2 @@ import * as AbstractSQLCompiler from '../..';

primitive: false,
definition: ['Table', 'other table'],
},
},
rules: [],
}),
)
.to.have.property('createSchema')
.that.deep.equals([
`\
CREATE OR REPLACE VIEW "test" AS (
SELECT *
FROM "other table"
);`,
]);
});
it('a table with a static object based definition should produce a view', () => {
expect(
AbstractSQLCompiler.postgres.compileSchema({
synonyms: {},
relationships: {},
tables: {
test: {
name: 'test',
resourceName: 'test',
idField: 'id',
fields: [
{
fieldName: 'id',
dataType: 'Integer',
index: 'PRIMARY KEY',
},
],
indexes: [],
primitive: false,
definition: { abstractSql: ['Table', 'other table'] },

@@ -60,0 +25,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