Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Turning public the ClientContext::RunFunctionInTransaction.
  • Loading branch information
tiagokepe committed Jul 6, 2020
1 parent 5112064 commit 1a1276c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/include/duckdb/main/client_context.hpp
Expand Up @@ -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<void()> &fun);

private:
//! Perform aggressive query verification of a SELECT statement. Only called when query_verification_enabled is
//! true.
Expand Down
4 changes: 4 additions & 0 deletions src/main/client_context.cpp
Expand Up @@ -618,6 +618,10 @@ string ClientContext::VerifyQuery(string query, unique_ptr<SQLStatement> stateme
return "";
}

void ClientContext::RunFunctionInTransaction(std::function<void()> &fun) {
RunFunctionInTransaction(std::move(fun));
}

template <class T> void ClientContext::RunFunctionInTransaction(T &&fun) {
lock_guard<mutex> client_guard(context_lock);
if (is_invalidated) {
Expand Down

0 comments on commit 1a1276c

Please sign in to comment.