MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
shcore::polyglot::database::Session Class Reference

#include <session.h>

Inheritance diagram for shcore::polyglot::database::Session:
[legend]

Classes

struct  Local_infile_callbacks
 

Public Member Functions

 Session (MYSQL *mysql)
 
 ~Session () override
 
void reset () override
 
- Public Member Functions inherited from jit_executor::db::ISession
virtual ~ISession ()=default
 

Private Member Functions

std::shared_ptr< IResultquery (const char *sql, size_t len, bool buffered, const std::vector< Query_attribute > &query_attributes={})
 
std::shared_ptr< IResultquery_udf (std::string_view sql, bool buffered)
 
void execute (const char *sql, size_t len)
 
void execute (const char *sql)
 
void start_transaction ()
 
void commit ()
 
void rollback ()
 
bool next_resultset ()
 
void prepare_fetch (DbResult *target)
 
std::string uri ()
 
uint64_t get_thread_id () const
 
uint64_t get_protocol_info ()
 
bool is_compression_enabled () const
 
const char * get_connection_info ()
 
const char * get_server_info ()
 
const char * get_stats ()
 
const char * get_ssl_cipher ()
 
const char * get_mysql_info () const
 
bool is_open () const
 
const char * get_last_error (int *out_code, const char **out_sqlstate)
 
std::vector< std::string > get_last_gtids () const
 
std::optional< std::string > get_last_statement_id () const
 
uint32_t get_server_status () const
 
uint64_t warning_count () const
 
void set_query_attributes (const shcore::Dictionary_t &args)
 
std::vector< Query_attributequery_attributes () const
 
std::shared_ptr< IResultrun_sql (const std::string &sql) override
 
std::shared_ptr< IResultrun_sql (const char *sql, size_t len, bool lazy_fetch, bool is_udf, const std::vector< Query_attribute > &query_attributes={})
 
MYSQLget_handle ()
 

Private Attributes

std::string _uri
 
MYSQL_mysql = nullptr
 
std::shared_ptr< MYSQL_RES_prev_result
 
uint64_t m_thread_id = 0
 
Local_infile_callbacks m_local_infile
 
Query_attribute_store m_query_attributes
 

Friends

class DbResult
 

Constructor & Destructor Documentation

◆ Session()

shcore::polyglot::database::Session::Session ( MYSQL mysql)

◆ ~Session()

shcore::polyglot::database::Session::~Session ( )
override

Member Function Documentation

◆ commit()

void shcore::polyglot::database::Session::commit ( )
private

◆ execute() [1/2]

void shcore::polyglot::database::Session::execute ( const char *  sql)
inlineprivate

◆ execute() [2/2]

void shcore::polyglot::database::Session::execute ( const char *  sql,
size_t  len 
)
private

◆ get_connection_info()

const char * shcore::polyglot::database::Session::get_connection_info ( )
inlineprivate

◆ get_handle()

MYSQL * shcore::polyglot::database::Session::get_handle ( )
inlineprivate

◆ get_last_error()

const char * shcore::polyglot::database::Session::get_last_error ( int *  out_code,
const char **  out_sqlstate 
)
inlineprivate

◆ get_last_gtids()

std::vector< std::string > shcore::polyglot::database::Session::get_last_gtids ( ) const
private

◆ get_last_statement_id()

std::optional< std::string > shcore::polyglot::database::Session::get_last_statement_id ( ) const
private

◆ get_mysql_info()

const char * shcore::polyglot::database::Session::get_mysql_info ( ) const
inlineprivate

◆ get_protocol_info()

uint64_t shcore::polyglot::database::Session::get_protocol_info ( )
inlineprivate

◆ get_server_info()

const char * shcore::polyglot::database::Session::get_server_info ( )
inlineprivate

◆ get_server_status()

uint32_t shcore::polyglot::database::Session::get_server_status ( ) const
inlineprivate

◆ get_ssl_cipher()

const char * shcore::polyglot::database::Session::get_ssl_cipher ( )
inlineprivate

◆ get_stats()

const char * shcore::polyglot::database::Session::get_stats ( )
inlineprivate

◆ get_thread_id()

uint64_t shcore::polyglot::database::Session::get_thread_id ( ) const
inlineprivate

◆ is_compression_enabled()

bool shcore::polyglot::database::Session::is_compression_enabled ( ) const
inlineprivate

◆ is_open()

bool shcore::polyglot::database::Session::is_open ( ) const
inlineprivate

◆ next_resultset()

bool shcore::polyglot::database::Session::next_resultset ( )
private

◆ prepare_fetch()

void shcore::polyglot::database::Session::prepare_fetch ( DbResult target)
private

◆ query()

std::shared_ptr< IResult > shcore::polyglot::database::Session::query ( const char *  sql,
size_t  len,
bool  buffered,
const std::vector< Query_attribute > &  query_attributes = {} 
)
private

◆ query_attributes()

std::vector< Query_attribute > shcore::polyglot::database::Session::query_attributes ( ) const
private

◆ query_udf()

std::shared_ptr< IResult > shcore::polyglot::database::Session::query_udf ( std::string_view  sql,
bool  buffered 
)
private

◆ reset()

void shcore::polyglot::database::Session::reset ( )
overridevirtual

◆ rollback()

void shcore::polyglot::database::Session::rollback ( )
private

◆ run_sql() [1/2]

std::shared_ptr< IResult > shcore::polyglot::database::Session::run_sql ( const char *  sql,
size_t  len,
bool  lazy_fetch,
bool  is_udf,
const std::vector< Query_attribute > &  query_attributes = {} 
)
private

◆ run_sql() [2/2]

std::shared_ptr< IResult > shcore::polyglot::database::Session::run_sql ( const std::string &  sql)
overrideprivatevirtual

◆ set_query_attributes()

void shcore::polyglot::database::Session::set_query_attributes ( const shcore::Dictionary_t args)
private

◆ start_transaction()

void shcore::polyglot::database::Session::start_transaction ( )
private

◆ uri()

std::string shcore::polyglot::database::Session::uri ( )
inlineprivate

◆ warning_count()

uint64_t shcore::polyglot::database::Session::warning_count ( ) const
inlineprivate

Friends And Related Function Documentation

◆ DbResult

friend class DbResult
friend

Member Data Documentation

◆ _mysql

MYSQL* shcore::polyglot::database::Session::_mysql = nullptr
private

◆ _prev_result

std::shared_ptr<MYSQL_RES> shcore::polyglot::database::Session::_prev_result
private

◆ _uri

std::string shcore::polyglot::database::Session::_uri
private

◆ m_local_infile

Local_infile_callbacks shcore::polyglot::database::Session::m_local_infile
private

◆ m_query_attributes

Query_attribute_store shcore::polyglot::database::Session::m_query_attributes
private

◆ m_thread_id

uint64_t shcore::polyglot::database::Session::m_thread_id = 0
private

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