//=====================================================================
bool SQLiteTreeHandler::Open(bool writable)
{
- // std::cout << "***> SQLiteTreeHandler::Open('"<<GetFileName()<<"')"<<std::endl;
+
+ //sqlite3_exec(mDB, "PRAGMA synchronous=OFF ", NULL, 0, &errMsg);
SetWritable(writable);
return DBOpen();
}
//=====================================================================
int SQLiteTreeHandler::LoadChildren(tree::Node* parent, int maxlevel)
- {
+ {
+ //mDB->execDML("PRAGMA synchronous=ON ");
if (parent==0) parent = GetTree().GetTree();
return DBLoadChildren(parent,maxlevel);
}
try
{
mDB->open(GetFileName().c_str());
+ mDB->execDML("pragma synchronous=off;");
}
catch (CppSQLite3Exception& e)
{
<< e.errorMessage() <<std::endl);
return false;
}
-
+ mDB->execDML("pragma synchronous=off;");
// CREATING TABLES
sql += " SET ";
sql += key;
sql += " = '";
- sql += value;
+ sql += convert(value);
sql += "' WHERE ID = '";
sql += n->GetAttribute("ID");
sql +="'";
out<<"commit transaction;";
UPDATEDB(out.str());
}
+ const std::string SQLiteTreeHandler::convert(const std::string &i_word)
+ {
+ std::string temp = i_word;
+ boost::algorithm::replace_all(temp,"'","''");
+ return temp.c_str();
+ }
} // namespace creaImageIO