So for some time I've been searching for a general-purpose SQLite bridge for 
javascript.  When I need this I'm generally keeping the database on a computer 
which is also a web server, so I just use a PHP file which I've written to act 
as a bridge: make JavaScript execute an HTTP operation to POST a request to the 
PHP file, the PHP file executes the command in the request, and if the command 
returns rows it returns them as its contents encoded as JSON.  It all works 
efficiently enough for my purposes.

But I can't use this at home because I don't want to run a general-purpose web 
server on my home computer.

HTML5 includes database commands which everyone has implemented by using SQLite 
calls which is both a tremendous compliment to the SQLite team and a problem 
because the HTML5 team don't want to build SQLite into the spec.  However, the 
databases in HTML5 persist as belonging to particular web sites.  You can't 
specify an arbitrary file on disk to open, the browser maintains the databases 
as attached to a particular site.  This is done on purpose, to prevent what 
could be a disastrous security problem allowing people who run web sites to 
read the contents of SQLite databases on your computer.  Exactly the same 
mechanism is used to prevent web browsers from opening arbitrary text files on 
your hard disk, which would be a similar security disaster.

So we have an excellent JavaScript-SQLite bridge but it's intentionally 
prevented from accessing SQLite databases you keep on your computer.  So it's 
useful only if you only ever need to access the database inside a specific 
browser.  But then I thought … well, since it turns out that everyone 
implements this using SQLite, what would happen if I did an ATTACH ?

And on that note I'll bid you goodnight.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to