如何增加 pouchDB 中的存储大小
How to increase storage size in pouchDB
我正在使用带索引数据库适配器的 pouchDB 开发 ionic 3/angular 4 应用程序。我的查询是如何使用 ionic 3/angular 4 增加 pouchDB 中的索引数据库大小,因为我的 json 大小是 20mb,我想将其存储在数据库中以供离线应用。
非常感谢任何帮助:)
对于 20mb,我认为你可以安全地使用大多数主流浏览器。
- 基于 Chromium 的浏览器将根据可用磁盘 space 进行计算,并允许应用存储最多 6% 的可用磁盘 space,这可能非常大。 chromium space calculation
- Firefox 有 50mb 的初始限制,如果您的应用需要更多,然后会征求用户的许可。
- Mobile Safari 和 IE 分别有 50mb 和 250mb 的硬限制,非常恼人的是需要间歇性地向用户请求权限。
see more information here
问题是 "pouchdb core" 大小参数的打字稿(类型定义)被遗漏了。
在未来版本中更新类型定义文件之前,您可能需要自己添加它
在接口声明中index.d.ts (node_modules/@types/pouchdb-core/index.d.ts)的第516行附近。
来自
interface LocalDatabaseConfiguration extends CommonDatabaseConfiguration {
auto_compaction?: boolean;
revs_limit?: number;
}
至
interface LocalDatabaseConfiguration extends CommonDatabaseConfiguration {
auto_compaction?: boolean;
revs_limit?: number;
size?: number;
}
已提供此更改的拉取请求,但目前尚未将其纳入最新版本
我正在使用带索引数据库适配器的 pouchDB 开发 ionic 3/angular 4 应用程序。我的查询是如何使用 ionic 3/angular 4 增加 pouchDB 中的索引数据库大小,因为我的 json 大小是 20mb,我想将其存储在数据库中以供离线应用。
非常感谢任何帮助:)
对于 20mb,我认为你可以安全地使用大多数主流浏览器。
- 基于 Chromium 的浏览器将根据可用磁盘 space 进行计算,并允许应用存储最多 6% 的可用磁盘 space,这可能非常大。 chromium space calculation
- Firefox 有 50mb 的初始限制,如果您的应用需要更多,然后会征求用户的许可。
- Mobile Safari 和 IE 分别有 50mb 和 250mb 的硬限制,非常恼人的是需要间歇性地向用户请求权限。 see more information here
问题是 "pouchdb core" 大小参数的打字稿(类型定义)被遗漏了。 在未来版本中更新类型定义文件之前,您可能需要自己添加它
在接口声明中index.d.ts (node_modules/@types/pouchdb-core/index.d.ts)的第516行附近。
来自
interface LocalDatabaseConfiguration extends CommonDatabaseConfiguration {
auto_compaction?: boolean;
revs_limit?: number;
}
至
interface LocalDatabaseConfiguration extends CommonDatabaseConfiguration {
auto_compaction?: boolean;
revs_limit?: number;
size?: number;
}
已提供此更改的拉取请求,但目前尚未将其纳入最新版本