Skip to main content

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, encoded using the format specified in the ?format= parameter. Updates are split into Chunks.

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

This API is a POST instead of a GET, because when performing neighborhood queries (query='neighborhood'), the call expects a request body which contains, among other things, a full row to execute a neighborhood search around. A row can be quite large and is not appropriate as a query parameter.

Path Parameters
pipeline_name string REQUIRED

Unique pipeline name

table_name string REQUIRED

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

Query Parameters
format string REQUIRED

Output data format, e.g., 'csv' or 'json'.

query string

Possible values: [table, neighborhood, quantiles]

A query over an output stream.

We currently do not support ad hoc queries. Instead the client can use three pre-defined queries to inspect the contents of a table or view.

Query to execute on the table. Must be one of 'table', 'neighborhood', or 'quantiles'. The default value is 'table'

mode string

Possible values: [watch, snapshot]

Output mode. Must be one of 'watch' or 'snapshot'. The default value is 'watch'

quantiles int32

For 'quantiles' queries: the number of quantiles to output. The default value is 100.

array boolean

Set to true to group updates in this stream into JSON arrays (used in conjunction with format=json). The default value is false

Request Body

When the query parameter is set to 'neighborhood', the body of the request must contain a neighborhood specification.

after int32 REQUIRED
anchor object
before int32 REQUIRED
Responses
200

Connection to the endpoint successfully established. The body of the response contains a stream of data chunks.

Schema OPTIONAL
bin_data binary OPTIONAL

Base64 encoded binary payload, e.g., bincode.

json_data object OPTIONAL

JSON payload.

sequence_number int64
text_data string OPTIONAL

Text payload, e.g., CSV.

400

Unknown data format specified in the '?format=' argument.

Schema OPTIONAL
details object

Detailed error metadata. The contents of this field is determined by error_code.

error_code string

Error code is a string that specifies this error type.

message string

Human-readable error message.

404

Specified table or view does not exist.

Schema OPTIONAL
details object

Detailed error metadata. The contents of this field is determined by error_code.

error_code string

Error code is a string that specifies this error type.

message string

Human-readable error message.

410

Pipeline is not currently running because it has been shutdown or not yet started.

Schema OPTIONAL
details object

Detailed error metadata. The contents of this field is determined by error_code.

error_code string

Error code is a string that specifies this error type.

message string

Human-readable error message.

500

Request failed.

Schema OPTIONAL
details object

Detailed error metadata. The contents of this field is determined by error_code.

error_code string

Error code is a string that specifies this error type.

message string

Human-readable error message.