iFun Engine API  1.0.0-b6053
Great Technology for Great Games
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
fun::Mariadb Class Reference

Provides query interface for Mariadb and manages connection pool.

#include <mariadb.h>

Classes

struct  Error
 

Public Types

typedef function< void(size_t, size_t, const WallClock::Value &)> ConnectionFailureHandler
 
typedef function< void(const Ptr< ResultSets > &, const Error &)> QueryExecuteHandler
 

Public Member Functions

const stringaddress () const
 
size_t connection_count () const
 
const stringdatabase () const
 
void ExecuteQuery (const string &query, const QueryExecuteHandler &handler)
 
Ptr< ResultSetsExecuteQuerySync (const string &query, Error *error=NULL)
 
void Finalize ()
 
Ptr< MariadbConnectionGetExclusiveConnection ()
 
const stringid () const
 
size_t idle_connection_count () const
 
void Initialize ()
 
size_t query_queue_size () const
 

Static Public Member Functions

static Ptr< MariadbCreate (const string &address, const string &id, const string &password, const string &database, size_t connection_count, const string &connection_charset=kDefaultConnectionCharset, bool auto_retry_on_deadlock=kDefaultAutoRetryOnDeadlock, unsigned long client_flags=kDefaultClientFlags, int64_t slow_query_logging_time_in_ms=kDefaultSlowQueryLoggingTime, const ConnectionFailureHandler &connection_failure_handler=kDefaultConnectionFailureHandler)
 

Static Public Attributes

static const bool kDefaultAutoRetryOnDeadlock
 
static const unsigned long kDefaultClientFlags
 
static const string kDefaultConnectionCharset
 
static const ConnectionFailureHandler kDefaultConnectionFailureHandler
 
static const int64_t kDefaultSlowQueryLoggingTime