(#3062) - refactor idb/websql to share more code