| 58 | } |
| 59 | |
| 60 | static uint64_t readStorageVersionFromHeader(const std::string& databasePath) { |
| 61 | auto localFileSystem = common::LocalFileSystem(""); |
| 62 | auto fileInfo = |
| 63 | localFileSystem.openFile(databasePath, common::FileOpenFlags(common::FileFlags::READ_ONLY)); |
| 64 | auto databaseHeader = DatabaseHeader::readDatabaseHeader(*fileInfo); |
| 65 | if (!databaseHeader.has_value()) { |
| 66 | throw TestException("Invalid database header: " + databasePath); |
| 67 | } |
| 68 | return databaseHeader->storageVersion; |
| 69 | } |
| 70 | |
| 71 | static void writeStorageVersionToHeader(const std::string& databasePath, uint64_t storageVersion) { |
| 72 | auto localFileSystem = common::LocalFileSystem(""); |
no test coverage detected