relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
Loading...
Searching...
No Matches
relx::pgsql_async_wrapper::Connection Class Reference

#include <relx/connection/pgsql_async_wrapper.hpp>

Public Member Functions

 Connection (boost::asio::io_context &io)
 
 ~Connection ()
 
 Connection (const Connection &)=delete
 
Connectionoperator= (const Connection &)=delete
 
 Connection (Connection &&other) noexcept
 
Connectionoperator= (Connection &&other) noexcept
 
void close ()
 
bool is_open () const
 
bool in_transaction () const
 
PGconnnative_handle ()
 
PgResult< boost::asio::ip::tcp::socket * > socket ()
 
boost::asio::awaitable< PgResult< void > > connect (const std::string &conninfo)
 
boost::asio::awaitable< PgResult< Result > > query (const std::string &query_text, const std::vector< std::string > &params={})
 
boost::asio::awaitable< PgResult< void > > begin_transaction (IsolationLevel isolation=IsolationLevel::ReadCommitted)
 
boost::asio::awaitable< PgResult< void > > commit ()
 
boost::asio::awaitable< PgResult< void > > rollback ()
 
boost::asio::awaitable< PgResult< std::shared_ptr< PreparedStatement > > > prepare_statement (const std::string &name, const std::string &query_text)
 
PgResult< std::shared_ptr< PreparedStatement > > get_prepared_statement (const std::string &name)
 
boost::asio::awaitable< PgResult< Result > > execute_prepared (const std::string &name, const std::vector< std::string > &params={})
 
boost::asio::awaitable< PgResult< void > > deallocate_prepared (const std::string &name)
 
boost::asio::awaitable< PgResult< void > > deallocate_all_prepared ()
 

Friends

class PreparedStatement
 

Detailed Description

Definition at line 189 of file pgsql_async_wrapper.hpp.

Constructor & Destructor Documentation

◆ Connection() [1/3]

relx::pgsql_async_wrapper::Connection::Connection ( boost::asio::io_context &  io)
inline

Definition at line 279 of file pgsql_async_wrapper.hpp.

◆ ~Connection()

relx::pgsql_async_wrapper::Connection::~Connection ( )
inline

Definition at line 281 of file pgsql_async_wrapper.hpp.

◆ Connection() [2/3]

relx::pgsql_async_wrapper::Connection::Connection ( const Connection )
delete

◆ Connection() [3/3]

relx::pgsql_async_wrapper::Connection::Connection ( Connection &&  other)
inlinenoexcept

Definition at line 288 of file pgsql_async_wrapper.hpp.

Member Function Documentation

◆ begin_transaction()

boost::asio::awaitable< PgResult< void > > relx::pgsql_async_wrapper::Connection::begin_transaction ( IsolationLevel  isolation = IsolationLevel::ReadCommitted)
inline

Definition at line 472 of file pgsql_async_wrapper.hpp.

◆ close()

void relx::pgsql_async_wrapper::Connection::close ( )
inline

Definition at line 308 of file pgsql_async_wrapper.hpp.

◆ commit()

boost::asio::awaitable< PgResult< void > > relx::pgsql_async_wrapper::Connection::commit ( )
inline

Definition at line 511 of file pgsql_async_wrapper.hpp.

◆ connect()

boost::asio::awaitable< PgResult< void > > relx::pgsql_async_wrapper::Connection::connect ( const std::string &  conninfo)
inline

Definition at line 338 of file pgsql_async_wrapper.hpp.

◆ deallocate_all_prepared()

boost::asio::awaitable< PgResult< void > > relx::pgsql_async_wrapper::Connection::deallocate_all_prepared ( )
inline

Definition at line 630 of file pgsql_async_wrapper.hpp.

◆ deallocate_prepared()

boost::asio::awaitable< PgResult< void > > relx::pgsql_async_wrapper::Connection::deallocate_prepared ( const std::string &  name)
inline

Definition at line 614 of file pgsql_async_wrapper.hpp.

◆ execute_prepared()

boost::asio::awaitable< PgResult< Result > > relx::pgsql_async_wrapper::Connection::execute_prepared ( const std::string &  name,
const std::vector< std::string > &  params = {} 
)
inline

Definition at line 603 of file pgsql_async_wrapper.hpp.

◆ get_prepared_statement()

PgResult< std::shared_ptr< PreparedStatement > > relx::pgsql_async_wrapper::Connection::get_prepared_statement ( const std::string &  name)
inline

Definition at line 593 of file pgsql_async_wrapper.hpp.

◆ in_transaction()

bool relx::pgsql_async_wrapper::Connection::in_transaction ( ) const
inline

Definition at line 326 of file pgsql_async_wrapper.hpp.

◆ is_open()

bool relx::pgsql_async_wrapper::Connection::is_open ( ) const
inline

Definition at line 324 of file pgsql_async_wrapper.hpp.

◆ native_handle()

PGconn * relx::pgsql_async_wrapper::Connection::native_handle ( )
inline

Definition at line 328 of file pgsql_async_wrapper.hpp.

◆ operator=() [1/2]

Connection & relx::pgsql_async_wrapper::Connection::operator= ( Connection &&  other)
inlinenoexcept

Definition at line 295 of file pgsql_async_wrapper.hpp.

◆ operator=() [2/2]

Connection & relx::pgsql_async_wrapper::Connection::operator= ( const Connection )
delete

◆ prepare_statement()

boost::asio::awaitable< PgResult< std::shared_ptr< PreparedStatement > > > relx::pgsql_async_wrapper::Connection::prepare_statement ( const std::string &  name,
const std::string &  query_text 
)
inline

Definition at line 556 of file pgsql_async_wrapper.hpp.

◆ query()

boost::asio::awaitable< PgResult< Result > > relx::pgsql_async_wrapper::Connection::query ( const std::string &  query_text,
const std::vector< std::string > &  params = {} 
)
inline

Definition at line 433 of file pgsql_async_wrapper.hpp.

◆ rollback()

boost::asio::awaitable< PgResult< void > > relx::pgsql_async_wrapper::Connection::rollback ( )
inline

Definition at line 532 of file pgsql_async_wrapper.hpp.

◆ socket()

PgResult< boost::asio::ip::tcp::socket * > relx::pgsql_async_wrapper::Connection::socket ( )
inline

Definition at line 330 of file pgsql_async_wrapper.hpp.

Friends And Related Symbol Documentation

◆ PreparedStatement

friend class PreparedStatement
friend

Definition at line 648 of file pgsql_async_wrapper.hpp.


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