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

    One QWP query/statement and its stream of materialized result batches.

    Implements

    Index

    Constructors

    Properties

    completion: Promise<QwpQueryCompletion>
    requestId: bigint

    Accessors

    Methods

    • Waits for completion without changing the query lifecycle. A finite wait returns false on expiry; the query remains active until it completes, is cancelled explicitly, or its configured query deadline expires.

      Parameters

      • timeoutMs: number

      Returns Promise<boolean>

    • Cancels the query. No further batch is delivered: batches already queued are dropped, and the server is sent CANCEL together with the flow-control credit those batches held. The outcome follows the server's terminal response: a cancellation rejects iteration and completion with a QwpEgressQueryError whose status is QWP_STATUS.CANCELLED, a statement that completed anyway succeeds, and so does a result that ended with nothing withheld.

      If the server does not end the query within cancelDrainTimeoutMs, iteration and completion reject with QwpEgressQueryCancelTimeoutError. A reconnecting session replaces the connection; a session opened with reconnect: false fails instead.

      The returned promise settles once CANCEL has been sent, or once a reconnect has taken it over: it then follows the replayed request, and a later failure reaches the query and the session. A query sends at most one CANCEL.

      Returns Promise<void>

    • Internal

      Called when the application cancels, which outranks a timeout expiring later. Results are withheld exactly as they are at the timeout, and the credit returned is what the dropped batches held.

      Returns number

    • Internal

      Records a batch dropped unread because the consumer has retired or results are withheld, and returns the credit to restore for it.

      Parameters

      • creditBytes: number

      Returns number

    • Internal

      Called when the timeout expires. No further batch reaches the consumer: queued ones are dropped. Returns the flow-control credit they held, which the server needs back to stream on toward its terminal.

      Returns number