StringIdManager::StringIdManager() : Logger("StringIdManager") {
	databaseManager = ObjectDatabaseManager::instance();
	bool fill = databaseManager->getDatabaseID("strings") == 0xFFFF;

	stringsDatabase = databaseManager->loadLocalDatabase("strings", true);

	if (fill || ServerCore::truncateDatabases() || ServerCore::hasArgument("reloadstrings"))
		populateDatabase();

	ObjectDatabaseManager::instance()->commitLocalTransaction();

	//info("test string = " + getStringId(String("@city/city:city_expand_body").hashCode()).toString(), true);
}
void RialtoTest::createDatabase(pdal::PointTable& table,
                                pdal::PointViewPtr view,
                                const std::string& filename,
                                uint32_t maxLevel,
                                const std::string& tableName)
{
    assert(!FileUtils::fileExists(filename));
    {
        LogPtr log(new Log("rialtodbwritertest", "stdout"));
        GeoPackageManager db(filename, log);
        db.open();
        db.close();
    }
    assert(FileUtils::fileExists(filename));

    populateDatabase(table, view, filename, maxLevel, tableName);
}
Beispiel #3
0
QString MainWindow::validateDatabase()
{
	db = QSqlDatabase::addDatabase("QSQLITE");
	QString dbName = qApp->applicationDirPath() + QDir::separator() + "mileage.sql";
	db.setDatabaseName(dbName);

	if( !db.open() ) return QString("Could not open database %1\n%2\n%3")
		.arg(dbName)
		.arg(db.lastError().text())
		.arg(qApp->libraryPaths().join(";"));

	QStringList tables = db.tables(QSql::Tables);
	if( !tables.contains("Refuels") 
	 || !tables.contains("Crossings")
	 || !tables.contains("States") )
		return populateDatabase();

	// finish up
	return QString();
}