Creating .sqlite file from Core Data repository?

I have seen tutorials in books and on websites that offer .sqlite files for download. Sqlite files are used for master data.

How to get a .sqlite file from an application or master data store on my desktop?

+7
ios sqlite iphone core-data
source share
5 answers

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

Do not try to duplicate the data structure or link in the file manually. You can make it work, but you will spend more time trying to make it work, and this will ultimately fail. The internal sqlite structure of a Core Data file should be considered as a private API. The structure is not publicly available and is subject to change without notice.

+14
source share

If you are specifically trying to create a master data warehouse, you use this method:

NSPersistentStoreCoordinator addPersistentStoreWithType:(NSString*)storeType configuration:(NSString*)configuration URL:(NSString*)storeURL options:(NSDictionary*)options error:(NSError**)error 

You should already associate NSManagedObjectModel with your persistent warehouse coordinator object. If the store in storeURL does not exist, it will be created; otherwise it will be open.

+4
source share
+1
source share

I like to use this plugin for Firefox: https://addons.mozilla.org/en-US/firefox/addon/5817/

You can create a new .sqlite file, modify existing databases and view your data.

0
source share

There is a command line program downloaded from sqlite.org (in a standard download) that can be used to create an empty database with a schema. Typically, a database file is compatible between operating systems and devices.

0
source share

All Articles