33

One of the things I miss from moving from SQLite to Core Data is the ability to query directly against my database to analyze data. Is anyone out there aware of a tool that allows for the browsing of a Core Data store in a similar fashion?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Greg Martin
  • 5,074
  • 3
  • 34
  • 35
  • Isn't your core data store just a SQLite file? – Terry Wilcox Oct 22 '09 at 20:30
  • 1
    If you are using the SQL store type, yes it is, however, it does not reflect the structure you create when modeling your Core Data objects, if you peek into it with in SQL it will not make any sense. – Greg Martin Oct 22 '09 at 22:34

7 Answers7

14

CoreDataEditor is $20 and doesn't make it quick and easy to browse the relationships of the managed object context. There was also some insanity about having to have the MOM use exactly the same name as your application (??!), or somesuch. I'm not about to go in and start renaming stuff just to browse my object store. Admittedly, it does have a pretty cool application icon, and I assume from the name that you can edit stuff. But, like the original poster, I just need something that will let me crack open a Core Data persistent store and quickly grok my managed objects.

I've found that a much better solution, one which offers intuitive and easy browsing of the relationships of managed objects, and which is free, is detailed here:

Browsing Core Data databases using F-Script

You basically install F-Script, and then run Mr. Tyson's Applescript, which asks you to locate your MOM (e.g., YourApp.app) and then the SQLite database that is being used as the persistent store (i.e., YourAppPersistentStore.sqlite). If you are using the iPhone Simulator, these are both in your Simulator directory -- for example:

/Users/me/Library/Application\ Support/iPhone\ Simulator/4.2/Applications/5452AC87-0426-4303-9402-C5F5900C7321/YourApp.app
/Users/me/Library/Application\ Support/iPhone\ Simulator/4.2/Applications/5452AC87-0426-4303-9402-C5F5900C7321/Documents/db/YourAppPersistentStore.sqlite 

Then select an Entity and hit 'fetch'. You can run a NSPredicates to filter its items, or click on an item and click 'Browse'. It opens "F-Script Object Browser" and from this window, you can follow relationships and basically tour all the items in your entire managed object context, inspecting all the attributes for each item. It's super awesome.

Goffredo
  • 541
  • 4
  • 14
  • I suppose this just works for simulator, as you cannot reach the files on the device. It was too good to be true... :( – Duck Sep 07 '11 at 03:35
  • If you store your sqlite files within the app bundle Documents folder, you can copy them from the device using iTunes. Not perfect, but it works. - (NSURL *)applicationDocumentsDirectory { return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; } – Jason McDermott Apr 22 '14 at 09:00
  • Working for me, this is the build history to download the app: https://github.com/yepher/CoreDataUtility/wiki – xarly Jan 05 '15 at 16:47
9

CoreDataPro lets you explore your data model and view data that your application has stored. You can download it from the project page on github:

https://github.com/yepher/CoreDataUtility

MagerValp
  • 2,922
  • 1
  • 24
  • 27
Tomb
  • 91
  • 1
  • 1
  • 2
    Please avoid posting link-only answers. Post some code here, clarify your answer use links only as reference. – Wh1T3h4Ck5 Oct 11 '12 at 18:40
  • Welcome to StackOverflow! Please explain more about the tool, just in case the link is broken sometime in the future. – Zoot Oct 11 '12 at 18:41
  • If you are the author of this solution (you have its address set as your website) you must disclose your affiliation in your answers. Please read the FAQ: http://stackoverflow.com/faq#promotion – Piotr Sobiegraj Oct 11 '12 at 18:45
6

Possible duplicate of question Viewer/Query Analyzer for SQLite databases.

For what it's worth, I tried quite a few of the various SQLite browser tools, both free and paid for. I wouldn't mind paying for something great, but to be honest the gap between the free SQLite Database Browser and the paid for apps - some of which were relatively pricey - was minimal.

So I went with SQLite Database Browser. Here's the web site for download

If there was a great paid for app that was reasonably priced, I'd definitely buy it. Something like SQL Navigator, although that said SQL Navigator's UI was ridiculously bloated with features.

Core Data Editor isn't one I've heard of so I'm going to check it out as well.

Community
  • 1
  • 1
Max MacLeod
  • 26,115
  • 13
  • 104
  • 132
  • three vote downs and no comments provided. Please if you could provide rational that would be helpful for improvement. – Max MacLeod Jun 27 '11 at 08:38
  • you may have been voted down because the original question was about browsing Core Data stores in Mac OS environments, whereas your answer seems to be Windows-centric. Still, if that was the only reason, 3 votes down is still a bit harsh because I was still able to follow your second link and get the SQLite Database Browser for my Mac development purposes. I'm voting your answer back up one. – stifin Jul 21 '11 at 18:26
  • SQLite Database Browser is not totally there. You cannot see the relationships in a clear manner. – Duck Sep 07 '11 at 03:39
  • true. Also it crashes sometimes too. Is there a better tool you'd recommend? – Max MacLeod Sep 11 '11 at 18:03
2

I ended up using SQLPro for SQLite (https://www.sqlitepro.com/) Even free version is enough for development (in full version you get inline editing etc.)

  • pros - can make sql queries
  • cons - doesn't show relationships

Also recommend Simpholders app (http://simpholders.com/) it opens finder with db.sql file containing folder

keith
  • 228
  • 2
  • 8
2

MesaSQLLite - all i wanted was to view some data. This did it, nice and easy.

bandejapaisa
  • 26,576
  • 13
  • 94
  • 112
  • Also what I was looking for. Would +1 for a link: [Desert Sand Software](http://www.desertsandsoftware.com/) - [MesaSQLite](http://www.desertsandsoftware.com/wordpress/?page_id=17) – kball Mar 21 '13 at 20:38
  • Yup, that's the one. I still use it. Great tool – bandejapaisa Mar 22 '13 at 14:16
1

If your using SQLite as a backend, you can try my app SQLite Professional (App Store).

The app has a few neat features such as:

  • Auto-completion and syntax highlighting.
  • Versions Integration (rollback to previous versions).
  • Inline data filtering.
  • The ability to load sqlite extensions.
  • SQLite 2 Compatibility.
  • Exporting options to CSV, JSON, XML and MySQL.
  • Importing from CSV, JSON or XML.
  • Column reordering.
  • Full screen support.

There is a seven day trial available via the website and a free readonly version available on the mac app store.

Kyle
  • 17,317
  • 32
  • 140
  • 246
0

There is a similar topic here How view data stored in Core Data?

I have already added a comment where I say I created a macOS app to browse your Core Data content. It hides Core Data implementation as you see when you use a SQLite browser. Also you can list all your latest run apps and simulators, with this you can easily find the app you are looking for. More info here:

http://www.microedition.biz/simMagnifier

It has other features like access Simulator's folders such as Documents, Application Support, etc. You can check the content of NSUserDefaults too.

The app is not free sorry! but at least you have a 7 days trial.

Community
  • 1
  • 1