@ultipa-graph/ultipa-driver
Version:
NodeJS SDK for ultipa-server 5.2
109 lines (108 loc) • 4.03 kB
TypeScript
import { DBType, RequestConfig, Schema, ResponseWithExistCheck } from "../../types/types";
import { PropertyExtra } from "./property.extra";
export declare class SchemaExra extends PropertyExtra {
private showSchemaBase;
/**
* Retrieves all nodes and edge schemas from the current graphset.
* @param config
*/
showSchema(config?: RequestConfig): Promise<Schema[]>;
/**
* Get one schema info
* @param isNode
* @param name
* @param config
* @returns
*/
private getSchemaBase;
/**
* Retrieves a node or edge schema from the current graphset.
* @param name
* @param dbType
* @param config
*/
getSchema(schemaName: string, dbType: DBType, config?: RequestConfig): Promise<Schema>;
/**
*Retrieves a node schema from the current graphset.
* @param schemaName
* @param config
* @returns Response<Schema>
*/
getNodeSchema(schemaName: string, config?: RequestConfig): Promise<Schema>;
/**
* Retrieves all node schemas from the current graphset.
* @param config
* @returns Response<Schema[]>
*/
showNodeSchema(config?: RequestConfig): Promise<Schema[]>;
/**
* Retrieves an edge schema from the current graphset.
* @param config
* @returns
*/
getEdgeSchema(schemaName: string, config?: RequestConfig): Promise<Schema>;
/**
* Retrieves all node schemas from the current graphset.
* @param config
* @returns Response<Schema[]>
*/
showEdgeSchema(config?: RequestConfig): Promise<Schema[]>;
private createSchemaBase;
/**
* Creates a new schema in the current graphset.
* @param schema
* @param isCreateProperties
* @param config
* @returns
*/
createSchema(schema: Schema, isCreateProperties?: boolean, config?: RequestConfig): Promise<import("../../types/types").Response>;
private hasSchema;
/**
* Creates a new schema in the current graphset, handling cases where the given schema name already exists by ignoring the error.
* @param schema
* @param config
*/
createSchemaIfNotExist(schema: Schema, isCreateProperties?: boolean, config?: RequestConfig): Promise<ResponseWithExistCheck>;
/**
* Drops one schema from the current graphset by its name.
*/
dropSchema(schema: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
/**
* Creates a new node schema in the current graphset.
* @param req
* @param config
* @returns
*/
createNodeSchema(req: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
/**
* Creates a new edge schema in the current graphset.
* @param req
* @param config
* @returns
*/
createEdgeSchema(req: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
/**
* Alters the name and description of one existing schema in the current graphset by its name.
* @param schema
* @param newSchema
* @param config
* @returns
*/
alterSchema(originalSchema: Schema, newSchema: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
/**
* Alters the name and description of one existing node schema in the current graphset by its name.
* @param schema
* @param newSchema
* @param config
* @returns
*/
alterNodeSchema(originalSchema: Schema, newSchema: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
/**
* Alters the name and description of one existing edge schema in the current graphset by its name.
* @param schema
* @param newSchema
* @param config
* @returns
*/
alterEdgeSchema(originalSchema: Schema, newSchema: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
}