NOTE: ScriptDB is now deprecated. Please take a look at Database abstraction with google apps script for alternatives.
An example Let's say that we wanted to keep customer data in a separate DB from orders data, with various applications accessing one or both of these data items. To demonstrate this, I'm going to create 3 scripts.
The first two are libraries, that are referenced by the third, like this. I'm using functions from the mcpher library, so we need that too. Taking a look at the orders and customers libraries, they could not be simpler. Their only role is to provide a handle into their respective scriptDBs and the code for each is exactly the same aside from the arbitrary silo name I've assigned . For help and more information join our forum, follow the blog, follow me on twitter Now here's an example applicationAnd here's the logged output{"siloId":"orders","timeStamp":1358559849276, "order":{"customerId":1,"items":[{"a":20},{"b":10}],"Id":1},"userStamp":"tocp4ah7+IDlR4ttxKeOTWzLV2Y=","name":"john"} {"siloId":"orders","timeStamp":1358559849570, "order":{"customerId":1,"items":[{"c":20}],"Id":2},"userStamp":"tocp4ah7+IDlR4ttxKeOTWzLV2Y=","name":"john"} {"siloId":"orders","timeStamp":1358559849963, "order":{"customerId":2,"items":[{"d":9}],"Id":3},"userStamp":"tocp4ah7+IDlR4ttxKeOTWzLV2Y=","name":"fred"} -- orders created by current user -- {"siloId":"orders","timeStamp":1358559849276, "order":{"customerId":1,"items":[{"a":20},{"b":10}],"Id":1},"userStamp":"tocp4ah7+IDlR4ttxKeOTWzLV2Y="} {"siloId":"orders","timeStamp":1358559849570, "order":{"customerId":1,"items":[{"c":20}],"Id":2},"userStamp":"tocp4ah7+IDlR4ttxKeOTWzLV2Y="} {"siloId":"orders","timeStamp":1358559849963, "order":{"customerId":2,"items":[{"d":9}],"Id":3},"userStamp":"tocp4ah7+IDlR4ttxKeOTWzLV2Y="} |
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Things that have been deprecated > Google Apps ScriptDB >