UNPKG

@neo4j/cypher-builder

Version:

A programmatic API for building Cypher queries for Neo4j

30 lines (29 loc) 867 B
"use strict"; /* * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] */ Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteClause = void 0; const CypherASTNode_1 = require("../../CypherASTNode"); class DeleteClause extends CypherASTNode_1.CypherASTNode { deleteInput; detachKeyword; constructor(parent, deleteInput) { super(parent); this.deleteInput = deleteInput; } detach() { this.detachKeyword = "DETACH"; } noDetach() { this.detachKeyword = "NODETACH"; } /** @internal */ getCypher(env) { const itemsToDelete = this.deleteInput.map((e) => e.getCypher(env)); const detachStr = this.detachKeyword ? `${this.detachKeyword} ` : ""; return `${detachStr}DELETE ${itemsToDelete.join(",")}`; } } exports.DeleteClause = DeleteClause;