Data API endpoints

/v1/template

This endpoint is used to execute an existing query template. You can read more about this here.

/v1/query

The data microservice unifies all operations that can be performed on the database under a single ‘query’ interface. A query is POST ed to /v1/query.

A typical query operation is as follows:

Request

POST /v1/query HTTP/1.1

Takes the JSON structure of a Query for its body

Query

Key Required Schema Description
type true String Type of the query
args true JSON Value The arguments to the query

The various values that type and args can take are listed in the following table:

type args Synopsis
"insert" insert Insert data into tables
"select" select Retrieve data from tables
"update" update Update data
"delete" delete Delete data
"count" count Count the number of rows in a table
"create_object_relationship" create_object_relationship Define a new object relationship
"create_array_relationship" create_array_relationship Define a new array relationship
"drop_relationship" drop_relationship Drop an existing relationship
"set_relationship_comment" set_relationship_comment Set comment on an existing relationship
"create_insert_permission" create_insert_permission Specify insert permission
"drop_insert_permission" drop_insert_permission Remove existing insert permission
"create_select_permission" create_select_permission Specify select permission
"drop_select_permission" drop_select_permission Remove existing select permission
"create_update_permission" create_update_permission Specify update permission
"drop_update_permission" drop_update_permission Remove existing update permission
"create_delete_permission" create_delete_permission Specify delete permission
"drop_delete_permission" drop_delete_permission Remove existing delete permission
"set_permission_comment" set_permission_comment Set comment on an existing permission
"create_query_template" create_query_template Create a query template
"execute_query_template" execute_query_template Execute a query template
"drop_query_template" drop_query_template Drop an existing query template
"set_query_template_comment" set_query_template_comment Set comment on an existing query template
"bulk" Query array Execute multiple operations in a single query

Response

The response structure is dependent on the type of query that is executed.