summaryrefslogtreecommitdiffhomepage
path: root/compiledsql.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-02 16:40:52 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-02 16:40:52 +0100
commit0851f92abcb1e9d84c2748607ff8d548b582540c (patch)
treeee5444bf96aab5bced27ba45cf5f5435c8346e5c /compiledsql.cpp
parent4ca6b48f8d0d9cb61995fec63dde95880ff37547 (diff)
Fix build on Debian11 (only supported OS)
Diffstat (limited to 'compiledsql.cpp')
-rw-r--r--compiledsql.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiledsql.cpp b/compiledsql.cpp
index a3503af..818ab35 100644
--- a/compiledsql.cpp
+++ b/compiledsql.cpp
@@ -1,5 +1,7 @@
#include "compiledsql.h"
+#include <boost/algorithm/string/predicate.hpp>
+
CompiledSQL::CompiledSQL(SQLite::Database& db):
m_stmt{},
m_db{db},
@@ -12,7 +14,13 @@ void CompiledSQL::init(const std::string& stmt)
if (m_stmt) {
m_stmt->reset();
} else {
- if (stmt.starts_with("SELECT ")) {
+ if (
+#if __cplusplus >= 202002
+ stmt.starts_with("SELECT ")
+#else
+ boost::algorithm::starts_with(stmt, "SELECT ")
+#endif
+ ) {
m_isSelect = true;
} else {
m_isSelect = false;