/** * Memgraph Graph Database Adapter * * Implements the BaseGraphAdapter for Memgraph. * Memgraph is a high-performance, in-memory graph database * that is fully compatible with Neo4j's Bolt protocol and Cypher query language. * * Key features: * - Cypher query language compatibility * - Bolt protocol support * - In-memory performance * - Triggers and streams support * - MAGE graph algorithms library */ import { BaseGraphAdapter, IAdapterConnectionOptions } from './base.adapter'; import { GraphType, GraphFeature } from '../types/enums'; import { IGraphConnectionResult, IGraphTestConnectionResult } from '../types/connection.interface'; import { ICreateNodeOptions, ICreateNodeResult, IFindNodesOptions, IFindNodesResult, IUpdateNodeOptions, IUpdateNodeResult, IDeleteNodeOptions, IDeleteNodeResult, IMergeNodeOptions, IMergeNodeResult, INode, IAddLabelsOptions, IAddLabelsResult, IRemoveLabelsOptions, IRemoveLabelsResult, ISetLabelsOptions, ISetLabelsResult } from '../types/node.interface'; import { ICreateRelationshipOptions, ICreateRelationshipResult, IFindRelationshipsOptions, IFindRelationshipsResult, IUpdateRelationshipOptions, IUpdateRelationshipResult, IDeleteRelationshipOptions, IDeleteRelationshipResult, IMergeRelationshipOptions, IMergeRelationshipResult, IRelationship, ICreateRelationshipIndexOptions } from '../types/relationship.interface'; import { ITraverseOptions, ITraverseResult, IShortestPathOptions, IShortestPathResult, IAllPathsOptions, IAllPathsResult, INeighborhoodOptions, INeighborhoodResult, IConnectedComponentsOptions, IConnectedComponentsResult } from '../types/traversal.interface'; import { IGraphTransaction, IGraphTransactionOptions } from '../types/transaction.interface'; import { IRawQueryOptions, IRawQueryResult, ICountNodesResult, ICountRelationshipsResult, IGraphStatistics, IFullTextSearchOptions, IFullTextSearchResult, IVectorSearchOptions, IVectorSearchResult, IGraphWhereClause } from '../types/query.interface'; import { ICreateNodeIndexOptions, ICreateNodeConstraintOptions, IListIndexesResult, IListConstraintsResult, ICreateIndexResult, ICreateConstraintResult, IDropIndexResult, IDropConstraintResult, IListLabelsResult, IListRelationshipTypesResult } from '../types/schema.interface'; /** * Memgraph adapter - Cypher-compatible graph database * Uses the neo4j-driver package as Memgraph supports the Bolt protocol */ export declare class MemgraphAdapter extends BaseGraphAdapter { protected readonly graphType = GraphType.MEMGRAPH; protected readonly supportedFeatures: Set; private driver; private session; connect(options: IAdapterConnectionOptions): Promise; testConnection(options: IAdapterConnectionOptions): Promise; disconnect(): Promise; private getSession; createNode(options: ICreateNodeOptions, transaction?: IGraphTransaction): Promise>; findNodes(options: IFindNodesOptions, transaction?: IGraphTransaction): Promise>; findNodeById(id: string | number, transaction?: IGraphTransaction): Promise | null>; updateNode(options: IUpdateNodeOptions, transaction?: IGraphTransaction): Promise>; deleteNode(options: IDeleteNodeOptions, transaction?: IGraphTransaction): Promise; mergeNode(options: IMergeNodeOptions, transaction?: IGraphTransaction): Promise>; addLabels(options: IAddLabelsOptions, transaction?: IGraphTransaction): Promise>; removeLabels(options: IRemoveLabelsOptions, transaction?: IGraphTransaction): Promise>; setLabels(options: ISetLabelsOptions, transaction?: IGraphTransaction): Promise>; createRelationship(options: ICreateRelationshipOptions, transaction?: IGraphTransaction): Promise>; findRelationships(options: IFindRelationshipsOptions, transaction?: IGraphTransaction): Promise>; findRelationshipById(id: string | number, transaction?: IGraphTransaction): Promise | null>; updateRelationship(options: IUpdateRelationshipOptions, transaction?: IGraphTransaction): Promise>; deleteRelationship(options: IDeleteRelationshipOptions, transaction?: IGraphTransaction): Promise; mergeRelationship(options: IMergeRelationshipOptions, transaction?: IGraphTransaction): Promise>; traverse(options: ITraverseOptions, transaction?: IGraphTransaction): Promise>; shortestPath(options: IShortestPathOptions, transaction?: IGraphTransaction): Promise>; allPaths(options: IAllPathsOptions, transaction?: IGraphTransaction): Promise>; getNeighborhood(options: INeighborhoodOptions, transaction?: IGraphTransaction): Promise>; findConnectedComponents(options: IConnectedComponentsOptions, transaction?: IGraphTransaction): Promise>; countNodes(labels?: string[], where?: IGraphWhereClause, transaction?: IGraphTransaction): Promise; countRelationships(types?: string[], where?: IGraphWhereClause, transaction?: IGraphTransaction): Promise; getStatistics(transaction?: IGraphTransaction): Promise; fullTextSearch(options: IFullTextSearchOptions, transaction?: IGraphTransaction): Promise>; vectorSearch(_options: IVectorSearchOptions, _transaction?: IGraphTransaction): Promise>; query(options: IRawQueryOptions, transaction?: IGraphTransaction): Promise>; createNodeIndex(options: ICreateNodeIndexOptions): Promise; createNodeConstraint(options: ICreateNodeConstraintOptions): Promise; createRelationshipIndex(options: ICreateRelationshipIndexOptions): Promise; listIndexes(): Promise; listConstraints(): Promise; dropIndex(name: string): Promise; dropConstraint(name: string): Promise; listLabels(): Promise; listRelationshipTypes(): Promise; beginTransaction(_options?: IGraphTransactionOptions): Promise; commitTransaction(transaction: IGraphTransaction): Promise; rollbackTransaction(transaction: IGraphTransaction): Promise; /** * Create a trigger in Memgraph */ createTrigger(name: string, event: 'CREATE' | 'UPDATE' | 'DELETE', target: 'NODE' | 'RELATIONSHIP', procedure: string): Promise; /** * Drop a trigger in Memgraph */ dropTrigger(name: string): Promise; /** * List all triggers in Memgraph */ listTriggers(): Promise>; /** * Create a stream consumer in Memgraph */ createStream(name: string, type: 'KAFKA' | 'PULSAR', topics: string[], transformationProcedure: string, config: Record): Promise; /** * Run a MAGE algorithm (if installed) */ runMageAlgorithm(algorithm: string, params?: Record): Promise; protected buildWhereClause(where: IGraphWhereClause, alias?: string): { clause: string; params: Record; }; parseError(error: unknown): Error; private mapMemgraphNode; private mapMemgraphRelationship; private mapMemgraphPath; private convertProperties; private convertValue; private toNumber; private getDirectionArrow; }