diff --git a/C/Cpp_include/c4Query.hh b/C/Cpp_include/c4Query.hh index bfae48e6b..cc6046d1b 100644 --- a/C/Cpp_include/c4Query.hh +++ b/C/Cpp_include/c4Query.hh @@ -18,6 +18,7 @@ #include #include #include +#include #include C4_ASSUME_NONNULL_BEGIN @@ -48,6 +49,7 @@ struct C4Query final slice columnTitle(unsigned col) const; alloc_slice explain() const; + const std::set& parameterNames() const noexcept; alloc_slice parameters() const noexcept; void setParameters(slice parameters); diff --git a/C/c4Query.cc b/C/c4Query.cc index f7c512ded..03840b691 100644 --- a/C/c4Query.cc +++ b/C/c4Query.cc @@ -64,6 +64,10 @@ alloc_slice C4Query::fullTextMatched(const C4FullTextMatch& term) { return _query->getMatchedText((Query::FullTextTerm&)term); } +const set& C4Query::parameterNames() const noexcept { + return _query->parameterNames(); +} + alloc_slice C4Query::parameters() const noexcept { LOCK(_mutex); return _parameters; diff --git a/LiteCore/Query/Query.hh b/LiteCore/Query/Query.hh index e3b1ce1e9..09d7970d4 100644 --- a/LiteCore/Query/Query.hh +++ b/LiteCore/Query/Query.hh @@ -15,6 +15,7 @@ #include "Error.hh" #include "Logging.hh" #include +#include #include #include @@ -56,6 +57,8 @@ namespace litecore { virtual const std::vector& columnTitles() const noexcept = 0; + virtual const std::set& parameterNames() const noexcept = 0; + virtual alloc_slice getMatchedText(const FullTextTerm&) = 0; virtual std::string explain() = 0; diff --git a/LiteCore/Query/SQLiteQuery.cc b/LiteCore/Query/SQLiteQuery.cc index 131dff2ca..ec82c746c 100644 --- a/LiteCore/Query/SQLiteQuery.cc +++ b/LiteCore/Query/SQLiteQuery.cc @@ -171,6 +171,8 @@ namespace litecore { const vector& columnTitles() const noexcept override { return _columnTitles; } + const set& parameterNames() const noexcept override {return _parameters;} + string explain() override { stringstream result; // https://www.sqlite.org/eqp.html