SQL

SQL API Usage

The SQL API is only available in the Enterprise Edition.
shell
curl \ --data '{ "query": "select name, height_in_cm from characters" }' \ --header 'Content-Type: application/json' \ http://localhost:4185/dbs/avatar_characters/sql
yields:
json
{ "rows": [ { "name": "Aang", "height_in_cm": 137 }, { "name": "Katara", "height_in_cm": 145 } ], "runtime": { "real": 0.000, "user": 0.000214, "sys": 0.000090 } }

Useful SQL Snippets

Rename a column
Split a multiline cell into one line per row
Extract value from JSON object
Merge a column of JSON objects
Generate a table with numbers from 1 to 10