$dump-sql

Dump results of the sql query

$dump-sql operation takes the sql query and responds with the Chunked Encoded stream in CSV format or in NDJSON format. Useful to export data for analytics.
1
POST [base]/$dump-sql
Copied!

Headers

Parameter
Required?
Type
Description
content-type
true
String
Content-type of the query body

Query parameters

Parameter
Required?
Type
Description
_format
false
String
​
    json/ndjson: return output as ndjosn
    otherwise: return output as TSV

Body parameters

Parameter
Required?
Type
Description
query
true
String
Sql query to execute

Example

Get id and name of each patient
Request
Response

REST Console

1
POST /$dump-sql
2
Content-Type: text/yaml
3
​
4
query: select id, resource#>>'{name,0,given,0}' from patient
Copied!

Curl

1
curl -u bulk-client:secret $AIDBOX_BASE_URL/\$dump-sql \
2
-H 'Content-Type: text/yaml' [email protected] <<EOF
3
query: select id, resource#>>'{name,0,given,0}' from patient
4
EOF
Copied!

Status

200 OK

Headers

Header
Value
Content-Type
text/tab-separated-values
Transfer-Encoding
Chunked

Body

1
pt-1 Alice
2
pt-2 Bob
3
pt-3 Charles
Copied!

Body as table

​
​
pt-1
Alice
pt-2
Bob
​
Last modified 4h ago