0

I have a database with the db extension(file.db) I have to use in my iOS project. I have to read from it, not write anything in it.

My question is: can I use it like this, or does it have to have the extension .sqlite?(I have found examples with this one) My other question: do I have to use CoreData in my project in order to access this db database or is there no need for CoreData?

Thank you.

PS: any tutorial regarding using db databases in iOS Swift is welcomed. I have found many, but nothing exactly on this.

2
  • You have tagged the question with [sqlite]. Does that mean that "file.db" is a SQLite datebase? Commented Apr 6, 2017 at 7:52
  • You won't be able to use Core Data directly with your SQLite DB. Core Data requires a specific undocumented table structure, which your file won't match. I haven't used it in a while, but FMDB is a solid project for SQLite on iOS. Commented Apr 7, 2017 at 4:38

1 Answer 1

1

SQLite does not care about the file name. (But humans might.)

Core Data is a framework on top of SQLite, but you certainly can access the SQLite library directly. Whether to use Core Data or not depends on what API would fit your DB operations better.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.