Overview
Simple Manager Mobile uses SQLite as its local database, providing offline-first data storage through the Expo SQLite library.Database Configuration
The database is initialized using Expo SQLite with a synchronous connection:Database Details
string
simple_manager.dbstring
Local device storage managed by Expo SQLite
string
Synchronous connection using
openDatabaseSync()Schema
The database contains a single primary table for storing records:Records Table
Usage
Once the database connection is established, you can use it throughout your application:Key Features
Offline-First
All data is stored locally on the device, allowing the app to function without an internet connection.Synchronous Operations
UsingopenDatabaseSync() provides a simpler API for database operations without dealing with promises or callbacks.
Soft Deletes
Records are not permanently deleted but marked withisDeleted = 1, enabling data recovery and audit trails.
Flexible Metadata
Themetadata TEXT field allows storing JSON or other structured data for extensibility.
Best Practices
- Use parameterized queries: Always use placeholders (
?) to prevent SQL injection - Handle errors: Wrap database operations in try-catch blocks
- Maintain indexes: Consider adding indexes for frequently queried fields
- Backup data: Implement backup strategies for important user data
- Migration strategy: Plan for schema changes in future versions