Search code examples
sqlitemac-app-storereadonlysandbox

Mac App Store sandboxing and read-only SQLite DB in .APP bundle


I'm working on Mac App Store sandboxing but have an app that was rejected from the store based on detected read/write access to an SQLite database file located in my .APP bundle. However, I only need read access to this file, so the .APP bundle is a good location. I'm using FMDB, which by default opens SQLite databases using sqlite3_open unless you call FMDB's openWithFlags: method, which instead calls sqlite3_open_v2 using the flags parameter.

My question: If I use sqlite3_open_v2 with the SQLITE_OPEN_READONLY flag, is it equivalent to file system read-only access? If read-only access to the database means something different than file system read-only access, then the app will be rejected again. The SQLite documentation for SQLITE_OPEN_READONLY states (http://www.sqlite.org/c3ref/open.html):

"The database is opened in read-only mode. If the database does not already exist, an error is returned."

But, this doesn't seem to answer my question.


Solution

  • I submitted my app with the SQLITE_READ_ONLY flag, and the app was accepted to the App Store. This leads me to believe that the SQLITE_OPEN-READONLY flag is equivalent to file system read-only mode.