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

    Interface QwpNodeIngressOptions

    Everything a Node QWP WebSocket sender takes: the connection, row buffering and flushing, and delivery -- acknowledgement, reconnect and replay, kept in memory or, with storeAndForward, in a crash-safe journal.

    There is no target or zone. Only the primary accepts writes, and the endpoint sweep reaches it through the 421 each replica answers the upgrade with; both route query sessions, on QwpNodeEgressOptions.

    interface QwpNodeIngressOptions {
        ackTimeoutMs?: number;
        agent?: Agent;
        authorization?: string;
        authTimeoutMs?: number;
        autoFlush?: boolean;
        autoFlushBytes?: number;
        autoFlushIntervalMs?: number;
        autoFlushRows?: number;
        clientId?: string;
        closeFlushTimeoutMs?: number;
        closeTimeoutMs?: number;
        connectionListenerInboxCapacity?: number;
        connectTimeoutMs?: number;
        durableAckKeepaliveMs?: number;
        errorInboxCapacity?: number;
        failoverUrls?: readonly (string | URL)[];
        gorilla?: boolean;
        headers?: Record<string, string>;
        initialConnectMode?: QwpInitialConnectMode;
        log?: QwpSenderLogger;
        maxBatchSizeBytes?: number;
        maxNameLength?: number;
        maxVersion?: number;
        memoryReplayAppendDeadlineMs?: number;
        memoryReplayMaxBytes?: number;
        onDurableAck?: (response: QwpIngressResponse) => void;
        onError?: (event: QwpIngressErrorEvent) => void;
        onProgress?: (event: QwpIngressProgressEvent) => void;
        onResponse?: (response: QwpIngressResponse) => void;
        onSenderError?: (error: QwpSenderError) => void;
        protocols?: string | string[];
        reconnect?: false | QwpIngressReconnectOptions;
        requestDurableAck?: boolean;
        senderId?: string;
        sendTimeoutMs?: number;
        storeAndForward?: QwpNodeStoreAndForwardOptions;
        symbolDictionary?: "full" | "delta";
        transactional?: boolean;
        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;
    }

    Hierarchy (View Summary)

    Index

    Properties

    ackTimeoutMs?: number

    Default timeout for waitForAck() and QwpSender.flushAndWait(): how long a wait may go without the ACK watermark advancing. Defaults to 15 seconds. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    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.

    autoFlush?: boolean
    autoFlushBytes?: number

    Soft threshold for estimated buffered column bytes. Zero disables the byte trigger. Defaults to zero and is clamped below a connected server's batch cap; exact encoded frames remain subject to the protocol batch limit.

    autoFlushIntervalMs?: number

    Not capped at the host timer ceiling: compared against elapsed time only.

    autoFlushRows?: number
    clientId?: string
    closeFlushTimeoutMs?: number

    Maximum time close() spends publishing queued rows and waiting for the server ACK watermark. Zero or a negative value skips the ACK wait, but RAM-backed frames still have up to 5 seconds to reach the socket before close() reports a timeout; if the session can no longer send them at all, close() rejects with its failure. Defaults to 5 seconds. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    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.

    connectionListenerInboxCapacity?: number

    Bounded reconnect-listener inbox. Oldest pending events are dropped when full. Defaults to 64, matching the Java client.

    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.

    durableAckKeepaliveMs?: number

    Durable-ACK keepalive interval. While committed table transactions await durable upload, Node transports send WebSocket PING frames and browser transports send table-less QWP poll frames. Takes effect only with requestDurableAck: true, where it defaults to 200ms; otherwise it is ignored, as in the Java and Rust clients. Zero disables the keepalive but still tracks durable progress. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.

    errorInboxCapacity?: number

    Bounded typed/legacy error inbox. Oldest pending errors are dropped when full. Defaults to 256, matching the Java client.

    failoverUrls?: readonly (string | URL)[]

    Additional endpoints attempted in order when the preferred endpoint fails.

    gorilla?: boolean

    Gorilla-compresses TIMESTAMP and TIMESTAMP_NANOS columns; a column whose deltas the encoding cannot represent is sent raw. Defaults to true. UDP senders always disable it.

    headers?: Record<string, string>
    initialConnectMode?: QwpInitialConnectMode

    Startup policy when no server is reachable; the typed spelling of the initial_connect_retry configuration-string key.

    • "off" makes one pass over the endpoints and fails fast.
    • "sync" retries on the caller for up to reconnect.reconnectMaxDurationMs, then fails with QwpReconnectExhaustedError.
    • "async" returns at once and connects in the background, retrying until close(). Rows published meanwhile wait in the replay queue -- memory, or the Node store-and-forward journal. An authentication or capability rejection that every endpoint would repeat ends the session if it comes before the first successful connection.

    Defaults to "off", or to "sync" when reconnectMaxDurationMs, reconnectInitialBackoffMs or reconnectMaxBackoffMs is set. "sync" and "async" require reconnection, so they cannot be combined with reconnect: false.

    maxBatchSizeBytes?: number

    Optional local ingress frame cap. Browsers cannot read WebSocket upgrade headers, so browser applications should set this to the server's configured QWP cap. When the server also advertises a cap, the smaller value wins. Table batches are split at row boundaries automatically; an individual row that cannot fit is rejected with QwpBatchTooLargeError before it is sent.

    maxNameLength?: number

    Maximum UTF-8 byte length of table and column names. Defaults to 127.

    maxVersion?: number
    memoryReplayAppendDeadlineMs?: number

    Maximum time a memory replay append waits for ACK-driven trimming after reaching memoryReplayMaxBytes. Defaults to 30 seconds.

    memoryReplayMaxBytes?: number

    Target cap for the built-in memory-only replay queue. Each queued frame counts its payload plus 1 KiB for the bookkeeping it keeps in memory, so the cap bounds the memory a backlog of small frames takes as well; the default holds about 127,000 one-row frames. Defaults to 128 MiB. A transaction-closing logical batch may temporarily exceed this target by up to one target-sized batch, because the server cannot ACK its deferred prefix before receiving that batch. A browser durable-ACK poll is admitted above it too, since only the durable progress it asks for can trim frames awaiting durability. This applies in browsers and non-persistent Node sessions; a Node store-and-forward journal is bounded by its own maxBytes instead.

    onDurableAck?: (response: QwpIngressResponse) => void
    onError?: (event: QwpIngressErrorEvent) => void

    Server rejections and terminal session failures. A waitForAck() that times out is reported only to its caller.

    onProgress?: (event: QwpIngressProgressEvent) => void

    Monotonic send/accept/durability notifications. Callback errors are ignored.

    onResponse?: (response: QwpIngressResponse) => void
    onSenderError?: (error: QwpSenderError) => void

    Java-parity typed server-rejection and data-loss notifications. When omitted, the default handler logs retriable errors at warn and terminal errors or abandoned data at error.

    protocols?: string | string[]
    reconnect?: false | QwpIngressReconnectOptions

    Reconnection and at-least-once replay policy. Reconnection is enabled by default for factory-created sessions; set false to keep one fixed connection. Browser and non-persistent Node replay is memory-only. When initialConnectMode is not set, the first connect is a single attempt unless reconnectMaxDurationMs, reconnectInitialBackoffMs or reconnectMaxBackoffMs is set, as in the Java client; it then retries for up to reconnectMaxDurationMs (5 minutes by default). An onEvent observer alone does not make it retry. Once connected, the session retries every outage until close() or a terminal error.

    An ACK lost during disconnect can cause a frame to be replayed after the server accepted it; configure server-side deduplication when duplicates are not acceptable.

    requestDurableAck?: boolean

    Requests durable ACKs on the /write/v4 upgrade; connecting fails with QwpDurableAckUnavailableError when the server does not confirm them. durableAckKeepaliveMs takes effect only alongside it.

    senderId?: string

    Names this sender's journal slot below storeAndForward.directory, the slot root: the journal is <directory>/<senderId>, and a pooled client's are <directory>/<senderId>-<slot>. Defaults to default, as the sender_id key does. Letters, digits, underscores and hyphens only; it is not sent to the server.

    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.

    Upgrades the default in-memory ingress replay to persistent Node store-and-forward, journalled in this sender's senderId slot below the configured directory. No two live senders may share a slot.

    symbolDictionary?: "full" | "delta"

    Connection-scoped symbol dictionary deltas are the default; full opts out, so every frame carries its own dictionaries. UDP senders always use full.

    transactional?: boolean

    Keep auto-flushed rows in an open server-side transaction. An explicit flush() closes the transaction. QWP transactions are atomic per table, rather than across every table in a multi-table flush.

    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.