/** * chdb adapter - Embedded ClickHouse for local development * * This adapter uses chdb to run ClickHouse embedded in your Node.js process * with file-based persistence. No Docker or external server required. * * @example * ```typescript * import { chdbAdapter } from '@dotdo/db-clickhouse/local' * * export default buildConfig({ * db: chdbAdapter({ * path: './.data/clickhouse', // Directory for data storage * namespace: 'development' * }), * // ... * }) * ``` */ import type { DatabaseAdapterObj } from 'payload'; import type { VectorIndexConfig } from './types.js'; import { ChdbClient } from './local/chdbClient.js'; export interface ChdbAdapterArgs { /** Default transaction timeout in ms (default: 30000, null for no timeout) */ defaultTransactionTimeout?: null | number; /** Embedding dimensions for vector search (default: 1536) */ embeddingDimensions?: number; /** ID type for documents (default: 'text' - nanoid) */ idType?: 'text' | 'uuid'; /** Namespace to separate different Payload apps (default: 'payload') */ namespace?: string; /** Path to the directory for chdb data storage (default: './.data/clickhouse') */ path?: string; /** Table name (default: 'data') */ table?: string; /** Vector index configuration for similarity search (default: disabled) */ vectorIndex?: VectorIndexConfig; } /** * Create an embedded ClickHouse database adapter using chdb * * This adapter runs ClickHouse embedded in your Node.js process with * file-based persistence. Ideal for local development and testing. * For production, use the standard clickhouseAdapter with a remote server. */ export declare function chdbAdapter(args?: ChdbAdapterArgs): DatabaseAdapterObj; export { type ClickHouseClient, connect, createClickHouseClient, type DaemonClientOptions, type DaemonInstallOptions, type DaemonServerOptions, ensureBinary, getInstallPaths, isServerRunning, type ServerStatusResult, startServer, stopServer, waitForReady, type WaitForReadyOptions, } from './daemon/index.js'; export { ChdbClient } from './local/chdbClient.js'; /** * Create a ChDB client with a session at the specified path */ export declare function createChdbClient(path: string): InstanceType; export { chdbAdapter as localClickhouseAdapter }; export type { ChdbSession, VectorIndexConfig } from './types.js'; //# sourceMappingURL=local.d.ts.map