跳过内容

从Ionic Secure Storage迁移

Ionic Secure Storage is an enterprise plugin for encrypted key-value data. Capgo provides two SQLite-based options depending on your data model and performance needs.

Capgo 根据您的数据模型和性能需求提供两个基于 SQLite 的选项。

Capgo 替换概览
标题:__CAPGO_KEEP_0__ 替换概览Capgo replacement__CAPGO_KEEP_0__ 替换
迁移指南@capgo/capacitor-fast-sql @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-fast-sql @capgo/capacitor-data-storage-sqlite您当前位置
认证连接@capgo/capacitor-social-login认证连接迁移
身份安全库@capgo/capacitor-native-biometric身份安全库迁移

选择您的存储插件

存储插件
  • 快速 SQL: 最适合大数据集、同步工作流或您想要完全控制 SQL 和高吞吐量。
  • 数据存储 SQLite: 最适合简单的键值存储,支持可选的加密和最小的设置。

如果您不确定,请先使用 Data Storage SQLite 进行键值机密,然后在需要结构化数据或高容量写入时切换到 Fast SQL。

迁移步骤

迁移步骤
  1. 选择匹配您的数据模型的存储插件。 安装插件
  2. 并同步本机 __CAPGO_KEEP_0__。 and sync native code.
复制到剪贴板
# Option A: Fast SQL
npm install @capgo/capacitor-fast-sql
# Option B: Data Storage SQLite
npm install @capgo/capacitor-data-storage-sqlite
npx cap sync
  1. 到新 __CAPGO_KEEP_0__ 表面。使用 Fast SQL 或 Data Storage SQLite 文档中的具体读写方法。 to the new API surface. Use the Fast SQL or Data Storage SQLite docs for the exact read/write methods.
  2. 迁移现有数据 首次启动时,通过从Ionic Secure Storage中读取值并将它们写入新SQLite存储中来迁移数据。
  3. 从依赖项和本机配置中移除Ionic Secure Storage 从您的依赖项和本机配置中移除Ionic Secure Storage

下一步

下一步