Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating .sqlite file from Core Data store?

I've seen tutorials in books and on websites that offer .sqlite files for download. The sqlite files are used for Core Data.

How do I get a .sqlite file FROM an app or core data store on TO my desktop?

like image 390
Moshe Avatar asked Jul 27 '10 21:07

Moshe


People also ask

Is Core Data equal to SQLite?

The most important difference between Core Data and SQLite is that SQLite is a database while Core Data is not. That is the most important difference because there is very little to compare. Core Data and SQLite are solutions to different problems.

How do I create a DB file in SQLite?

To create a new database in SQLite you need to specify databases when opening SQLite, or open an existing file using . open . You can use the . database command to see a list of existing databases.

Where is Core Data SQLite file?

You can find it in the documents folder. As with every new build a new documents folder is created on the simulator it's getting quite cumbersome to search it manually everytime. Create a function in your app and print it out. F.e. on app start.


1 Answers

If you are going to create a pre-populated sqlite file to be used with Core Data then you must create it with Core Data. It is trivial to create a basic desktop application for data entry and use that to create the file and then embed it in your iOS device.

Do not attempt to duplicate the data structure or linkage within the file by hand. You might get it to work but you will spend way more time trying to get it to work and it is going to eventually fail. The internal structure of a Core Data sqlite file should be considered like a private API. The structure is not public and can change without notice.

like image 180
Marcus S. Zarra Avatar answered Oct 04 '22 04:10

Marcus S. Zarra