Data Discovery
Data Discovery is a core feature of SlashDB, which enables manual or programmatic access of database resources using REST API calls.
Concepts
Data Discovery automatically exposes the structure and contents of a database through a REST-based API. It allows users and applications to retrieve and update database records through HTTP requests.
Example
Consider the following URLs, which drill down from a general resource to a specific resource (colors match the diagram):
/db - all databases connected to SlashDB
/db/Chinook - all tables in the Chinook database
/db/Chinook/Customer - all records in the Chinook Customer table
/db/Chinook/Customer/CustomerId/10 - Customer record with CustomerId = 10
/db/Chinook/Customer/CustomerId/10/FirstName - FirstName column of the record above
Each of these resources can be retrieved in HTML, JSON, XML, or CSV formats by adding the appropriate extension.
https://demo.slashdb.com/db/Chinook/Customer/CustomerId/10.json URL segments:
Key Features
-
Automatic API Generation: SlashDB automatically generates RESTful endpoints based on your database schema (tables, columns, relationships).
-
Browsable Interface: You can navigate through a database using a web browser, or access it using tools like
curl
, or programatically. Each resource (table, row, column, relationship) has a corresponding URL. -
Multiple Formats: You can retrieve data in HTML, JSON, XML, or CSV formats.
-
URL-based Filtering: You can add filters to the generated URLs that allow you to select which records to retrieve or update.
-
Relationship Mapping: Each API response includes links to related resources, making it easy to navigate relationships (e.g. foreign key references).
At the table level, records can be created, updated, or deleted by using the appropriate HTTP method (POST, PUT, DELETE).
Resources can be retrieved as multiple records, single records, individual columns, or single values.
Filters (e.g. FirstName/Mark
) can be joined to columns to execute CRUD operations selectively against a resource or a group of resources. Relationships between tables can also be traversed, e.g:
- /db/Chinook/Customer/FirstName/Mark/Employee - return all Employee records for any Customer whose FirstName = "Mark"
Info
Learn more about navigating through data using Data Discovery.