If you haven't already, check out our contributing guidelines and patch guidelines for information on how to manage patches.
Patch Information
Library Name: react-native-nitro-sqlite
Library Version: 9.6.0
Patch Number: 001
Patch Description: store-database-outside-documents
Full Patch Filename: react-native-nitro-sqlite+9.6.0+001+store-database-outside-documents.patch
Patch Details
Reason for Patch
On iOS, the library stores SQLite databases in the app's Documents directory by default. With file sharing enabled (UIFileSharingEnabled / LSSupportsOpeningDocumentsInPlace), that directory is exposed to users through the Files app and Finder, making the Onyx database (OnyxDB.sqlite3 and its -wal/-shm journal files) visible, shareable, and deletable by users.
Changes Made
- Databases are stored in
Library/Application Support instead of Documents (persistent, backed up, never user-visible), creating the directory if it doesn't exist.
- On startup, database files created by older app versions (prefix
OnyxDB) are migrated out of Documents into Library/Application Support.
Upstream Status
Upstream PR/Issue: margelo/react-native-nitro-sqlite#289
Related Information
PR Introducing Patch: Stop exposing app data to the iOS Files app
Additional Notes
The patch as written isn't directly upstreamable because the migration hardcodes the OnyxDB filename prefix. The upstream issue proposes a generalized fix (Application Support by default with a generic migration, or a configurable base directory). If upstream adopts either, this patch can be removed — the app-specific migration would only need to remain until all installs have migrated off Documents.
Checklist
If you haven't already, check out our contributing guidelines and patch guidelines for information on how to manage patches.
Patch Information
Library Name: react-native-nitro-sqlite
Library Version: 9.6.0
Patch Number: 001
Patch Description: store-database-outside-documents
Full Patch Filename: react-native-nitro-sqlite+9.6.0+001+store-database-outside-documents.patch
Patch Details
Reason for Patch
On iOS, the library stores SQLite databases in the app's
Documentsdirectory by default. With file sharing enabled (UIFileSharingEnabled/LSSupportsOpeningDocumentsInPlace), that directory is exposed to users through the Files app and Finder, making the Onyx database (OnyxDB.sqlite3and its-wal/-shmjournal files) visible, shareable, and deletable by users.Changes Made
Library/Application Supportinstead ofDocuments(persistent, backed up, never user-visible), creating the directory if it doesn't exist.OnyxDB) are migrated out ofDocumentsintoLibrary/Application Support.Upstream Status
Upstream PR/Issue: margelo/react-native-nitro-sqlite#289
Related Information
PR Introducing Patch: Stop exposing app data to the iOS Files app
Additional Notes
The patch as written isn't directly upstreamable because the migration hardcodes the
OnyxDBfilename prefix. The upstream issue proposes a generalized fix (Application Support by default with a generic migration, or a configurable base directory). If upstream adopts either, this patch can be removed — the app-specific migration would only need to remain until all installs have migrated offDocuments.Checklist
details.mdfiledetails.mdfile