comparison OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp @ 5757:5463c3ae3235 large-queries

refactored extended /changes
author Alain Mazy <am@orthanc.team>
date Thu, 05 Sep 2024 18:21:56 +0200
parents 3765085693e5
children ca06dde85358
comparison
equal deleted inserted replaced
5663:3765085693e5 5757:5463c3ae3235
555 virtual void GetChanges(std::list<ServerIndexChange>& target /*out*/, 555 virtual void GetChanges(std::list<ServerIndexChange>& target /*out*/,
556 bool& done /*out*/, 556 bool& done /*out*/,
557 int64_t since, 557 int64_t since,
558 uint32_t limit) ORTHANC_OVERRIDE 558 uint32_t limit) ORTHANC_OVERRIDE
559 { 559 {
560 GetChanges2(target, done, since, -1, limit, ChangeType_INTERNAL_All); 560 GetChangesExtended(target, done, since, -1, limit, ChangeType_INTERNAL_All);
561 } 561 }
562 562
563 virtual void GetChanges2(std::list<ServerIndexChange>& target /*out*/, 563 virtual void GetChangesExtended(std::list<ServerIndexChange>& target /*out*/,
564 bool& done /*out*/, 564 bool& done /*out*/,
565 int64_t since, 565 int64_t since,
566 int64_t to, 566 int64_t to,
567 uint32_t limit, 567 uint32_t limit,
568 ChangeType filterType) ORTHANC_OVERRIDE 568 ChangeType filterType) ORTHANC_OVERRIDE
569 { 569 {
570 std::vector<std::string> filters; 570 std::vector<std::string> filters;
571 bool hasSince = false; 571 bool hasSince = false;
572 bool hasTo = false; 572 bool hasTo = false;
573 bool hasFilterType = false; 573 bool hasFilterType = false;
1408 version_(0) 1408 version_(0)
1409 { 1409 {
1410 // TODO: implement revisions in SQLite 1410 // TODO: implement revisions in SQLite
1411 dbCapabilities_.SetFlushToDisk(true); 1411 dbCapabilities_.SetFlushToDisk(true);
1412 dbCapabilities_.SetLabelsSupport(true); 1412 dbCapabilities_.SetLabelsSupport(true);
1413 dbCapabilities_.SetHasExtendedApiV1(true); 1413 dbCapabilities_.SetHasExtendedChanges(true);
1414 db_.Open(path); 1414 db_.Open(path);
1415 } 1415 }
1416 1416
1417 1417
1418 SQLiteDatabaseWrapper::SQLiteDatabaseWrapper() : 1418 SQLiteDatabaseWrapper::SQLiteDatabaseWrapper() :
1421 version_(0) 1421 version_(0)
1422 { 1422 {
1423 // TODO: implement revisions in SQLite 1423 // TODO: implement revisions in SQLite
1424 dbCapabilities_.SetFlushToDisk(true); 1424 dbCapabilities_.SetFlushToDisk(true);
1425 dbCapabilities_.SetLabelsSupport(true); 1425 dbCapabilities_.SetLabelsSupport(true);
1426 dbCapabilities_.SetHasExtendedApiV1(true); 1426 dbCapabilities_.SetHasExtendedChanges(true);
1427 db_.OpenInMemory(); 1427 db_.OpenInMemory();
1428 } 1428 }
1429 1429
1430 SQLiteDatabaseWrapper::~SQLiteDatabaseWrapper() 1430 SQLiteDatabaseWrapper::~SQLiteDatabaseWrapper()
1431 { 1431 {