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

@neo4j/cypher-builder

Package Overview
Dependencies
Maintainers
7
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j/cypher-builder - npm Package Compare versions

Comparing version 1.14.0 to 1.15.0

9

dist/clauses/Call.d.ts

@@ -15,2 +15,6 @@ import type { CypherEnvironment } from "../Environment";

}
type InTransactionConfig = {
ofRows?: number;
onError?: "continue" | "break" | "fail";
};
/**

@@ -23,2 +27,3 @@ * @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/call-subquery/)

private _importWith;
private inTransactionsConfig?;
private _usingImportWith;

@@ -30,2 +35,3 @@ constructor(subquery: Clause);

importWith(...params: Array<Variable | "*">): this;
inTransactions(config?: InTransactionConfig): this;
/** @deprecated Use {@link importWith} instead */

@@ -36,2 +42,5 @@ innerWith(...params: Array<Variable | "*">): this;

private getSubqueryCypher;
private generateInTransactionStr;
private getOnErrorStr;
}
export {};

28

dist/clauses/Call.js

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

}
inTransactions(config = {}) {
this.inTransactionsConfig = config;
return this;
}
/** @deprecated Use {@link importWith} instead */

@@ -89,5 +93,6 @@ innerWith(...params) {

const setCypher = (0, compile_cypher_if_exists_1.compileCypherIfExists)(this.setSubClause, env, { prefix: "\n" });
const inTransactionCypher = this.generateInTransactionStr();
const inCallBlock = `${importWithCypher}${subQueryStr}`;
const nextClause = this.compileNextClause(env);
return `CALL {\n${(0, pad_block_1.padBlock)(inCallBlock)}\n}${setCypher}${removeCypher}${deleteCypher}${nextClause}`;
return `CALL {\n${(0, pad_block_1.padBlock)(inCallBlock)}\n}${inTransactionCypher}${setCypher}${removeCypher}${deleteCypher}${nextClause}`;
}

@@ -102,2 +107,23 @@ getSubqueryCypher(env, importWithCypher) {

}
generateInTransactionStr() {
if (!this.inTransactionsConfig) {
return "";
}
const rows = this.inTransactionsConfig.ofRows;
const error = this.inTransactionsConfig.onError;
const ofRowsStr = rows ? ` OF ${rows} ROWS` : "";
const onErrorStr = error ? ` ON ERROR ${this.getOnErrorStr(error)}` : "";
return ` IN TRANSACTIONS${ofRowsStr}${onErrorStr}`;
}
getOnErrorStr(err) {
const errorMap = {
continue: "CONTINUE",
break: "BREAK",
fail: "FAIL",
};
if (!errorMap[err]) {
throw new Error(`Incorrect ON ERROR option ${err}`);
}
return errorMap[err];
}
};

@@ -104,0 +130,0 @@ exports.Call = Call;

2

package.json
{
"name": "@neo4j/cypher-builder",
"version": "1.14.0",
"version": "1.15.0",
"description": "A programmatic API for building Cypher queries for Neo4j",

@@ -5,0 +5,0 @@ "exports": "./dist/index.js",

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