Options
url string substitution (deprecated)
This feature is deprecated, urlencoding should be used instead.
This feature allows to replace part of the url with string defined in query parameter.
Read this documentation for a detailed explanation.
sort
This feature allows to sort the output of query. The original SQL statement is wrapped in additional SQL for efficient sorting in database. Read this documentation for a detailed explanation.
distinct
This feature allows to remove duplicate rows of the output. The original SQL statement is wrapped in additional SQL for efficient distinct filtering in database. Read this documentation for a detailed explanation.
limit and offset
This feature allows you to limit the number of records returned from a result set, or skip records in a result set. Read this documentation for a detailed explanation.
nullStr
Set a custom placeholder value for NULL
values. By default, when passing NULL
values in URLs, the placeholder <null>
is used. If you want to define your own placeholder, use the nullStr query string parameter. Read this documentation for a detailed explanation.
transpose
This feature transposes output by converting column to rows and rows to columns. Read this documentation for a detailed explanation.
stream
This feature allows to run queries using streaming data transfer mechanism of HTTP. It comes handy when requesting large amount of data. Read this documentation for a detailed explanation.
count
When using this query string parameter in a request, the response will contain an additional header, SlashDB-All-Record-Count that displays the total number of rows returned by the query. It may be useful when using the limit and offset query parameters.
Usage:
?count
Response Header:
SlashDB-All-Record-Count:2
Value type: (no value)
Default: (not used)
Examples:
/query/customers-in-city/city/Paris.json?count - response contains header with total number of rows returned by query (header SlashDB-All-Record-Count is 2)
/query/customers-in-city/city/Paris.json?count&limit=1 - like the above example but also using query parameter limit=1, header SlashDB-All-Record-Count is still 2, even though we're using limit.
$ curl -v 'https://demo.slashdb.com/query/customers-in-city/city/Paris.json?count&limit=1'
* Hostname was NOT found in DNS cache
* Trying 50.19.250.51...
* Connected to demo.slashdb.com (50.19.250.51) port 443 (#0)
[...]
> GET /query/customers-in-city/city/Paris.json?count&limit=1 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: demo.slashdb.com
> Accept: */*
>
< HTTP/1.1 200 OK
* Server nginx/1.4.6 (Ubuntu) is not blacklisted
< Server: nginx/1.4.6 (Ubuntu)
< Date: Thu, 12 Jul 2018 15:00:22 GMT
< Content-Type: application/json
< Content-Length: 139
< Connection: keep-alive
< SlashDB-All-Record-Count: 2
<
[
{
"LastName": "Bernard",
"State": null,
"FirstName": "Camille",
"Phone": "+33 01 49 70 65 65"
}
]
schema
Returns a schema document for the requested query. Supported formats are JSON, XML, and CSV. Schemas are returned in JSON Schema, XSD, and CSV formats, respectively. This parameter does not take a value; its presence in the query string will cause a schema document to be returned.
- Can be streamed using
stream
query string parameter
See Schemas for more information.
Usage:
?schema
Value type: N/A
Default: N/A
Applicable to: JSON, XML, CSV formats. Resources, vectors, arrays, scalars.
Examples:
/query/customers-in-city/city/Paris.json?schema- return JSON schema for customers-in-city
query
Options (XML)
nil visible
This feature allows to force showing empty tags.
Usage:
?nil_visible=[True_or_False]
Value type: boolean (True or False)
Default: False
Examples:
/query/customers-in-city/city/Paris.xml - not showing empty tags by default
/query/customers-in-city/city/Paris.xml?nil_visible=False - not showing empty tags
/query/customers-in-city/city/Paris.xml?nil_visible=True - showint empty tags
xmlType
This feature allows to adjust XML output.
Usage:
?xmlType=[name_of_xml_type]
Value type: string
Value options:
- adPersistXML - MS XML Persistance Format contains schema and Recordsets in single document
Default: (not used)
Examples:
/query/customers-in-city/city/Paris.xml?xmlType=adPersistXML - rendering XML in Persistance Format.
Options (JSON)
NaN & Infinity Encoding
This parameter controls how nan
, inf
, and -inf
values in floating point columns will be handled in JSON requests for databases that support the IEEE 754-1985 specification. This query string will override the json_sdb.nan_inf_encoding
INI parameter. See the JSON INI documentation for more information.
Usage:
URL
?jsonNanInf=[`null`, `number`]
Value type: string
Value options:
-
null
- outputnan
,inf
, and-inf
floating point values as Javascriptnull
-
number
- outputnan
,inf
, and-inf
floating point values as JavascriptNaN
,Infinity
, or-Infinity
Default: null
Applicable to: list of resources, list of arrays, vectors, single resource, single array, scalar
Examples: See the JSON INI documentation