There is a community SqlLite proxy that will read a sqlite database file. For databases like MySQL you will need a server side script to connect to the database, javascript cannot.
I have similar requirements for the app I'm working on now. I suggest ditching the built in stores. IMO they're just not flexible enough to support online/offline switching. I still use stores for UI databinding, but I don't use them for local persistence or syncing with a remote server.
Instead of using the built in stores I wrote a thin data layer using WebSQL, and hand rolled all of the ajax needed to sync back and forth. It's pretty simple and you'll know exactly what is happening when anything goes wrong, instead wasting time of trying to cajole the store classes into doing what you want.