comparison OrthancServer/DatabaseWrapperBase.cpp @ 1750:55d52567bebb db-changes

LookupResource implemented
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 27 Oct 2015 12:45:50 +0100
parents d143db00a794
children 318c2e83c2bd
comparison
equal deleted inserted replaced
1749:99f4a05f39fa 1750:55d52567bebb
531 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT SUM(uncompressedSize) FROM AttachedFiles"); 531 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT SUM(uncompressedSize) FROM AttachedFiles");
532 s.Run(); 532 s.Run();
533 return static_cast<uint64_t>(s.ColumnInt64(0)); 533 return static_cast<uint64_t>(s.ColumnInt64(0));
534 } 534 }
535 535
536 void DatabaseWrapperBase::GetAllInternalIds(std::list<int64_t>& target,
537 ResourceType resourceType)
538 {
539 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT internalId FROM Resources WHERE resourceType=?");
540 s.BindInt(0, resourceType);
541
542 target.clear();
543 while (s.Step())
544 {
545 target.push_back(s.ColumnInt64(0));
546 }
547 }
548
549
536 void DatabaseWrapperBase::GetAllPublicIds(std::list<std::string>& target, 550 void DatabaseWrapperBase::GetAllPublicIds(std::list<std::string>& target,
537 ResourceType resourceType) 551 ResourceType resourceType)
538 { 552 {
539 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT publicId FROM Resources WHERE resourceType=?"); 553 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT publicId FROM Resources WHERE resourceType=?");
540 s.BindInt(0, resourceType); 554 s.BindInt(0, resourceType);