Embedded Replicas
You can work with embedded replicas that can sync from the remote database to a local SQLite file, and delegate writes to the remote primary database:Embedded Replicas only works where you have access to the file system.
Periodic Sync
You can automatically sync at intervals by passing time in seconds to thesync_interval
option. For example, to sync every minute, you can use the following code:
Manual Sync
TheSync
function allows you to sync manually the local database with the remote counterpart:
Encryption
To enable encryption on a SQLite file, pass the encryption secret to theencryption_key
option:
Encrypted databases appear as raw data and cannot be read as standard SQLite databases. You must use the libSQL client for any operations — learn more.