@zilliz/milvus2-sdk-node
Version:
Official Node.js SDK for [Milvus](https://github.com/milvus-io/milvus) vector database. Provides gRPC and HTTP clients for vector similarity search, metadata filtering, and full collection/index/user management.
57 lines (56 loc) • 2.31 kB
TypeScript
import { Root } from 'protobufjs';
import { Client, ChannelOptions, ChannelCredentials } from '@grpc/grpc-js';
import { Pool } from 'generic-pool';
import { ClientConfig, ServerInfo, CONNECT_STATUS, TLS_MODE, GlobalTopology, TopologyRefresher } from '../';
/**
* Base gRPC client, setup all configuration here
*/
export declare class BaseClient {
channelPool: Pool<Client>;
clientId: string;
connectStatus: CONNECT_STATUS;
connectPromise: Promise<void>;
readonly tlsMode: TLS_MODE;
readonly config: ClientConfig;
readonly channelOptions: ChannelOptions;
serverInfo: ServerInfo;
timeout: number;
readonly isGlobal: boolean;
globalEndpoint: string;
globalTopology: GlobalTopology | null;
topologyRefresher: TopologyRefresher | null;
protected isReconnecting: boolean;
protected reconnectingPromise: Promise<boolean> | null;
protected creds: ChannelCredentials;
protected metadata: Map<string, string>;
protected schemaProto: Root;
protected milvusProto: Root;
protected readonly protoInternalPath: {
serviceName: string;
collectionSchema: string;
fieldSchema: string;
functionSchema: string;
structArrayFieldSchema: string;
};
/**
* Sets up the configuration object for the gRPC client.
*
* @param configOrAddress The configuration object or the Milvus address as a string.
* @param ssl Whether to use SSL or not. Default is false.
* @param username The username for authentication. Required if password is provided.
* @param password The password for authentication. Required if username is provided.
*/
constructor(configOrAddress: ClientConfig | string, ssl?: boolean, username?: string, password?: string, channelOptions?: ChannelOptions);
/**
* Checks the compatibility of the SDK with the Milvus server.
*
* @param {Object} data - Optional data object.
* @param {string} data.message - The error message to throw if the SDK is incompatible.
* @param {Function} data.checker - A function to call if the SDK is compatible.
* @throws {Error} If the SDK is incompatible with the server.
*/
checkCompatibility(data?: {
message?: string;
checker?: Function;
}): Promise<any>;
}