【发布时间】:2014-06-05 10:29:51
【问题描述】:
我正在开发一个需要使用 indexedDB 离线存储一些信息的应用程序,但是对于 Safari,它不可用(还),所以我需要使用 webSQL。
我已经为 indexedDB 使用了this 适配器,为不支持 indexedDB 的浏览器使用了enter link description here polyfill。
不幸的是,我在使用 Shim 时遇到了一些重大问题,例如,在 iOS Safari 和 Safari 上,当我的应用程序需要从数据库中获取一些数据以查看它是否存在时,它会返回错误。
喜欢这个和那个:
throwDOMException@http://localhost/Dev/Websites/myWebsite/js/libs/IndexedDBShim.js:40:16
Error: Assertion Failed: 0: The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened
这是由于他们使用某种 hack 来返回一些值,甚至在 polyfill 中他们这样说:
// The IndexedDB Specification needs us to return an Object Store immediatly, but WebSQL does not create and return the store immediatly
// Hence, this can technically be unusable, and we hack around it, by setting the ready value to false
所以我的问题是,使用 indexedDB 适配器,我可以为 webSQL 并行添加另一个适配器吗?
【问题讨论】:
标签: ember.js ember-data indexeddb web-sql