Skip to content
Mathias Rangel Wulff edited this page Jun 12, 2015 · 15 revisions

Async execution of SQL statements

Normal sync version would be

    var result = alasql(sql, params)

To run Async version add a 3rd parameter as callback:

	alasql(sql, params, function(result) {
		// do something with result
	});

AlaSQL will always run async in the following cases.

  • IndexedDB functions
  • INTO- functions
  • FROM-functions

Example:

     var resSync = alasql('SELECT * FROM CSV("mydata.csv")')',[],function(resAsync){
          console.log(resAsync);
     });
     console.log(resSync);

Clone this wiki locally