Documentation
¶
Overview ¶
Package dbmigrate provides tools for converting between plaintext SQLite and SQLCipher-encrypted databases.
SQLCipher support requires building with CGO and a SQLite library that includes SQLCipher (e.g., via system libsqlcipher). When built with the standard mattn/go-sqlite3 amalgamation, PRAGMA key is a no-op and encryption is unavailable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptToPlaintext ¶
DecryptToPlaintext converts a SQLCipher-encrypted DB back to a plaintext SQLite database.
func IsEncrypted ¶
IsEncrypted checks whether a database file is encrypted by inspecting the magic header. A standard SQLite file starts with "SQLite format 3\000"; an encrypted file does not.
func IsSQLCipherAvailable ¶
func IsSQLCipherAvailable() bool
IsSQLCipherAvailable checks whether the SQLite driver supports SQLCipher operations.
func MigrateToEncrypted ¶
MigrateToEncrypted converts a plaintext SQLite DB to a SQLCipher-encrypted database. The original file is backed up and securely deleted after successful migration.
Types ¶
This section is empty.