import { createClient } from "@clickhouse/client"; import { NodeClickHouseClientConfigOptions } from "@clickhouse/client/dist/config"; export type ClickhouseClientType = ReturnType; export type PreferredClickhouseService = "ReadWrite" | "ReadOnly"; /** * ClickHouseClientManager provides a singleton pattern for managing ClickHouse clients. * It creates and reuses clients based on their configuration to avoid creating * a new connection for each query. */ export declare class ClickHouseClientManager { private static instance; private clientMap; /** * Private constructor to enforce singleton pattern */ private constructor(); /** * Get the singleton instance of the ClickHouseClientManager */ static getInstance(): ClickHouseClientManager; /** * Generate a consistent hash key for client configurations * @param opts Client parameters * @returns String hash key */ private generateClientSettings; private generateClientSettingsKey; private getClickhouseUrl; /** * Get or create a client based on the provided parameters * @param opts Client configuration parameters * @returns ClickHouse client instance */ getClient(opts: NodeClickHouseClientConfigOptions, preferredClickhouseService?: PreferredClickhouseService): ClickhouseClientType; /** * Close all client connections - useful for application shutdown */ closeAllConnections(): Promise; } export declare const clickhouseClient: (opts?: NodeClickHouseClientConfigOptions, preferredClickhouseService?: PreferredClickhouseService) => import("@clickhouse/client").ClickHouseClient; /** * Accepts a JavaScript date and returns the DateTime in format YYYY-MM-DD HH:MM:SS */ export declare const convertDateToClickhouseDateTime: (date: Date) => string; //# sourceMappingURL=client.d.ts.map