| 1352 | |
| 1353 | template <class MapType> |
| 1354 | void OMSFileStore::storeMapMetaData_(const MapType& features, |
| 1355 | const String& experiment_type) |
| 1356 | { |
| 1357 | createTable_("FEAT_MapMetaData", |
| 1358 | "unique_id INTEGER PRIMARY KEY, " \ |
| 1359 | "identifier TEXT, " \ |
| 1360 | "file_path TEXT, " \ |
| 1361 | "file_type TEXT, " |
| 1362 | "experiment_type TEXT"); // ConsensusMap only |
| 1363 | // @TODO: worth using a prepared query for just one insert? |
| 1364 | SQLite::Statement query(*db_, |
| 1365 | "INSERT INTO FEAT_MapMetaData VALUES (" \ |
| 1366 | ":unique_id, " \ |
| 1367 | ":identifier, " \ |
| 1368 | ":file_path, " \ |
| 1369 | ":file_type, " \ |
| 1370 | ":experiment_type)"); |
| 1371 | query.bind(":unique_id", int64_t(features.getUniqueId())); |
| 1372 | query.bind(":identifier", features.getIdentifier()); |
| 1373 | query.bind(":file_path", features.getLoadedFilePath()); |
| 1374 | String file_type = FileTypes::typeToName(features.getLoadedFileType()); |
| 1375 | query.bind(":file_type", file_type); |
| 1376 | if (!experiment_type.empty()) |
| 1377 | { |
| 1378 | query.bind(":experiment_type", experiment_type); |
| 1379 | } |
| 1380 | |
| 1381 | execWithExceptionAndReset(query, 1, __LINE__, OPENMS_PRETTY_FUNCTION, "error inserting data"); |
| 1382 | |
| 1383 | if (!features.isMetaEmpty()) |
| 1384 | { |
| 1385 | createTableMetaInfo_("FEAT_MapMetaData", "unique_id"); |
| 1386 | storeMetaInfo_(features, "FEAT_MapMetaData", int64_t(features.getUniqueId())); |
| 1387 | } |
| 1388 | } |
| 1389 | |
| 1390 | // template specializations: |
| 1391 | template void OMSFileStore::storeMapMetaData_<FeatureMap>(const FeatureMap&, const String&); |
nothing calls this directly
no test coverage detected