UNPKG

@neo4j/cypher-builder

Version:

A programmatic API for building Cypher queries for Neo4j

41 lines (40 loc) 1.89 kB
import type { CypherEnvironment } from "../Environment"; import type { Literal } from "../references/Literal"; import type { Variable } from "../references/Variable"; import type { Expr } from "../types"; import { Clause } from "./Clause"; import { WithCall } from "./mixins/clauses/WithCall"; import { WithCallProcedure } from "./mixins/clauses/WithCallProcedure"; import { WithCreate } from "./mixins/clauses/WithCreate"; import { WithMatch } from "./mixins/clauses/WithMatch"; import { WithMerge } from "./mixins/clauses/WithMerge"; import { WithReturn } from "./mixins/clauses/WithReturn"; import { WithUnwind } from "./mixins/clauses/WithUnwind"; import { WithDelete } from "./mixins/sub-clauses/WithDelete"; import { WithOrder } from "./mixins/sub-clauses/WithOrder"; import { WithSetRemove } from "./mixins/sub-clauses/WithSetRemove"; import { WithWhere } from "./mixins/sub-clauses/WithWhere"; /** @inline */ export type WithProjection = Variable | [Expr, string | Variable | Literal]; export interface With extends WithOrder, WithReturn, WithWhere, WithSetRemove, WithDelete, WithMatch, WithUnwind, WithCreate, WithMerge, WithCallProcedure, WithCall { } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/clauses/with/ | Cypher Documentation} * @group Clauses */ export declare class With extends Clause { private readonly projection; private readonly withStatement; private isDistinct; constructor(...columns: Array<"*" | WithProjection>); addColumns(...columns: Array<"*" | WithProjection>): this; distinct(): this; /** Add a {@link With} clause * @see {@link https://neo4j.com/docs/cypher-manual/current/clauses/with/ | Cypher Documentation} */ with(clause: With): With; with(...columns: Array<"*" | WithProjection>): With; /** @internal */ getCypher(env: CypherEnvironment): string; private getWithClause; }