diff --git a/src/include/duckdb/main/client_context.hpp b/src/include/duckdb/main/client_context.hpp index 96c470303f3..f00044cf5cd 100644 --- a/src/include/duckdb/main/client_context.hpp +++ b/src/include/duckdb/main/client_context.hpp @@ -105,6 +105,9 @@ class ClientContext { void RegisterAppender(Appender *appender); void RemoveAppender(Appender *appender); + //! Overloading and Instantiating a private function to turn it public without a template type + void RunFunctionInTransaction(std::function &fun); + private: //! Perform aggressive query verification of a SELECT statement. Only called when query_verification_enabled is //! true. diff --git a/src/main/client_context.cpp b/src/main/client_context.cpp index 2974387ed56..00d825731a3 100644 --- a/src/main/client_context.cpp +++ b/src/main/client_context.cpp @@ -618,6 +618,10 @@ string ClientContext::VerifyQuery(string query, unique_ptr stateme return ""; } +void ClientContext::RunFunctionInTransaction(std::function &fun) { + RunFunctionInTransaction(std::move(fun)); +} + template void ClientContext::RunFunctionInTransaction(T &&fun) { lock_guard client_guard(context_lock); if (is_invalidated) {