Skip to main content
Version: 0.3.0

BatchOperations

age-schema-client v0.3.0


age-schema-client / BatchOperations

Class: BatchOperations<T>

Defined in: src/db/batch.ts:103

Batch operations class

Provides optimized methods for batch operations on vertices and edges

Type Parameters

Type Parameter
T extends SchemaDefinition

Constructors

Constructor

new BatchOperations<T>(
schema,
queryExecutor,
sqlGenerator,
vertexOperations,
edgeOperations): BatchOperations<T>;

Defined in: src/db/batch.ts:113

Create a new batch operations instance

Parameters

ParameterTypeDescription
schemaTSchema definition
queryExecutorQueryExecutorQuery executor
sqlGeneratorSQLGeneratorSQL generator
vertexOperationsVertexOperations<T>Vertex operations
edgeOperationsEdgeOperations<T>Edge operations

Returns

BatchOperations<T>

Methods

createVerticesBatch()

createVerticesBatch<L>(
label,
dataArray,
options): Promise<Vertex<T, L>[]>;

Defined in: src/db/batch.ts:129

Create multiple vertices in a batch operation

Type Parameters

Type Parameter
L extends string | number | symbol

Parameters

ParameterTypeDescription
labelLVertex label
dataArrayVertexData<T, L>[]Array of vertex data
optionsBatchOperationOptionsBatch operation options

Returns

Promise<Vertex<T, L>[]>

Array of created vertices


createEdgesBatch()

createEdgesBatch<L>(
label,
edges,
options): Promise<Edge<T, L>[]>;

Defined in: src/db/batch.ts:200

Create multiple edges in a batch operation

Type Parameters

Type Parameter
L extends string | number | symbol

Parameters

ParameterTypeDescription
labelLEdge label
edgesobject[]Array of edge data with source and target vertices
optionsBatchOperationOptionsBatch operation options

Returns

Promise<Edge<T, L>[]>

Array of created edges