BatchOperations
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
| Parameter | Type | Description |
|---|---|---|
schema | T | Schema definition |
queryExecutor | QueryExecutor | Query executor |
sqlGenerator | SQLGenerator | SQL generator |
vertexOperations | VertexOperations<T> | Vertex operations |
edgeOperations | EdgeOperations<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
| Parameter | Type | Description |
|---|---|---|
label | L | Vertex label |
dataArray | VertexData<T, L>[] | Array of vertex data |
options | BatchOperationOptions | Batch 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
| Parameter | Type | Description |
|---|---|---|
label | L | Edge label |
edges | object[] | Array of edge data with source and target vertices |
options | BatchOperationOptions | Batch operation options |
Returns
Promise<Edge<T, L>[]>
Array of created edges