As I continue to build out my prototype for OJ's qDb component (trying to fulfill my promise to IndexedDb), I have done a few of the obvious things. I automated the database connection in the constructor as +Kyaw Tun recommended. I looked at +Taylor Buley's own library and make some tweaks accordingly. I have tested inserting up to a million records and selecting from the resulting object stores. There are some memory leaks to address and a few other performance issues before I'd recommend qDb on very, very large datasets--but it is in an OK state.
Yet, as pleased as I am with the abstraction layer that I built, I feel a growing sense of frustration in this class of problem solving.