The data storage API is an awaited feature in SiteVision 5 that enables data storage for WebApps and RESTApps. The API introduces two types of data stores and data must be valid JSON data.
The data storage technology is designed to work with clustered data and uses partial data updates to ensure cluster safety. The API is designed to be powerful and easy to work with.
There are two types of Data stores. They share the restrictions and error handling behaviour for but they have their own type-specific API:
null
WebApps and RESTApps that wants to use a Data Store must state its intentions in the "storage" section of the app's manifest.
// manifest.json
{
"id": "dataStoreApp",
"version": "0.0.1",
"name": "Data store app",
"author": "SiteVision AB",
"description": "A data store app",
"helpUrl": "https://developer.sitevision.se/thefantasticdatastoreapp",
"type": "WebApp",
"storage": {
"collectionDataStore": "myCollectionStore",
"keyValueDataStore": "myStore" // multiple stores ["x", "y"]
}
}
// retrieve an instance of the storage API
const storage = require('storage'),
...
// try to retrieve specific stores
const collectionDataStore = storage.getCollectionDataStore('myCollectionStore');
const keyValueStore = storage.getKeyValueDataStore('myStore');
© 2019 SiteVision AB