Soul consists of 4 main namespaces: Tables (/tables/
), Rows (/tables/{table-name}/rows/
), Auth (/auth/
), and Root (/
). In this document, we’ll try to go over all of them so you can get familiar with how Soul works.
To follow the below examples we need to download a sample database and also install Soul CLI.
wget https://raw.githubusercontent.com/lerocha/chinook-database/master/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite # Download sample sqlite database
npm install -g soul-cli
soul -d ./Chinook_Sqlite.sqlite -p 8000
If an error occurs while processing a request, it will be indicated via the presence of an error
key and a message
in the JSON response. For example:
curl --request POST \
--url http://localhost:8000/api/tables \
--header 'Content-Type: application/json' \
--data '{
"name": "Artist", # note that we already have an `artists` table
"schema": [
# ...
]
}'
{
"message": "table artists already exists",
"error": {
"code": "SQLITE_ERROR"
}
}