Database
PocketSyncDatabase
PocketSyncDatabase is a wrapper around SQLite database that provides a simple and efficient way to store and sync data across devices.
PocketSyncDatabase is initialized with PocketSync instance. You can access it via PocketSync.instance.database
.
Database Options
PocketSyncDatabase requires configuration options to properly initialize and manage your SQLite database.
Parameter | Description | Required | Default |
---|---|---|---|
version | The database version number | No | 1 |
dbPath | Path to the SQLite database file | Yes | - |
onCreate | Callback function called when database is first created | Yes | - |
onConfigure | Callback function to configure the database | No | null |
onUpgrade | Callback function to handle database version upgrades | No | null |
onDowngrade | Callback function to handle database version downgrades | No | null |
onOpen | Callback function called when database is opened | No | null |