Skip to content

Commit

Permalink
fix: sqlite (#1750)
Browse files Browse the repository at this point in the history
Co-authored-by: vansangpfiev <[email protected]>
  • Loading branch information
vansangpfiev and sangjanai authored Nov 29, 2024
1 parent 9622b91 commit 6457a10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion engine/migrations/migration_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ cpp::result<bool, std::string> MigrationHelper::BackupDatabase(
try {
SQLite::Database src_db(src_db_path, SQLite::OPEN_READONLY);
sqlite3* backup_db;

#if defined(_WIN32)
if (sqlite3_open16(backup_db_path.c_str(), &backup_db) != SQLITE_OK) {
throw std::runtime_error("Failed to open backup database");
}
#else
if (sqlite3_open(backup_db_path.c_str(), &backup_db) != SQLITE_OK) {
throw std::runtime_error("Failed to open backup database");
}
#endif

sqlite3_backup* backup =
sqlite3_backup_init(backup_db, "main", src_db.getHandle(), "main");
Expand Down

0 comments on commit 6457a10

Please sign in to comment.