stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.67k stars 1.56k forks source link

Backup, export, restore SQL database using AirDrop/Firebase #1274

Open nastasiupta opened 1 month ago

nastasiupta commented 1 month ago

SQLite.swift version: 0.15.3 XCode: 15.4 Swift Package manager

This might sound odd.. but I can't find a solution how to export an existing database from one phone to another, like backup & restore... The user can make daily backups of the database (sqlite file pushed to Firebase Storage or share to another iPhone using AirDrop), and restore any backups on a given type (download the file from Firebase Store and use it) but I'm facing some issues on how to do it...

nastasiupta commented 1 month ago

Also I tried to see use the sql export as I saw in the documentation

import SQLite
....
let db = try Connection("path/to/unencrypted.sqlite3")
try db.sqlcipher_export(.uri("encrypted.sqlite3"), key: "secret")

Cannot infer contextual base in reference to member 'uri' Value of type 'Connection' has no member 'sqlcipher_export'