diff OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp @ 5762:d52b3f394f69 find-refactoring

FormatLimits (SQLServer needs custom code)
author Alain Mazy <am@orthanc.team>
date Fri, 06 Sep 2024 16:04:18 +0200
parents ca06dde85358
children 093a8693ba16
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp	Fri Sep 06 15:21:54 2024 +0200
+++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp	Fri Sep 06 16:04:18 2024 +0200
@@ -65,6 +65,21 @@
       return "ESCAPE '\\'";
     }
 
+    virtual std::string FormatLimits(uint64_t since, uint64_t count) ORTHANC_OVERRIDE
+    {
+      std::string sql;
+      if (count > 0)
+      {
+        sql += " LIMIT " + boost::lexical_cast<std::string>(count);
+      }
+      if (since > 0)
+      {
+        sql += " OFFSET " + boost::lexical_cast<std::string>(since);
+      }
+      
+      return sql;
+    }
+
     virtual bool IsEscapeBrackets() const ORTHANC_OVERRIDE
     {
       return false;