Skip to main content

SQL API

The SQL API lets you execute SQL queries from your application via the GraphQL API. The SQL API is particularly useful for querying data from web and mobile apps to build dashboards and reports.

The example below demonstrates a simple SQL query to select ten records from a Data Pool using the SQL API. You can query Data Pools by unique name or ID.

query {
sqlV1(input: {
query: """
SELECT *
FROM "TacoSoft Demo Data"
LIMIT 3
"""
}) {
columns {
columnName
}
rows
}
}
}

Usage​

Arguments​

The table below describes the input parameters for the SQL API. These parameters allow you to specify the SQL query.

FieldTypeRequiredDescription
queryStringYes

The SQL query.

Read more about SqlV1Input.

Response​

The SQL API responds with a SqlResponse object that includes a values array of headers and an array of arrays with the rows.

FieldTypeNullableDescription
columns array of SqlColumnResponseNo

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

rows array of StringNo

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.

infoQueryInfoNo

The Query statistics and metadata.

Read more about SqlResponse.