Use cases

Bespoke data access patterns

Query with SQL directly for access patterns that don’t fit into the other APIs.

Features

Example

Example 1: Simple SQL query

Get the first 3 rows from the “TacoSoft Demo Data” Data Pool.

query {
  sqlV1(input: {
    query: """
      SELECT
        order_id,
        quantity,
        taco_name,
        sauce_name
      FROM "TacoSoft Demo Data"
      LIMIT 3
    """
  }) {
    columns {
      columnName
    }
    rows
  }
}

Usage

Arguments

Input to the SqlV1 api.

query
String
required

The SQL query.

dialect
SqlDialectV1

The SQL dialect to use. If not provided, the query is parsed on a best-effort basis.

Response

Response from the SQL API.

columns
[SqlColumnResponse!]
required

The column names in the same order as present in the data field.

rows
[[String]!]
required

The data gathered by the SQL query. The data is returned in an N x M matrix format, where the first dimension are the rows retrieved, and the second dimension are the columns. Each cell can be either a string or null, and the string can represent a number, text, date or boolean value.

info
QueryInfo
required

The Query statistics and metadata.

Embeddable UI components