来自现有SQLite数据库的核心数据数据模式 [英] Core Data data schema from existing SQLite database

查看:140
本文介绍了来自现有SQLite数据库的核心数据数据模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从现有的SQLite数据库文件生成.xcdatamodel(CoreData数据模型)?

Is it possible to generate a .xcdatamodel (CoreData data model) from an existing SQLite database file?

我开发了一个SQLite数据库并编写了一个Java API反对。现在,我需要写一个等效的iOS API到同一个数据库(文件)。我不想在xCode中手工创建数据模式。我只想生成.xcdatamodel,并使用xCode生成我将编码的实体类。

I've developed a SQLite database and written a Java API against it. Now, I need to write an equivalent iOS API to the same database (file). I'd prefer not to create the data schema by hand in xCode. I just want to generate the .xcdatamodel, and use xCode to generate the entity classes that I'll code against.

有可能吗?

推荐答案

请参阅如何使用我的现有SQLite数据库与Core Data?有效导入数据。我知道你不是具体要求使用整个数据库,而只是创建模型,但你必须明白,现有的SQLite数据库和Core Data想要存储的数据之间没有1-1关系。

See How do I use my existing SQLite database with Core Data? and Efficiently Importing Data. I understand that you're not asking specifically about using the entire database but just creating the model, but you have to understand that there's not a 1-1 relationship between an existing SQLite database and what Core Data wants to store.

这篇关于来自现有SQLite数据库的核心数据数据模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆