@neo4j/cypher-builder
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -24,3 +24,3 @@ "use strict"; | ||
const Environment_1 = require("../Environment"); | ||
const convert_to_cypher_params_1 = require("../utils/convert-to-cypher-params"); | ||
const to_cypher_params_1 = require("../utils/to-cypher-params"); | ||
const pad_block_1 = require("../utils/pad-block"); | ||
@@ -37,3 +37,3 @@ const customInspectSymbol = Symbol.for("nodejs.util.inspect.custom"); | ||
const cypher = this.getCypher(env); | ||
const cypherParams = (0, convert_to_cypher_params_1.convertToCypherParams)(extraParams); | ||
const cypherParams = (0, to_cypher_params_1.toCypherParams)(extraParams); | ||
env.addExtraParams(cypherParams); | ||
@@ -40,0 +40,0 @@ return { |
@@ -6,4 +6,7 @@ import type { ProjectionColumn } from "../sub-clauses/Projection"; | ||
protected returnStatement: Return | undefined; | ||
return(clause: Return): Return; | ||
return(...columns: Array<"*" | ProjectionColumn>): Return; | ||
private addColumnsToReturnClause; | ||
private addReturnStatement; | ||
} | ||
//# sourceMappingURL=WithReturn.d.ts.map |
@@ -25,14 +25,23 @@ "use strict"; | ||
class WithReturn extends ClauseMixin_1.ClauseMixin { | ||
return(...columns) { | ||
if (this.returnStatement) { | ||
this.returnStatement.addColumns(...columns); | ||
return(clauseOrColumn, ...columns) { | ||
if (clauseOrColumn instanceof Return_1.Return) { | ||
return this.addReturnStatement(clauseOrColumn); | ||
} | ||
else { | ||
this.returnStatement = new Return_1.Return(...columns); | ||
this.addChildren(this.returnStatement); | ||
return this.addColumnsToReturnClause(clauseOrColumn, ...columns); | ||
} | ||
addColumnsToReturnClause(...columns) { | ||
let returnStatement = this.returnStatement; | ||
if (!returnStatement) { | ||
returnStatement = this.addReturnStatement(new Return_1.Return()); | ||
} | ||
return this.returnStatement; | ||
returnStatement.addColumns(...columns); | ||
return returnStatement; | ||
} | ||
addReturnStatement(clause) { | ||
this.returnStatement = clause; | ||
this.addChildren(this.returnStatement); | ||
return clause; | ||
} | ||
} | ||
exports.WithReturn = WithReturn; | ||
//# sourceMappingURL=WithReturn.js.map |
@@ -6,4 +6,7 @@ import { ClauseMixin } from "./ClauseMixin"; | ||
protected unwindStatement: Unwind | undefined; | ||
unwind(clause: Unwind): Unwind; | ||
unwind(...columns: Array<ProjectionColumn>): Unwind; | ||
private addColumnsToUnwindClause; | ||
private addUnwindStatement; | ||
} | ||
//# sourceMappingURL=WithUnwind.d.ts.map |
@@ -25,14 +25,23 @@ "use strict"; | ||
class WithUnwind extends ClauseMixin_1.ClauseMixin { | ||
unwind(...columns) { | ||
if (this.unwindStatement) { | ||
this.unwindStatement.addColumns(...columns); | ||
unwind(clauseOrColumn, ...columns) { | ||
if (clauseOrColumn instanceof Unwind_1.Unwind) { | ||
return this.addUnwindStatement(clauseOrColumn); | ||
} | ||
else { | ||
this.unwindStatement = new Unwind_1.Unwind(...columns); | ||
this.addChildren(this.unwindStatement); | ||
return this.addColumnsToUnwindClause(clauseOrColumn, ...columns); | ||
} | ||
addColumnsToUnwindClause(...columns) { | ||
let unwindStatement = this.unwindStatement; | ||
if (!unwindStatement) { | ||
unwindStatement = this.addUnwindStatement(new Unwind_1.Unwind()); | ||
} | ||
return this.unwindStatement; | ||
unwindStatement.addColumns(...columns); | ||
return unwindStatement; | ||
} | ||
addUnwindStatement(clause) { | ||
this.unwindStatement = clause; | ||
this.addChildren(this.unwindStatement); | ||
return clause; | ||
} | ||
} | ||
exports.WithUnwind = WithUnwind; | ||
//# sourceMappingURL=WithUnwind.js.map |
@@ -6,4 +6,7 @@ import { ClauseMixin } from "./ClauseMixin"; | ||
protected withStatement: With | undefined; | ||
with(...columns: ("*" | WithProjection)[]): With; | ||
with(clause: With): With; | ||
with(...columns: Array<"*" | WithProjection>): With; | ||
private addColumnsToWithClause; | ||
private addWithStatement; | ||
} | ||
//# sourceMappingURL=WithWith.d.ts.map |
@@ -26,14 +26,23 @@ "use strict"; | ||
class WithWith extends ClauseMixin_1.ClauseMixin { | ||
with(...columns) { | ||
if (this.withStatement) { | ||
this.withStatement.addColumns(...columns); | ||
with(clauseOrColumn, ...columns) { | ||
if (clauseOrColumn instanceof With_1.With) { | ||
return this.addWithStatement(clauseOrColumn); | ||
} | ||
else { | ||
this.withStatement = new With_1.With(...columns); | ||
this.addChildren(this.withStatement); | ||
return this.addColumnsToWithClause(clauseOrColumn, ...columns); | ||
} | ||
addColumnsToWithClause(...columns) { | ||
let withStatement = this.withStatement; | ||
if (!withStatement) { | ||
withStatement = this.addWithStatement(new With_1.With()); | ||
} | ||
return this.withStatement; | ||
withStatement.addColumns(...columns); | ||
return withStatement; | ||
} | ||
addWithStatement(clause) { | ||
this.withStatement = clause; | ||
this.addChildren(this.withStatement); | ||
return clause; | ||
} | ||
} | ||
exports.WithWith = WithWith; | ||
//# sourceMappingURL=WithWith.js.map |
@@ -22,3 +22,3 @@ "use strict"; | ||
exports.RawCypher = void 0; | ||
const convert_to_cypher_params_1 = require("../utils/convert-to-cypher-params"); | ||
const to_cypher_params_1 = require("../utils/to-cypher-params"); | ||
const Clause_1 = require("./Clause"); | ||
@@ -48,3 +48,3 @@ /** For compatibility reasons, allows for a raw string to be used as a clause | ||
} | ||
const cypherParams = (0, convert_to_cypher_params_1.convertToCypherParams)(params); | ||
const cypherParams = (0, to_cypher_params_1.toCypherParams)(params); | ||
env.addExtraParams(cypherParams); | ||
@@ -51,0 +51,0 @@ return query; |
export { escapeLabel } from "./escape"; | ||
export { toCypherParams } from "./to-cypher-params"; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -21,6 +21,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.escapeLabel = void 0; | ||
exports.toCypherParams = exports.escapeLabel = void 0; | ||
// Note: This file exists for exported utils to the user | ||
var escape_1 = require("./escape"); | ||
Object.defineProperty(exports, "escapeLabel", { enumerable: true, get: function () { return escape_1.escapeLabel; } }); | ||
var to_cypher_params_1 = require("./to-cypher-params"); | ||
Object.defineProperty(exports, "toCypherParams", { enumerable: true, get: function () { return to_cypher_params_1.toCypherParams; } }); | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@neo4j/cypher-builder", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Neo4j Cypher query builder", | ||
@@ -41,3 +41,3 @@ "exports": "./dist/index.js", | ||
"@types/node": "18.15.1", | ||
"expect-type": "0.15.0", | ||
"expect-type": "0.16.0", | ||
"jest": "29.5.0", | ||
@@ -44,0 +44,0 @@ "jest-extended": "3.2.4", |
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
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
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
Sorry, the diff of this file is not supported yet
433489
6983
3
5
28
3715