Resource Types
Each URL in SlashDB Data Discovery references to some resources which represent data in specific data structure: list of objects, single object, arrays, vector or scalar.
List of Objects
Returned data contains all available columns and relationships in a form of list.
Tables or views that have a primary key the receive in GUI special buttons that point to a single resource view. Those buttons do not appear if table or view does not have a primary key because unique URI for the resource cannot bo created.
Examples:
All data about Invoices table that has primary key\ https://demo.slashdb.com/db/Chinook/Invoice.html
All data from view Products_by_Category that doesn't have a primary key\ https://demo.slashdb.com/db/Northwind/Products_by_Category.html
Single object
When using canonical URL of a resource (filtering only on Primary Key columns) the resource is presented as single entity (different than list output). This output can be forced into list with wantarray query parameter.
Usage:
/[table_name]
Examples:
/Invoice/InvoiceId/1.html - Invoice filtered on Primary Key column (InvoiceId = 1)
Arrays
Show only certain columns of objects. Allows to present important data instead of all columns and relations. Reduces amount of sent data and makes output clearer. Add comma separated names of columns you want to get in the output.
Usage:
/[table_name]/[column_A],[column_B]
Examples:
https://demo.slashdb.com/db/Chinook/Invoice/InvoiceDate,BillingCountry.html - get only two columns of Invoices - InvoiceDate and BillingCountry
Vector
Vector is an output of single column among multiple rows.
Getting a vector from a single column is as simple as not including a value range in the URL.
Usage:
/[table_name]/[column_name]
Examples:
https://demo.slashdb.com/db/Chinook/Genre/Name.html - get only genre names
Scalar
Getting a single column value (or scalar) is also possible by including the attribute name after the value range.
Usage:
/[table_name]/[pk_column]/[pk_value]/[column_name]
Examples: