Mercurial > hg > orthanc-databases
changeset 757:85ad4463ec58 pg-next-699
fix build of sqlite
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Tue, 18 Nov 2025 19:01:48 +0100 |
| parents | 97da5aa716a0 |
| children | 0a9a6f5b8157 |
| files | Framework/Plugins/DatabaseBackendAdapterV4.cpp Framework/Plugins/IDatabaseBackend.h Framework/Plugins/ISqlLookupFormatter.h Framework/Plugins/IndexBackend.cpp Framework/Plugins/IndexBackend.h Framework/Plugins/IndexUnitTests.h Framework/Plugins/MessagesToolbox.h SQLite/Plugins/SQLiteIndex.cpp SQLite/Plugins/SQLiteIndex.h |
| diffstat | 9 files changed, 31 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/Framework/Plugins/DatabaseBackendAdapterV4.cpp Tue Nov 18 18:37:45 2025 +0100 +++ b/Framework/Plugins/DatabaseBackendAdapterV4.cpp Tue Nov 18 19:01:48 2025 +0100 @@ -464,7 +464,7 @@ response.mutable_get_system_information()->set_supports_queues(accessor.GetBackend().HasQueues()); #endif -#if ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES == 1 +#if ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE == 1 response.mutable_get_system_information()->set_supports_reserve_queue_value(accessor.GetBackend().HasReserveQueueValue()); #endif @@ -1395,7 +1395,7 @@ #endif -#if ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES == 1 +#if ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE == 1 case Orthanc::DatabasePluginMessages::OPERATION_RESERVE_QUEUE_VALUE: { std::string value; @@ -1772,6 +1772,7 @@ (void) limit; (void) fromTsIsoFormat; (void) toTsIsoFormat; + (void) logDataInJson; } #endif
--- a/Framework/Plugins/IDatabaseBackend.h Tue Nov 18 18:37:45 2025 +0100 +++ b/Framework/Plugins/IDatabaseBackend.h Tue Nov 18 19:01:48 2025 +0100 @@ -527,7 +527,7 @@ const std::string& queueId) = 0; #endif -#if ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES == 1 +#if ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE == 1 virtual bool ReserveQueueValue(std::string& value, uint64_t& valueId, DatabaseManager& manager, @@ -538,7 +538,6 @@ virtual void AcknowledgeQueueValue(DatabaseManager& manager, const std::string& queueId, uint64_t valueId) = 0; - #endif #if ORTHANC_PLUGINS_HAS_ATTACHMENTS_CUSTOM_DATA == 1
--- a/Framework/Plugins/ISqlLookupFormatter.h Tue Nov 18 18:37:45 2025 +0100 +++ b/Framework/Plugins/ISqlLookupFormatter.h Tue Nov 18 19:01:48 2025 +0100 @@ -30,6 +30,7 @@ #pragma once +#include "../Common/Dictionary.h" #include "MessagesToolbox.h" #include <boost/noncopyable.hpp> @@ -79,6 +80,8 @@ virtual std::string FormatFloatCast() const = 0; + virtual const Dictionary& GetDictionary() const = 0; + static void GetLookupLevels(Orthanc::ResourceType& lowerLevel, Orthanc::ResourceType& upperLevel, const Orthanc::ResourceType& queryLevel,
--- a/Framework/Plugins/IndexBackend.cpp Tue Nov 18 18:37:45 2025 +0100 +++ b/Framework/Plugins/IndexBackend.cpp Tue Nov 18 19:01:48 2025 +0100 @@ -4573,7 +4573,7 @@ } #endif -#if ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES == 1 +#if ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE == 1 bool IndexBackend::ReserveQueueValue(std::string& value, uint64_t& valueId, DatabaseManager& manager, @@ -4825,4 +4825,8 @@ } #endif + ISqlLookupFormatter* IndexBackend::CreateLookupFormatter(Dialect dialect) + { + return new LookupFormatter(dialect); + } }
--- a/Framework/Plugins/IndexBackend.h Tue Nov 18 18:37:45 2025 +0100 +++ b/Framework/Plugins/IndexBackend.h Tue Nov 18 19:01:48 2025 +0100 @@ -39,7 +39,9 @@ class IndexBackend : public IDatabaseBackend { private: +#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 class LookupFormatter; +#endif OrthancPluginContext* context_; bool readOnly_; @@ -49,7 +51,6 @@ std::unique_ptr<IDatabaseBackendOutput::IFactory> outputFactory_; protected: - virtual void ClearDeletedFiles(DatabaseManager& manager); virtual void ClearDeletedResources(DatabaseManager& manager); @@ -503,7 +504,7 @@ #endif -#if ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES == 1 +#if ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE == 1 virtual bool ReserveQueueValue(std::string& value, uint64_t& valueId, DatabaseManager& manager, @@ -514,7 +515,6 @@ virtual void AcknowledgeQueueValue(DatabaseManager& manager, const std::string& queueId, uint64_t valueId) ORTHANC_OVERRIDE; - #endif #if ORTHANC_PLUGINS_HAS_ATTACHMENTS_CUSTOM_DATA == 1 @@ -525,7 +525,6 @@ virtual void SetAttachmentCustomData(DatabaseManager& manager, const std::string& attachmentUuid, const std::string& customData) ORTHANC_OVERRIDE; - #endif #if ORTHANC_PLUGINS_HAS_AUDIT_LOGS == 1 @@ -576,5 +575,9 @@ static DatabaseManager* CreateSingleDatabaseManager(IDatabaseBackend& backend, bool hasIdentifierTags, const std::list<IdentifierTag>& identifierTags); + +#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 + ISqlLookupFormatter* CreateLookupFormatter(Dialect dialect); +#endif }; }
--- a/Framework/Plugins/IndexUnitTests.h Tue Nov 18 18:37:45 2025 +0100 +++ b/Framework/Plugins/IndexUnitTests.h Tue Nov 18 19:01:48 2025 +0100 @@ -1066,7 +1066,7 @@ } #endif -#if ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES == 1 +#if ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE == 1 { manager->StartTransaction(TransactionType_ReadWrite);
--- a/Framework/Plugins/MessagesToolbox.h Tue Nov 18 18:37:45 2025 +0100 +++ b/Framework/Plugins/MessagesToolbox.h Tue Nov 18 19:01:48 2025 +0100 @@ -54,7 +54,7 @@ #define ORTHANC_PLUGINS_HAS_ATTACHMENTS_CUSTOM_DATA 0 #define ORTHANC_PLUGINS_HAS_KEY_VALUE_STORES 0 #define ORTHANC_PLUGINS_HAS_QUEUES 0 -#define ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES 0 +#define ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE 0 #define ORTHANC_PLUGINS_HAS_AUDIT_LOGS 0 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) @@ -78,8 +78,8 @@ #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 10) -# undef ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES -# define ORTHANC_PLUGINS_HAS_EXTENDED_QUEUES 1 +# undef ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE +# define ORTHANC_PLUGINS_HAS_RESERVE_QUEUE_VALUE 1 # endif #endif
--- a/SQLite/Plugins/SQLiteIndex.cpp Tue Nov 18 18:37:45 2025 +0100 +++ b/SQLite/Plugins/SQLiteIndex.cpp Tue Nov 18 19:01:48 2025 +0100 @@ -301,19 +301,18 @@ #endif #if ORTHANC_PLUGINS_HAS_QUEUES == 1 - - bool IndexBackend::DequeueValue(std::string& value, - DatabaseManager& manager, - const std::string& queueId, - bool fromFront) + bool SQLiteIndex::DequeueValue(std::string& value, + DatabaseManager& manager, + const std::string& queueId, + bool fromFront) { assert(manager.GetDialect() == Dialect_SQLite); - LookupFormatter formatter(manager.GetDialect()); + std::unique_ptr<ISqlLookupFormatter> formatter(CreateLookupFormatter(manager.GetDialect())); std::unique_ptr<DatabaseManager::CachedStatement> statement; - std::string queueIdParameter = formatter.GenerateParameter(queueId); + std::string queueIdParameter = formatter->GenerateParameter(queueId); if (fromFront) { @@ -328,7 +327,7 @@ "SELECT id, value FROM Queues WHERE queueId=" + queueIdParameter + " ORDER BY id DESC LIMIT 1")); } - statement->Execute(formatter.GetDictionary()); + statement->Execute(formatter->GetDictionary()); if (statement->IsDone()) {
--- a/SQLite/Plugins/SQLiteIndex.h Tue Nov 18 18:37:45 2025 +0100 +++ b/SQLite/Plugins/SQLiteIndex.h Tue Nov 18 19:01:48 2025 +0100 @@ -115,12 +115,10 @@ } #if ORTHANC_PLUGINS_HAS_QUEUES == 1 - -virtual bool DequeueValue(std::string& value, + virtual bool DequeueValue(std::string& value, DatabaseManager& manager, const std::string& queueId, bool fromFront) ORTHANC_OVERRIDE; - #endif }; }
