X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdbsetup.cpp;fp=src%2Fdbsetup.cpp;h=2e0a460ea7824065a3fe9d72cd34d502b3243ac5;hb=278ee758050cb7772cd95946688c5b40104f4d8b;hp=2eb5403a23e2a764a941b5b75ca309e374e017d6;hpb=dabd19d7f764b8275c9c8370c7b89675b6a78243;p=fms.git diff --git a/src/dbsetup.cpp b/src/dbsetup.cpp index 2eb5403..2e0a460 100644 --- a/src/dbsetup.cpp +++ b/src/dbsetup.cpp @@ -549,3 +549,27 @@ void SetupDB() db->Execute("ANALYZE;"); } + +const bool VerifyDB() +{ + SQLite3DB::DB *db=SQLite3DB::DB::Instance(); + SQLite3DB::Statement st=db->Prepare("PRAGMA integrity_check;"); + st.Step(); + if(st.RowReturned()) + { + std::string res=""; + st.ResultText(0,res); + if(res=="ok") + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } +}