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.01k stars 653 forks source link

AlaSQL path #335

Open mathiasrw opened 9 years ago

mathiasrw commented 9 years ago

I see that the worker try to figure out if its a .min or .js we are running with

https://github.com/agershun/alasql/blob/1706fdcb2b5166490d8e2492d53b2a14a5c81d21/src/99worker.js#L7-L25

I have a feeling it would be better to build the alasql object source into the worker version so we dont spend time and space on looping all script tags to find out what the user is doing.

If you dont see it this way atlease we could reuse the getAlaSQLpath function https://github.com/agershun/alasql/blob/1706fdcb2b5166490d8e2492d53b2a14a5c81d21/src/10start.js#L113

agershun commented 9 years ago
  1. Agree that we need to reuse getAlaSQLPath() function.
  2. The reason of this 'elephant' solution that we need to know the source directory of alasql.min.js, even the html file is located somewhere in the website.

Can you explain, how we can "build the alasql object source into the worker version"?

mathiasrw commented 9 years ago

Good to see you are back :)