You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS: databases are stored in the Documents directory, which can be exposed to users via the Files app #289
The Documents directory is exposed to users via the Files app (and iTunes/Finder file sharing) whenever the app enables UIFileSharingEnabled + LSSupportsOpeningDocumentsInPlace. That means users can see, share, modify, or delete the raw SQLite database (and its -wal/-shm journals) from outside the app — which is both a data-integrity and a data-exposure problem.
Apple's File System Programming Guide is explicit that Documents is for user-visible documents, while app-internal data files belong in Library/Application Support (persistent, backed up, never user-visible).
Proposal
Store databases in Library/Application Support instead of Documents, and migrate existing databases out of Documents so current users don't lose data.
At Expensify we hit this in production and currently ship a patch that does exactly this (including a careful migration that moves the database together with its -wal/-shm files, and falls back to the old location if the move fails): Expensify/App#96531
Activity
feat(ios): store databases in Application Support safely (#324)
chrispader commentedon Sep 17, 2026
@NicolasBonet your changes have been published in
v9.8.0.I've already created a PR that updates NitroSQLite to the latest version in Expensify:
This release also includes some other major changes that are going to improve performance in Expensify and let us remove more patches there!
feat(ios): add option to store databases in Library/Application Suppo…