Skip to Content
API ReferenceOutput ConnectorsSubscribe to View

Subscribe to View

POST/v0/pipelines/{pipeline_name}/egress/{table_name}
Authentication
Parameters

Subscribe to a stream of updates from a SQL view or table.

The pipeline responds with a continuous stream of changes to the specified table or view. The stream is configurable two ways:

  • Simple configuration of the format may be provided using query parameters. Use format to specify csv or json output and, for json only, array to specify whether to group updates into JSON arrays. Specify backpressure to specify behavior when the HTTP client cannot keep up.

  • Comprehensive configuration may be provided by providing a connector configuration as a JSON body. In this case, no query parameters are allowed.

Updates are split into Chunks.

The pipeline continues sending updates until the client closes the connection or the pipeline is stopped.

Authentication

SchemeTypeDetails
JSON web token (JWT) or API keyBearer tokenAuthorization header · Use a JWT token obtained via an OAuth2/OIDC login workflow or an API key obtained via the `/v0/api-keys` endpoint.

Parameters

Path parameters

NameTypeRequiredDescription
pipeline_namestringYesUnique pipeline name
table_namestringYesSQL table name. Unquoted SQL names have to be capitalized. Quoted SQL names have to exactly match the case from the SQL program.

Query parameters

NameTypeRequiredDescription
formatstringYesOutput data format, either 'csv' or 'json'.
arraybooleanNoSet to `true` to group updates in this stream into JSON arrays (used in conjunction with `format=json`). The default value is `false`
backpressurebooleanNoApply backpressure on the pipeline when the HTTP client cannot receive data fast enough. When this flag is set to false (the default), the HTTP connector drops data chunks if the client is not keeping up with its output. This prevents a slow HTTP client from slowing down the entire pipeline. When the flag is set to true, the connector waits for the client to receive each chunk and blocks the pipeline if the client cannot keep up.

Response

application/json
Connection to the endpoint successfully established. The body of the response contains a stream of data chunks.
  • object
    A set of updates to a SQL table or view. The `sequence_number` field stores the offset of the chunk relative to the start of the stream and can be used to implement reliable delivery. The payload is stored in the `bin_data`, `text_data`, or `json_data` field depending on the data format used.
    • bin_datastring (binary)
      Base64 encoded binary payload, e.g., bincode.
    • json_dataobject
      JSON payload.
    • sequence_numberinteger (int64)required
    • text_datastring
      Text payload, e.g., CSV.
Request
curl -X POST '/v0/pipelines/{pipeline_name}/egress/{table_name}?format=%3Cformat%3E&array=%3Carray%3E&backpressure=%3Cbackpressure%3E' \
  -H 'Authorization: Bearer YOUR_TOKEN'