I need to include a sqlite database in my app (pre-made) and make changes further into it as the app is used. So my question is, is there any way to include a pre populated sqlite DB in the app's working environment and then use the native sqlite framework to edit/update/delete data from it ?
Some tutorial references for this will be appreciated.
-
What stops you for running a search?El Tomato– El Tomato2016年03月12日 22:39:33 +00:00Commented Mar 12, 2016 at 22:39
-
@ElTomato i already did. Not to waste time, can we get an answer ?Pulkit Sharma– Pulkit Sharma2016年03月13日 13:39:00 +00:00Commented Mar 13, 2016 at 13:39
-
Show us what you have done so far, then.El Tomato– El Tomato2016年03月13日 22:31:33 +00:00Commented Mar 13, 2016 at 22:31
2 Answers 2
I was looking for something like this Sqlite. Although it isn't upto the mark as i needed a tool or something for easily creating a large DB which i could later embed in my app. But still this tutorial does clear away some confusion.
P.S. there is a tool which you can use to view your DB. I don't believe we can edit a DB using it. Its called SQLite Client. Its available on the app store.
Comments
Yes, you can include pre-populated SQLite file in your app.
Steps to include sqlite
- Drag and drop the sqlite file(with the data) to the app bundle. Add the framework libsqlite3.dylib
- Using NSFileManager, copy the file to documents directory to modify the sqlite data.
- Then do your changes using sql queries.
Refer this link for more details->Sqlite tutorial