Skip to main content Link Menu Expand (external link) Document Search Copy Copied

FeatureBase Community users can run SQL Queries over the HTTP SQL CLI.

Before you begin

Endpoint syntax

POST /sql

Description

The sql query text is passed in the body of the request, with a Content-Type of text/plain.

Example

curl -XPOST localhost:10101/sql -d 'select 1'

Result

{
  "schema": {
    "fields": [
      {
        "name": "",
        "type": "INT"
      }
    ]
  },
  "data": [
    [
      1
    ]
  ],
  "exec_time": 16412581
}

Errors

If an error occurs during query execution, the request will still succeed, even though the body may contain an error.

Example

curl -XPOST localhost:10101/sql -d 'select foo'

Result

{
  "error": "[1:8] column 'foo' not found"
}

Further information