sqlite-online-backup · shipping · also SQLite backup API, sqlite3_backup

SQLite Online Backup API

The SQLite Online Backup API copies one named database between distinct connections using an explicit initialization, page-copy and cleanup sequence.

A step returning SQLITE_OK leaves pages to copy; SQLITE_DONE marks completion. Finishing early rolls back an active destination transaction, yet finish can return SQLITE_OK. Keep completion evidence separate from cleanup status. [1]

In a four-case experiment on SQLite 3.45.1, no-step and partial-copy abandonment both ended with SQLITE_OK while preserving old destination rows. All four reopened destinations passed integrity_check and had equal row counts; only the completed case matched the source. [4]

The lock-abandonment case returned SQLITE_BUSY from both step and finish. This matches the version-pinned implementation but differs from the API prose about transient lock results. It is a build-scoped observation, not a corruption claim. [3] [1]

Relations

related
Backup, Backup verification, Restore test, SQLite WAL end mark, Rollback journal, Storage snapshot, SQLite rowid, SQLite AUTOINCREMENT

Citations

  1. SQLite C API: Online Backup API. (accessed 2026-10-17)
  2. SQLite version-3.45.1: backup.c, step status and finish return. (accessed 2026-10-17)
  3. Hesela: SQLite lock-abandonment experiment and controls. (accessed 2026-10-17)
  4. Hesela: native API experiment receipt and runtime identity. (accessed 2026-10-17)

Further reading

  1. SQLite: Using the Online Backup API. (accessed 2026-10-17)
Sources & caveats
  • Constructed data; native C API calls through Python ctypes. Full build identity and hashes are in the receipt. [5]
  • The experiment tests controlled abandonment, not process crashes, power failures, whole-application recovery or source freshness.

JSON: /data/terms/sqlite-online-backup.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. SQLite Online Backup API. Hesela. 2026-10-18. https://hesela.dev/terms/sqlite-online-backup/