UNPKG

@ultipa-graph/ultipa-driver

Version:

NodeJS SDK for ultipa-server 5.2

55 lines (54 loc) 2.57 kB
import { ConnectionBase } from "./connection.base"; import { GraphSet, JobResponse, RequestConfig, Response, ResponseWithExistCheck } from "../../types/types"; import { TruncateParams } from "../../types/types.extra"; export declare class GraphExra extends ConnectionBase { /** * retrieve all graphs, graphs should contain total of nodes and edges. * @example client.showGraph(config) */ showGraph(config?: RequestConfig): Promise<GraphSet[]>; /** * Retrieves all GraphSets from the database. * TODO delete param partitionByHash */ createGraph(graphSet: GraphSet, config?: RequestConfig): Promise<Response>; /** * Creates a new GraphSet in the database, handling cases where the given GraphSet name already exists by ignoring the error. * @param graph * @param partitionByHash * @param config * @returns */ createGraphIfNotExist(graphSet: GraphSet, config?: RequestConfig): Promise<ResponseWithExistCheck>; /** * Retrieves one GraphSet from the database by its name. */ getGraph(graphName: string, config?: RequestConfig): Promise<GraphSet>; /** * Checks the existence of a GraphSet in the database by its name. */ hasGraph(graphName: string, config?: RequestConfig): Promise<boolean>; /** * Drops one GraphSet from the database by its name. * @param graphName * @param config * @returns Response */ dropGraph(graphName: string, config?: RequestConfig): Promise<Response>; /** * Alters the name and description of one existing GraphSet in the database by its name. */ alterGraph(graphName: string, alterGraphset: GraphSet, config?: RequestConfig): Promise<Response>; /** * Compacts a GraphSet by clearing its invalid and redundant data on the server disk. Valid data will not be affected. */ compact(graphName: string, config?: RequestConfig): Promise<JobResponse>; /** * Truncates (Deletes) the specified nodes or edges in the given GraphSet or truncates the entire GraphSet. * Note that truncating nodes will cause the deletion of edges attached to those affected nodes. * The truncating operation retains the definition of schemas and properties while deleting the data. * @param params TruncateParams object containing graphName, schemaName and dbType * @param config Optional request configuration */ truncate(params: TruncateParams, config?: RequestConfig): Promise<Response>; }