Skip to content

promise

Mathias Rangel Wulff edited this page Feb 29, 2016 · 7 revisions

Promise notation

You can use promise notation for AlaSQL

alasql.promise('SELECT * FROM XLS("mydata.xls") GROUP BY name WHERE lastname LIKE "A%" and city = "London"')
      .then(function(res){
           console.log(res);
      }).catch(function(err){
           console.log('error:', err);
      });

AlaSQL uses ES6 promises which are available in most modern browsers. If you need to support browsers that do not support Promises, fear not! There is a polyfill for you to include.

Clone this wiki locally