AlaSQL / alasql

AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
http://alasql.org
MIT License
7.04k stars 659 forks source link

Webworker option 1 + 2 #611

Open mathiasrw opened 8 years ago

mathiasrw commented 8 years ago

In https://github.com/agershun/alasql/wiki/Webworker two options for how to to run AlaSQL as a webworker.

Question: is it correctly understood that for the browser the code

<script src="alasql-worker.js"></script>
<script>
  alasql('SELECT VALUE 1+1', [], function(res){
    console.log(res);
  });
</script>

and

<script src="alasql.js"></script>
<script>
  alasql.worker();
  alasql('SELECT VALUE 1+1', [], function(res){
    console.log(res);
  });
</script>

gives the same result?

mathiasrw commented 8 years ago

@agershun Any inputs?

nickdeis commented 8 years ago

Hey @mathiasrw , I have looked at this portion of the code, and I think it would. The function "worker" simply spawns alasql on worker using a Blob URL. The exception of course is in IE11: where Blob URLs are not implemented.

I'll let @agershun be the final word on this of course.

mathiasrw commented 8 years ago

The exception of course is in IE11: where Blob URLs are not implemented.

wow - not good...