views:

570

answers:

2

How can I export data from an sqlite3 database in Objective-c? Can I issue a dump command at least? What options do I have for exporting?

+1  A: 

I'm not aware of any built-in method for dumping a SQLite database in the sqlite api. However, I imagine you could probably cook something up to find all tables and their schemas, then SELECT * FROM each one and export it as a text file manually.

Ed Marty
+1  A: 

You can look into how the .dump command is implemented by the sqlite shell, to see how you can accomplish the same thing. In particular take a look at the dump_callback function and also the actions taken when the word dump is seen by the shell

Shell.c source code: dump_callback()

Brandon Bodnár