Better sqlite3_open error reporting.

This commit is contained in:
Miroslav Bendík 2012-09-01 12:19:33 +02:00
parent e2a818d49f
commit cb65bbbc4c
1 changed files with 2 additions and 1 deletions

View File

@ -252,7 +252,8 @@ void TileGenerator::generate(const std::string &input, const std::string &output
void TileGenerator::openDb(const std::string &input)
{
string db_name = input + "map.sqlite";
if (sqlite3_open(db_name.c_str(), &m_db) != SQLITE_OK) {
if (sqlite3_open_v2(db_name.c_str(), &m_db, SQLITE_OPEN_READONLY | SQLITE_OPEN_PRIVATECACHE, 0) != SQLITE_OK) {
std::cerr << sqlite3_errmsg(m_db) << ", Database file: " << db_name << std::endl;
throw DbError();
}
}