Settings::Settings() : threadpoolSize(1) { // Initiate the class based on Enviroment Variables setDBPath(getEnv("HYRISE_DB_PATH", "")); setScriptPath(getEnv("HYRISE_SCRIPT_PATH", "")); }
void OgrWriter::setConfiguration(const Settings& conf) { setCreateAllLayers(conf.getBool(createAllLayersKey(), false)); setScriptPath(conf.getString(scriptKey(), "")); setPrependLayerName(conf.getString(preLayerNameKey(), "")); _appendData = ConfigOptions(conf).getOgrAppendData(); QString strictStr = conf.getString(strictCheckingKey(), strictCheckingDefault()); if (strictStr == "on") { _strictChecking = StrictOn; } else if (strictStr == "off") { _strictChecking = StrictOff; } else if (strictStr == "warn") { _strictChecking = StrictWarn; } else { throw HootException("Error setting strict checking. Expected on/off/warn. got: " + strictStr); } }
void OgrWriter::setConfiguration(const Settings& conf) { ConfigOptions configOptions(conf); setCreateAllLayers(configOptions.getOgrWriterCreateAllLayers()); setScriptPath(configOptions.getOgrWriterScript()); setPrependLayerName(configOptions.getOgrWriterPreLayerName()); _appendData = configOptions.getOgrAppendData(); QString strictStr = configOptions.getOgrStrictChecking(); if (strictStr == "on") { _strictChecking = StrictOn; } else if (strictStr == "off") { _strictChecking = StrictOff; } else if (strictStr == "warn") { _strictChecking = StrictWarn; } else { throw HootException("Error setting strict checking. Expected on/off/warn. got: " + strictStr); } }
void Database::init(QString p_path, QString p_script, QString database_name) { setScriptPath(p_script); QSqlDatabase db = add(p_path, database_name); if (not QFileInfo(path()).exists()) createDatabase(); if (not db.open()) throw new ErrorOpeningDatabase(path()); //db.close(); }