| 270 | } |
| 271 | |
| 272 | void SqlFile_Impl::createIndexes() { |
| 273 | if (m_connectionOpen) { |
| 274 | try { |
| 275 | execAndThrowOnError("CREATE INDEX IF NOT EXISTS rddMTR ON ReportDataDictionary (IsMeter);"); |
| 276 | } catch (const std::runtime_error& e) { |
| 277 | LOG(Trace, "Error adding index: " + std::string(e.what())); |
| 278 | } |
| 279 | |
| 280 | try { |
| 281 | execAndThrowOnError("CREATE INDEX IF NOT EXISTS redRD ON ReportExtendedData (ReportDataIndex);"); |
| 282 | } catch (const std::runtime_error& e) { |
| 283 | LOG(Trace, "Error adding index: " + std::string(e.what())); |
| 284 | } |
| 285 | |
| 286 | try { |
| 287 | execAndThrowOnError("CREATE INDEX IF NOT EXISTS rdTI ON ReportData (TimeIndex ASC);"); |
| 288 | } catch (const std::runtime_error& e) { |
| 289 | LOG(Trace, "Error adding index: " + std::string(e.what())); |
| 290 | } |
| 291 | |
| 292 | try { |
| 293 | execAndThrowOnError("CREATE INDEX IF NOT EXISTS rdDI ON ReportData (ReportDataDictionaryIndex ASC);"); |
| 294 | } catch (const std::runtime_error& e) { |
| 295 | LOG(Trace, "Error adding index: " + std::string(e.what())); |
| 296 | } |
| 297 | |
| 298 | try { |
| 299 | execAndThrowOnError("CREATE INDEX IF NOT EXISTS dmhdHRI ON DaylightMapHourlyData (HourlyReportIndex ASC);"); |
| 300 | } catch (const std::runtime_error& e) { |
| 301 | LOG(Trace, "Error adding index: " + std::string(e.what())); |
| 302 | } |
| 303 | |
| 304 | try { |
| 305 | execAndThrowOnError("CREATE INDEX IF NOT EXISTS dmhrMNI ON DaylightMapHourlyReports (MapNumber);"); |
| 306 | } catch (const std::runtime_error& e) { |
| 307 | LOG(Trace, "Error adding index: " + std::string(e.what())); |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | SqlFile_Impl::~SqlFile_Impl() { |
| 313 | close(); |
no test coverage detected