Skip to main content
Version: 0.3.0

CypherQueryGenerator

age-schema-client v0.3.0


age-schema-client / CypherQueryGenerator

Class: CypherQueryGenerator<T>

Defined in: src/loader/cypher-query-generator.ts:37

CypherQueryGenerator class

Type Parameters

Type Parameter
T extends SchemaDefinition

Constructors

Constructor

new CypherQueryGenerator<T>(schema, options): CypherQueryGenerator<T>;

Defined in: src/loader/cypher-query-generator.ts:54

Create a new CypherQueryGenerator

Parameters

ParameterTypeDescription
schemaTSchema definition
optionsCypherQueryGeneratorOptionsOptions for generating queries

Returns

CypherQueryGenerator<T>

Methods

generateCreateVerticesQuery()

generateCreateVerticesQuery(vertexType, graphName): string;

Defined in: src/loader/cypher-query-generator.ts:69

Generate a Cypher query for creating vertices of a specific type

Parameters

ParameterTypeDescription
vertexTypestringThe type of vertex to create
graphNamestringName of the graph

Returns

string

Cypher query string


generateCreateEdgesQuery()

generateCreateEdgesQuery(edgeType, graphName): string;

Defined in: src/loader/cypher-query-generator.ts:108

Generate a Cypher query for creating edges of a specific type

Parameters

ParameterTypeDescription
edgeTypestringThe type of edge to create
graphNamestringName of the graph

Returns

string

Cypher query string


generateVertexExistenceQuery()

generateVertexExistenceQuery(graphName): string;

Defined in: src/loader/cypher-query-generator.ts:187

Generate a query that checks if vertices exist

Parameters

ParameterTypeDescription
graphNamestringName of the graph

Returns

string

Cypher query string


generateValidateEdgeEndpointsQuery()

generateValidateEdgeEndpointsQuery(edgeTable, graphName): string;

Defined in: src/loader/cypher-query-generator.ts:203

Generate a query that validates edge endpoints

Parameters

ParameterTypeDescription
edgeTablestringName of the edge table
graphNamestringName of the graph

Returns

string

SQL query string