

Ask HN: ODBC driver using websockets? - apollo

Does a javascript ODBC driver exist that works over websockets? If not, is it feasible?<p>I'd like to be able to send queries to an SQL database directly from the browser, with no proxy.
======
bdfh42
OK - perhaps dumb question - but what is the problem with AJAX and a web
service to return the SQL query results in (say) JSON format? It is pretty
simple and works very well.

The concept of an ODBC driver being run directly from Javascript if not to
something like a "sandboxed" instance of SQLight is a bit worrying on security
grounds.

~~~
apollo
It's possible to do it that way, but it adds some annoying constraints. If
you're accessing data locally, it would have to go through a remote server,
which causes latency and privacy concerns.

~~~
bdfh42
Sorry, I am still not getting this - if the data is local then why not run the
app on a server running on the local machine.

Alternately you are trying to access local personal data using a remote app -
so you need Google's or HTML5's support for a local database (SQLight I think
but in a wrapper).

~~~
ismarc
One instance where it would be nice is if you have your own "browser" written
to use XULRunner and want some custom local database for something (say your
use of XULRunner is to provide a test harness for automated testing and you
want to store the test sequences and value transformations in the database).
You have javascript to work with in a sandboxed environment, but isn't hosted
on a webpage anywhere. Being able to directly access a database dramatically
increases your capabilities and doesn't sound unreasonable. It only sounds
unreasonable if you're talking about javascript that gets pushed out to a
user's web browser.

NOTE: I wouldn't use this approach, and there's probably better ways, but I
can see the potential benefits of it.

