# iOS: SQLITE\_OPEN\_FILEPROTECTION\_NONE

**URL:** <https://discuss.zetetic.net/t/ios-sqlite-open-fileprotection-none/6692>\
**Category:** SQLCipher\
**Created:** [October 15, 2024, 9:36am UTC](https://discuss.zetetic.net/t/ios-sqlite-open-fileprotection-none/6692 "2024-10-15T09:36:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![julien.roger](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@julien.roger](https://discuss.zetetic.net/u/julien.roger)\
**Post date:** [October 15, 2024, 9:36am UTC](https://discuss.zetetic.net/t/ios-sqlite-open-fileprotection-none/6692/1 "2024-10-15T09:36:52Z")

</div>

This flag SQLITE\_OPEN\_FILEPROTECTION\_NONE which is available in iOS SDK, is not available with SQLite and SQLCipher.

Does it mean that when using SQLCipher we might suffer of issues when trying to open/read/write to database when app is in background and iPhone is locked?

---

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [October 15, 2024, 9:10pm UTC](https://discuss.zetetic.net/t/ios-sqlite-open-fileprotection-none/6692/2 "2024-10-15T21:10:45Z")

</div>

Hi @julien.roger – That’s correct, the file protection flags are specific to the Apple variant of SQLite. When creating files, unless otherwise specified, the [default of NSFileProtectionCompleteUntilFirstUserAuthentication](https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/encrypting_your_app_s_files/) is generally appropriate. Once the user authenticates to the device after boot, the app can maintain access to databases, even when backgrounded or when the device is locked.
