Sync a local replica with the primary database
mainDepending on how you initialized your connector, you may need to manage synchronization manually:
- Automatic Sync: If you used
libsql.NewEmbeddedReplicaConnectorWithAutoSync, the connector handles periodic updates from the primary instance automatically. - Manual Sync: If you used
libsql.NewEmbeddedReplicaConnector, you must trigger updates manually by calling theSyncmethod on the connector instance.
// For connectors created with NewEmbeddedReplicaConnector
err := connector.Sync()
if err != nil {
// handle error
}