Capacitor SQLite plugin in-place migration persistence across version upgrade
0 reputation · 08 Jan 2023, 20:18 UTC
Goal is to migrate a small Capacitor application to a newer SQLite plugin release while keeping the existing database intact and avoiding startup interruption.
The documented feature set includes automatic in-place migration scripts on plugin initialization, createFromLocation for pre-populated databases, appDataDirectory configuration in capacitor.config.json for storage location, and ensurePluginConfig for schema compatibility validation. Native bridge behavior for file locking differs between iOS and Android, and migration behavior is reported to vary between Capacitor 4.x and 5.x.
Uncertainty remains about the interaction of these controls during an upgrade.
Does ensurePluginConfig block app startup until validation completes, and is it guaranteed to run before the first query? How does appDataDirectory continuity behave between Capacitor 4.x and 5.x for an existing database file? Is createFromLocation evaluated on upgrade or only on fresh install?