uvco 0.1
Loading...
Searching...
No Matches
uvco::Pqxx Class Reference

#include <pqxx.h>

Collaboration diagram for uvco::Pqxx:

Public Member Functions

 Pqxx (const Loop &loop, std::string connectionString)
template<typename R, typename F>
requires WithTxFn<R, F>
Promise< R > withTx (F f)
void close ()

Private Attributes

const Looploop_
ThreadLocalKey< std::optional< pqxx::connection > > conn_
std::string connectionString_

Detailed Description

A thread-pool based implementation of PostgreSQL interactions using the libpqxx library.

Constructor & Destructor Documentation

◆ Pqxx()

uvco::Pqxx::Pqxx ( const Loop & loop,
std::string connectionString )
inlineexplicit
26 : loop_{loop}, connectionString_{std::move(connectionString)} {}
const Loop & loop_
Definition pqxx.h:43
std::string connectionString_
Definition pqxx.h:45

Member Function Documentation

◆ close()

void uvco::Pqxx::close ( )
inline

If you know that you're done with this thread's connection, you can close it. If needed, a new connection is established again later.

40{ conn_.del(); }
ThreadLocalKey< std::optional< pqxx::connection > > conn_
Definition pqxx.h:44

Member Data Documentation

◆ conn_

ThreadLocalKey<std::optional<pqxx::connection> > uvco::Pqxx::conn_
private

◆ connectionString_

std::string uvco::Pqxx::connectionString_
private

◆ loop_

const Loop& uvco::Pqxx::loop_
private

The documentation for this class was generated from the following file: