stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.55k forks source link

Xcode is not recognizing a .db file when I try to access it in the Device's Documents folder #1111

Closed benvizy closed 2 years ago

benvizy commented 2 years ago

I am getting a "Code: 26 -- file is not a database" when I try to access my .db file within my project. All my queries work when I access this file via the absolute path to the file on my desktop, but when I try to bring the file into Xcode, be it in the Bundle.main or the Documents folder, it does not recognize the file as a database. When I use my terminal to open the file with my SQLite viewer, it opens just fine. So the file exists, it is a database, and SQLite.swift works when accessing the file outside of the Xcode project. How can I get it to recognize the .db file as a database when I load it onto the device?

See full StackOverflow inquiry here: https://stackoverflow.com/questions/71118325/how-do-i-make-xcode-realize-my-db-file-is-a-database-im-incorrectly-receiving

Mozahler commented 2 years ago

The StackOverflow question linked has an answer by the OP.

The posted answer: I literally just accidentally copied a file that referenced the database, rather than the database itself! Silly mistake, but it took me days to work out 😅

This can be closed.