Following on from Query from GAS,  we’ll query the colortable  created in UpdatingScriptDB. As you would expect, this is just a few lines of code.

//scriptdb specific function getFromScriptDb(e) {   return { results :              mcpher               .scriptDbSilo("colorSchemes",publicStuffDb())               .queryArray(makeQuery(e),e.parameter.limit) }; }
It needs a few basic utility functions as used all over on this site from the mcpher shared library.
It’s worth a few words on the queryArray() method of scriptdb silo. In order to harmonize the number of fetches required to get a lot of data between parse and scriptdb (so they can be compared), I’m using this method to handle getting the data in batches, up to the limit specified. This also gets over any default limits by either approach. Here’s the code – its simply returns an array of size (limit) or everything matching if limit is 0. It handles the batching up process.
cScriptDbSiloItem.prototype.queryArray = function(ob, optLimit) {      // this is the max I'll take in one go to be compatible with   var maxLimit = 1000;   var limit = fixOptional ( optLimit, 0);   var results =[], q = this.querySet(ob);   while(true) {     var qr =  this.db()                 .query(q)                 .limit(limit > 0 ? limit-results.length : maxLimit).startAt(results.length);     // we're done     if (!qr.hasNext()) return results;     // still have pushing to do     while(qr.hasNext() && (limit==0 || results.length < limit)) results.push(;   }    };

The results

Here’s a live query. You can get jSonp also by specifying a callback parameter. This will get the first two entries from the dulux color scheme, this time using scriptdb as the provider

For more about, see

For help and more information join our forum, follow the blog or follow me on Twitter .