import { DuckDbConnector } from '@sqlrooms/duckdb-core'; /** * Options for the WebSocket DuckDB connector. * * @public */ export interface WebSocketDuckDbConnectorOptions { /** * WebSocket endpoint of the DuckDB server. */ wsUrl?: string; /** SQL to run after initialization */ initializationQuery?: string; /** Optional handler for server notifications `{ type: 'notify', payload }` */ onNotification?: (payload: any) => void; /** Optional list of channels to subscribe to upon (re)connect */ subscribeChannels?: string[]; /** Optional bearer token to authenticate with the server */ authToken?: string; } export interface WebSocketDuckDbConnector extends DuckDbConnector { readonly type: 'ws'; } /** * Create a DuckDB connector that talks to a WebSocket backend. * * Protocol expectations (as implemented by the servers): * - Persistent connection; messages are correlated via `queryId`. * - Client sends JSON: `{ type: 'arrow', sql: string, queryId?: string }`. * - Server responds with a binary frame for Arrow results using framing: * `[4-byte big-endian header length][header JSON { type, queryId }][Arrow IPC stream bytes]`. * - Errors are sent as JSON text frames: `{ type: 'error', queryId, error }`. * - Cancellation: client sends `{ type: 'cancel', queryId }` and keeps socket open. * - Notifications: server may push `{ type: 'notify', payload }` as JSON text. */ /** * Create a WebSocket-based DuckDB connector. * * @public */ export declare function createWebSocketDuckDbConnector(options?: WebSocketDuckDbConnectorOptions): WebSocketDuckDbConnector; //# sourceMappingURL=WebSocketDuckDbConnector.d.ts.map