MySQL 26.10.0
Source Code Documentation
mrs_component::Mysql_command_service_session Class Reference

Owns the component command-service handle and optional thread initialization. More...

#include <mrs_component_mysql_command_service_session.h>

Classes

class  Connection_error
 

Public Member Functions

 Mysql_command_service_session ()=default
 
 ~Mysql_command_service_session ()
 
 Mysql_command_service_session (const Mysql_command_service_session &)=delete
 
Mysql_command_service_session & operator= (const Mysql_command_service_session &)=delete
 
 Mysql_command_service_session (Mysql_command_service_session &&)=delete
 
Mysql_command_service_session & operator= (Mysql_command_service_session &&)=delete
 
void connect (const std::string &user, const std::string &host, bool initialize_thread, unsigned long extra_client_flags=0, bool bypass_max_connections=false)
 
void connect_authenticated (const std::string &user, const mysql_harness::SecureString &password, unsigned long extra_client_flags=0)
 
void close () noexcept
 
bool reset () noexcept
 
bool autocommit (bool mode) noexcept
 
MYSQL_H handle () const noexcept
 
MYSQL * mysql () const noexcept
 
bool is_connected () const noexcept
 
unsigned int last_errno () const noexcept
 
std::string last_error () const
 
std::string last_sqlstate () const
 

Private Member Functions

void connect_impl (const std::string &user, const std::string &host, bool initialize_thread, unsigned long extra_client_flags, bool bypass_max_connections, const mysql_harness::SecureString *password)
 

Private Attributes

MYSQL_H mysql_h_ {nullptr}
 
bool thread_initialized_ {false}
 
std::string user_
 
std::string host_
 

Detailed Description

Owns the component command-service handle and optional thread initialization.

Callers retain responsibility for SQL policy and result handling.

Constructor & Destructor Documentation

◆ Mysql_command_service_session() [1/3]

mrs_component::Mysql_command_service_session::Mysql_command_service_session ( )
default

◆ ~Mysql_command_service_session()

mrs_component::Mysql_command_service_session::~Mysql_command_service_session ( )

◆ Mysql_command_service_session() [2/3]

mrs_component::Mysql_command_service_session::Mysql_command_service_session ( const Mysql_command_service_session &  )
delete

◆ Mysql_command_service_session() [3/3]

mrs_component::Mysql_command_service_session::Mysql_command_service_session ( Mysql_command_service_session &&  )
delete

Member Function Documentation

◆ autocommit()

bool mrs_component::Mysql_command_service_session::autocommit ( bool  mode)
noexcept

◆ close()

void mrs_component::Mysql_command_service_session::close ( )
noexcept

◆ connect()

void mrs_component::Mysql_command_service_session::connect ( const std::string &  user,
const std::string &  host,
bool  initialize_thread,
unsigned long  extra_client_flags = 0,
bool  bypass_max_connections = false 
)

◆ connect_authenticated()

void mrs_component::Mysql_command_service_session::connect_authenticated ( const std::string &  user,
const mysql_harness::SecureString &  password,
unsigned long  extra_client_flags = 0 
)

◆ connect_impl()

void mrs_component::Mysql_command_service_session::connect_impl ( const std::string &  user,
const std::string &  host,
bool  initialize_thread,
unsigned long  extra_client_flags,
bool  bypass_max_connections,
const mysql_harness::SecureString *  password 
)
private

◆ handle()

MYSQL_H mrs_component::Mysql_command_service_session::handle ( ) const
inlinenoexcept

◆ is_connected()

bool mrs_component::Mysql_command_service_session::is_connected ( ) const
inlinenoexcept

◆ last_errno()

unsigned int mrs_component::Mysql_command_service_session::last_errno ( ) const
noexcept

◆ last_error()

std::string mrs_component::Mysql_command_service_session::last_error ( ) const

◆ last_sqlstate()

std::string mrs_component::Mysql_command_service_session::last_sqlstate ( ) const

◆ mysql()

MYSQL * mrs_component::Mysql_command_service_session::mysql ( ) const
noexcept

◆ operator=() [1/2]

Mysql_command_service_session & mrs_component::Mysql_command_service_session::operator= ( const Mysql_command_service_session &  )
delete

◆ operator=() [2/2]

Mysql_command_service_session & mrs_component::Mysql_command_service_session::operator= ( Mysql_command_service_session &&  )
delete

◆ reset()

bool mrs_component::Mysql_command_service_session::reset ( )
noexcept

Member Data Documentation

◆ host_

std::string mrs_component::Mysql_command_service_session::host_
private

◆ mysql_h_

MYSQL_H mrs_component::Mysql_command_service_session::mysql_h_ {nullptr}
private

◆ thread_initialized_

bool mrs_component::Mysql_command_service_session::thread_initialized_ {false}
private

◆ user_

std::string mrs_component::Mysql_command_service_session::user_
private

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