/api/dataset endpoints.
/api/dataset endpoints.
(as-format-async export-format respond raise in-chan)
Inputs: [export-format :- ExportFormat respond :- (s/pred fn?) raise :- (s/pred fn?) in-chan :- ManyToManyChannel]
Write the results of an async query to API respond
or raise
functions in export-format
. in-chan
should be a
core.async channel that can be used to fetch the results of the query.
Inputs: [export-format :- ExportFormat respond :- (s/pred fn?) raise :- (s/pred fn?) in-chan :- ManyToManyChannel] Write the results of an async query to API `respond` or `raise` functions in `export-format`. `in-chan` should be a core.async channel that can be used to fetch the results of the query.
(export-format->context export-format)
Return the :context
that should be used when saving a QueryExecution triggered by a request to download results
in EXPORT-FORAMT.
(export-format->context :json) ;-> :json-download
Return the `:context` that should be used when saving a QueryExecution triggered by a request to download results in EXPORT-FORAMT. (export-format->context :json) ;-> :json-download
Regex for matching valid export formats (e.g., json
) for queries.
Inteneded for use in an endpoint definition:
(api/defendpoint POST ["/:export-format", :export-format export-format-regex]
Regex for matching valid export formats (e.g., `json`) for queries. Inteneded for use in an endpoint definition: (api/defendpoint POST ["/:export-format", :export-format export-format-regex]
Schema for valid export formats for downloading query results.
Schema for valid export formats for downloading query results.
POST /api/dataset/
Execute a query and retrieve the results in the usual format.
database
value must be an integer.
query
## `POST /api/dataset/` Execute a query and retrieve the results in the usual format. ##### PARAMS: * **`database`** value must be an integer. * **`query`**
POST /api/dataset/:export-format
Execute a query and download the result data as a file in the specified format.
export-format
value must be one of: csv
, json
, xlsx
.
query
value must be a valid JSON string.
respond
raise
## `POST /api/dataset/:export-format` Execute a query and download the result data as a file in the specified format. ##### PARAMS: * **`export-format`** value must be one of: `csv`, `json`, `xlsx`. * **`query`** value must be a valid JSON string. * **`respond`** * **`raise`**
## `POST /api/dataset/duration` Get historical query execution duration. ##### PARAMS: * **`database`** * **`query`**
Ring routes for api/dataset: (POST_:export-format POST_ POST_duration)
Ring routes for api/dataset: (POST_:export-format POST_ POST_duration)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close