使用 iOS 进行多通道核心数据分块迁移

发布于 2024-10-07 17:49:51 字数 397 浏览 0 评论 0原文

我正在尝试迁移大约 11Mb 的 iPhone/iPad sqlite 存储。它有大约三十个不同的实体,所有实体都非常相互关联。

在 3GS 上,这需要相当长的时间。即使是轻量级迁移也需要大约四分钟。

我想这是因为所有的关系都保存在记忆中。

阅读 Apple 迁移指南,它说对于大型数据集,一种方法是使用不同的映射模型进行多次传递。

一切都很好。但是,如果一个映射模型中的实体与另一个映射模型中的实体相关,您似乎无法执行此操作。事实上,在映射模型 xcmappingmodel 文件中,会生成类似于“can't auto generated value expression with nilapping name”的编译错误。

非常感谢任何提示。

非常感谢,

马克斯

I'm trying to migrate an iPhone/iPad sqlite store of about 11Mb. It has around thirty different entities, all quite heavily interrelated.

On a 3GS, it takes quite some time. Even a lightweight migration takes around four minutes.

I guess this is because all the relationships are held in memory.

Reading the Apple migration guide, it says that for large datasets, one approach is to do multiple passes using different mapping models.

All well and good. However, it seems that you can't do this if the entities in one mapping model are related to those in another. In fact, a compilation error is generated along the lines of "can't auto generate value expression with nil mapping name" in the Mapping Model xcmappingmodel file.

Any tips much appreciated.

Many thanks,

Max

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栖竹 2024-10-14 17:49:51

难道您不能只使用新架构创建一个新数据库,然后通过读取旧数据库并将其插入新数据库来开始迁移过程吗?

Cant you just create a new database with the new scheema and then start the migration process by reading from the old one and inserting to the new one ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文