There are already abstractions that work over both and work for nontrivial apps, including, IIRC, an indexedDB polyfill using WebSQL.
Going the other way might be harder, but every rdbms is, itself, an abstraction over a nonrelational storage system of some kind, so it's clearly not impossible.
The IndexedDB polyfills over WebSQL are horribly slow and buggy. You'd be hard pressed to do something non-trivial with them. Believe me, I've tried. Still better than using Safari's IndexedDB though!