feat(android): implement Phase 1.1 SQLite database sharing with WAL mode

- Add DailyNotificationDatabase.java with three-table schema and WAL configuration
- Add DailyNotificationMigration.java for SharedPreferences to SQLite migration
- Add DailyNotificationDatabaseTest.java with comprehensive unit tests
- Add ConfigureOptions interface with dbPath, storage mode, and TTL settings
- Add configure() method to DailyNotificationPlugin interface
- Update Android plugin with SQLite integration and automatic migration
- Update web implementations to implement new configure() method
- Add phase1-sqlite-usage.ts example demonstrating shared storage configuration

This implements the critical Phase 1.1 gate for shared SQLite storage:
- App and plugin can open the same SQLite file with WAL mode
- Automatic migration from SharedPreferences preserves existing data
- Schema version checking prevents compatibility issues
- Concurrent reads during background writes enabled
- Configuration API supports both shared and tiered storage modes

Files: 8 changed, 1204 insertions(+)
This commit is contained in:
Matthew Raymer
2025-09-08 09:49:08 +00:00
parent 3a181632d1
commit 489dd4ac28
8 changed files with 1204 additions and 0 deletions

View File

@@ -153,6 +153,15 @@ export interface SchedulingConfig {
timezone: string;
}
export interface ConfigureOptions {
dbPath?: string;
storage?: 'shared' | 'tiered';
ttlSeconds?: number;
prefetchLeadMinutes?: number;
maxNotificationsPerDay?: number;
retentionDays?: number;
}
// Dual Scheduling System Interfaces
export interface ContentFetchConfig {
enabled: boolean;
@@ -248,6 +257,9 @@ export interface DualScheduleStatus {
// Enhanced DailyNotificationPlugin interface with dual scheduling
export interface DailyNotificationPlugin {
// Configuration methods
configure(options: ConfigureOptions): Promise<void>;
// Existing methods
scheduleDailyNotification(options: NotificationOptions | ScheduleOptions): Promise<void>;
getLastNotification(): Promise<NotificationResponse | null>;