To optimize larger data load operations, I am suggesting development of a feature allowing creation of multiple rows in a single action.
The current API supports POST of a JSON doc structured as below, returning the newly created row as a TapisResult.
{
"data": {
"name": "example-widget",
"widget_type": "gear",
"count": 0,
"is_private": false
}
}
Maybe it would work to support posting a structure like this to load multiple rows at once:
{
"data": [{
"name": "example-widget",
"widget_type": "gear",
"count": 0,
"is_private": false
}, {
"name": "example-widget-2",
"widget_type": "gear",
"count": 1,
"is_private": false
}, {
"name": "example-widget-3",
"widget_type": "gear",
"count": 4,
"is_private": false
}]
}
The response from the service would be the list of created rows (as TapisResults).
To make this bulk insert an atomic operation, the entire set of row adds could be wrapped in a single transaction, being rolled back if any of the row creations fail, with the most relevant error being returned as a message from the service.