SQL over REST: Difference between revisions
Jump to navigation
Jump to search
(Created page with "There are two methods to do SQL over REST: a) GET method: <code>curl <nowiki>http://root:admin@localhost:4321/sql/</nowiki>[SCHEMA]/[SQL_QUERY]</code> b) POST method: <code>curl -X POST -d '[SQL_QUERY]' <nowiki>http://root:admin@localhost:4321/sql/</nowiki>[SCHEMA]</code> == JSONL results == The result is a <code>jsonl</code> document containing the result lines: curl -X POST -d 'select a, sum(b) as sum_b from a group by a' <nowiki>http://root:admin@localhost:4321/sq...") |
(No difference)
|
Revision as of 10:47, 19 May 2024
There are two methods to do SQL over REST:
a) GET method: curl http://root:admin@localhost:4321/sql/[SCHEMA]/[SQL_QUERY]
b) POST method: curl -X POST -d '[SQL_QUERY]' http://root:admin@localhost:4321/sql/[SCHEMA]
JSONL results
The result is a jsonl
document containing the result lines:
curl -X POST -d 'select a, sum(b) as sum_b from a group by a' http://root:admin@localhost:4321/sql/test
returns
{"a": 1, "sum_b": 7} {"a": 2, "sum_b": 6} {"a": 6, "sum_b": null}