QuestDB JavaScript Client - v5.0.0
    Preparing search index...

    Interface QwpNodeEgressOptions

    Everything a Node QWP query session takes: the connection, endpoint routing, result compression, and the session's flow control, deadlines and failover.

    interface QwpNodeEgressOptions {
        agent?: Agent;
        authorization?: string;
        authTimeoutMs?: number;
        bufferPoolSize?: number;
        cancelDrainTimeoutMs?: number;
        clientId?: string;
        closeTimeoutMs?: number;
        compression?: QwpEgressCompression;
        compressionLevel?: number;
        connectionListenerInboxCapacity?: number;
        connectTimeoutMs?: number;
        failoverUrls?: readonly (string | URL)[];
        headers?: Record<string, string>;
        initialCredit?: number | bigint;
        maxBatchRows?: number;
        maxVersion?: number;
        onFailoverReset?: (
            event: QwpEgressFailoverResetEvent,
        ) => void | Promise<void>;
        protocols?: string | string[];
        queryTimeoutMs?: number;
        reconnect?: false | QwpEgressReconnectOptions;
        sendTimeoutMs?: number;
        serverInfoTimeoutMs?: number;
        target?: QwpTarget;
        url: string | URL;
        webSocketFactory?: (
            url: string | URL,
            options: {
                agent?: Agent;
                headers: Record<string, string>;
                onConnected: () => void;
                onUpgrade: (headers: IncomingHttpHeaders) => void;
                onUpgradeRejected: (rejection: QwpNodeUpgradeRejection) => void;
                protocols?: string | string[];
            },
        ) => QwpWebSocketLike;
        zone?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    agent?: Agent

    Optional HTTP(S) agent used for the WebSocket upgrade.

    authorization?: string
    authTimeoutMs?: number

    Time allowed after TCP/TLS connection for HTTP authentication and the WebSocket upgrade.

    Defaults to connectTimeoutMs when that is set, and to 15s otherwise, so narrowing only the connect deadline bounds the whole opening rather than being exceeded by a default nobody chose. Set this to give the slower phase its own budget. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    bufferPoolSize?: number

    Maximum decoded batches waiting for a consumer. Defaults to 4.

    cancelDrainTimeoutMs?: number

    Maximum wait for a terminal response after CANCEL, and the grace period of a query timeout: how long an expired query may take to end before its caller is released, and how long its connection may then take to drain it. Defaults to 5 seconds. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    clientId?: string
    closeTimeoutMs?: number

    Maximum time allowed for a graceful WebSocket close. Defaults to 15s. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    compression?: QwpEgressCompression

    Requests Zstd-compressed result batches. The default is raw, which preserves compatibility with servers that predate QWP compression. auto currently advertises the same ordered preference as zstd.

    compressionLevel?: number

    Zstd level hint sent to the server. Must be between 1 and 22, and only takes effect alongside compression; the default raw sends no accept-encoding header for a level to travel on.

    connectionListenerInboxCapacity?: number

    Bounded inbox depth for reconnect.onEvent. Defaults to 64, matching ingress. Overflow drops the oldest pending notification.

    connectTimeoutMs?: number

    Node TCP/TLS connection deadline, or the complete opening deadline in a browser. Defaults to 15s. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    failoverUrls?: readonly (string | URL)[]

    Additional endpoints attempted in order when the preferred endpoint fails.

    headers?: Record<string, string>
    initialCredit?: number | bigint

    Default per-query send-ahead credit. Defaults to zero (unbounded).

    maxBatchRows?: number

    Requests a server-side RESULT_BATCH row cap, and rejects a batch that declares more rows: decoder scratch is sized from the declared row count and retained for the session's lifetime.

    maxVersion?: number
    onFailoverReset?: (event: QwpEgressFailoverResetEvent) => void | Promise<void>

    Default notification immediately before an active query is re-executed. Not-yet-consumed batches are discarded automatically; callers that retain an already-consumed prefix should discard it here. A query's own onFailoverReset overrides this callback, which is important for pooled sessions whose request IDs may overlap.

    protocols?: string | string[]
    queryTimeoutMs?: number

    Default per-query timeout, measured from the query() call. Zero or undefined disables query timeouts. Once it expires no further batch is delivered and the query is cancelled; see QwpEgressQueryOptions.timeoutMs for how the outcome is reported. The connect-string key is query_timeout_ms. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    reconnect?: false | QwpEgressReconnectOptions

    Bounded failover policy. Failover and at-least-once active-query replay are enabled by default; set false to keep one fixed connection.

    sendTimeoutMs?: number

    Maximum time a send may remain queued by the WebSocket. Defaults to 15s. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    serverInfoTimeoutMs?: number

    SERVER_INFO handshake deadline. Defaults to 5 seconds. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    target?: QwpTarget

    Selects any readable node, a primary/standalone node, or a replica.

    url: string | URL
    webSocketFactory?: (
        url: string | URL,
        options: {
            agent?: Agent;
            headers: Record<string, string>;
            onConnected: () => void;
            onUpgrade: (headers: IncomingHttpHeaders) => void;
            onUpgradeRejected: (rejection: QwpNodeUpgradeRejection) => void;
            protocols?: string | string[];
        },
    ) => QwpWebSocketLike

    Test hook; defaults to the Node-only ws implementation.

    zone?: string

    Opaque, case-insensitive preferred zone; cross-zone fallback stays enabled.