Home > Software design >  What is the difference between .clone and .backup commands in SQLite?
What is the difference between .clone and .backup commands in SQLite?

Time:01-11

As far as I can tell both commands create a clone of the db in SQLite format in the end, so why are there two commands to do this?

CodePudding user response:

.backup uses the SQLite Backup API to create a clone atomically, even if the database is in use.

.clone copies the database by just running SQL commands. As far as I can tell, no transactions are done on the source database when doing the clone, so it has a chance of getting partially updated data mid way through the clone.

  •  Tags:  
  • Related