places::import::ios::history

Function import

source
pub fn import(
    conn: &PlacesDb,
    path: impl AsRef<Path>,
    last_sync_timestamp: i64,
) -> Result<HistoryMigrationResult>
Expand description

This import is used for iOS users migrating from browser.db-based history storage to the new rust-places store.

The goal of this import is to persist all local browser.db items into places database

§Basic process

  • Attach the iOS database.
  • Slurp records into a temp table “iOSHistoryStaging” from iOS database.
    • This is mostly done for convenience, to punycode the URLs and some performance benefits over using a view or reading things into Rust
  • Add any entries to moz_places that are needed (in practice, most are needed, users in practice don’t have nearly as many bookmarks as history entries)
  • Use iosHistoryStaging and the browser.db to migrate visits to the places visits table.
  • Update frecency for new items.
  • Cleanup (detach iOS database, etc).