tntdb::mysql Namespace Reference

This namespace contains the implementation of the Mysql driver for tntdb. More...


class  BindValues
class  MysqlError
class  MysqlStmtError
class  BoundRow
class  BoundValue
class  Connection
 Implements a connection to a Mysql database. More...
class  ConnectionManager
class  Cursor
class  Result
class  ResultRow
 Row of a result-set of type Result. More...
class  RowContainer
class  RowValue
class  Statement


void setNull (MYSQL_BIND &value)
void setBool (MYSQL_BIND &value, bool data)
void setShort (MYSQL_BIND &value, short data)
void setInt (MYSQL_BIND &value, int data)
void setLong (MYSQL_BIND &value, long data)
void setUnsignedShort (MYSQL_BIND &value, unsigned short data)
void setUnsigned (MYSQL_BIND &value, unsigned data)
void setUnsignedLong (MYSQL_BIND &value, unsigned long data)
void setInt32 (MYSQL_BIND &value, int32_t data)
void setUnsigned32 (MYSQL_BIND &value, uint32_t data)
void setInt64 (MYSQL_BIND &value, int64_t data)
void setUnsigned64 (MYSQL_BIND &value, uint64_t data)
void setDecimal (MYSQL_BIND &value, unsigned long &length, const Decimal &data)
void setFloat (MYSQL_BIND &value, float data)
void setDouble (MYSQL_BIND &value, double data)
void setChar (MYSQL_BIND &value, unsigned long &length, char data)
void setString (MYSQL_BIND &value, unsigned long &length, const char *data)
void setString (MYSQL_BIND &value, unsigned long &length, const std::string &data)
void setBlob (MYSQL_BIND &value, unsigned long &length, const Blob &data)
void setDate (MYSQL_BIND &value, const Date &data)
void setTime (MYSQL_BIND &value, const Time &data)
void setDatetime (MYSQL_BIND &value, const Datetime &data)
bool isNull (const MYSQL_BIND &value)
bool getBool (const MYSQL_BIND &value)
short getShort (const MYSQL_BIND &value)
int getInt (const MYSQL_BIND &value)
long getLong (const MYSQL_BIND &value)
unsigned getUnsigned (const MYSQL_BIND &value)
unsigned short getUnsignedShort (const MYSQL_BIND &value)
unsigned long getUnsignedLong (const MYSQL_BIND &value)
int32_t getInt32 (const MYSQL_BIND &value)
uint32_t getUnsigned32 (const MYSQL_BIND &value)
int64_t getInt64 (const MYSQL_BIND &value)
uint64_t getUnsigned64 (const MYSQL_BIND &value)
Decimal getDecimal (const MYSQL_BIND &value)
float getFloat (const MYSQL_BIND &value)
double getDouble (const MYSQL_BIND &value)
char getChar (const MYSQL_BIND &value)
void getString (const MYSQL_BIND &value, std::string &ret)
void getBlob (const MYSQL_BIND &value, Blob &ret)
Date getDate (const MYSQL_BIND &value)
Time getTime (const MYSQL_BIND &value)
Datetime getDatetime (const MYSQL_BIND &value)
void transferValue (MYSQL_BIND &fromValue, MYSQL_BIND &toValue, bool doRelease=true)
void copyValue (const MYSQL_BIND &fromValue, MYSQL_BIND &toValue, bool doRelease=true)
void refValue (const MYSQL_BIND &fromValue, MYSQL_BIND &toValue, bool doRelease=true)
void releaseValue (MYSQL_BIND &value)
void release (MYSQL_BIND &bind)
void reserve (MYSQL_BIND &bind, unsigned long size)
void reserveKeep (MYSQL_BIND &bind, unsigned long size)
template<typename c_type >
void setValue (MYSQL_BIND &bind, c_type value, enum_field_types mysql_type)

Detailed Description

This namespace contains the implementation of the Mysql driver for tntdb.

The driver makes it possible to access a Mysql database using tntdb.

To get a connection to a Mysql database, the dburl to the tntdb::connect function must start with "mysql:".

The remaining is a list of name value pairs separated by semicolon. The names and values are separated by '='. The value may be quoted by single or double quotes. Quote characters inside quoted values may be escaped using a backspace. If the value contains itself a backspace character, it must be doubled. Indeed each character prefixed with backspace is kept as is into the value.

A typical connection with a Mysql driver looks like that:

tntdb::Connection conn = tntdb::connect("mysql:db=DS2;user=web;passwd='foo\\'bar");

Here the username is "web" and the password is "foo'bar". Note that the backslash itself must be doubled in C++ code since the compiler processes the backspace first.

Function Documentation

void tntdb::mysql::copyValue ( const MYSQL_BIND &  fromValue,
MYSQL_BIND &  toValue,
bool  doRelease = true 
void tntdb::mysql::getBlob ( const MYSQL_BIND &  value,
Blob &  ret 
bool tntdb::mysql::getBool ( const MYSQL_BIND &  value)
char tntdb::mysql::getChar ( const MYSQL_BIND &  value)
Date tntdb::mysql::getDate ( const MYSQL_BIND &  value)
Datetime tntdb::mysql::getDatetime ( const MYSQL_BIND &  value)
Decimal tntdb::mysql::getDecimal ( const MYSQL_BIND &  value)
double tntdb::mysql::getDouble ( const MYSQL_BIND &  value)
float tntdb::mysql::getFloat ( const MYSQL_BIND &  value)
int tntdb::mysql::getInt ( const MYSQL_BIND &  value)
int32_t tntdb::mysql::getInt32 ( const MYSQL_BIND &  value)
int64_t tntdb::mysql::getInt64 ( const MYSQL_BIND &  value)
long tntdb::mysql::getLong ( const MYSQL_BIND &  value)
short tntdb::mysql::getShort ( const MYSQL_BIND &  value)
void tntdb::mysql::getString ( const MYSQL_BIND &  value,
std::string &  ret 
Time tntdb::mysql::getTime ( const MYSQL_BIND &  value)
unsigned tntdb::mysql::getUnsigned ( const MYSQL_BIND &  value)
uint32_t tntdb::mysql::getUnsigned32 ( const MYSQL_BIND &  value)
uint64_t tntdb::mysql::getUnsigned64 ( const MYSQL_BIND &  value)
unsigned long tntdb::mysql::getUnsignedLong ( const MYSQL_BIND &  value)
unsigned short tntdb::mysql::getUnsignedShort ( const MYSQL_BIND &  value)
bool tntdb::mysql::isNull ( const MYSQL_BIND &  value)
void tntdb::mysql::refValue ( const MYSQL_BIND &  fromValue,
MYSQL_BIND &  toValue,
bool  doRelease = true 
void tntdb::mysql::release ( MYSQL_BIND &  bind)
void tntdb::mysql::releaseValue ( MYSQL_BIND &  value)
void tntdb::mysql::reserve ( MYSQL_BIND &  bind,
unsigned long  size 
void tntdb::mysql::reserveKeep ( MYSQL_BIND &  bind,
unsigned long  size 
void tntdb::mysql::setBlob ( MYSQL_BIND &  value,
unsigned long &  length,
const Blob &  data 
void tntdb::mysql::setBool ( MYSQL_BIND &  value,
bool  data 
void tntdb::mysql::setChar ( MYSQL_BIND &  value,
unsigned long &  length,
char  data 
void tntdb::mysql::setDate ( MYSQL_BIND &  value,
const Date &  data 
void tntdb::mysql::setDatetime ( MYSQL_BIND &  value,
const Datetime &  data 
void tntdb::mysql::setDecimal ( MYSQL_BIND &  value,
unsigned long &  length,
const Decimal &  data 
void tntdb::mysql::setDouble ( MYSQL_BIND &  value,
double  data 
void tntdb::mysql::setFloat ( MYSQL_BIND &  value,
float  data 
void tntdb::mysql::setInt ( MYSQL_BIND &  value,
int  data 
void tntdb::mysql::setInt32 ( MYSQL_BIND &  value,
int32_t  data 
void tntdb::mysql::setInt64 ( MYSQL_BIND &  value,
int64_t  data 
void tntdb::mysql::setLong ( MYSQL_BIND &  value,
long  data 
void tntdb::mysql::setNull ( MYSQL_BIND &  value)
void tntdb::mysql::setShort ( MYSQL_BIND &  value,
short  data 
void tntdb::mysql::setString ( MYSQL_BIND &  value,
unsigned long &  length,
const char *  data 
void tntdb::mysql::setString ( MYSQL_BIND &  value,
unsigned long &  length,
const std::string &  data 
void tntdb::mysql::setTime ( MYSQL_BIND &  value,
const Time &  data 
void tntdb::mysql::setUnsigned ( MYSQL_BIND &  value,
unsigned  data 
void tntdb::mysql::setUnsigned32 ( MYSQL_BIND &  value,
uint32_t  data 
void tntdb::mysql::setUnsigned64 ( MYSQL_BIND &  value,
uint64_t  data 
void tntdb::mysql::setUnsignedLong ( MYSQL_BIND &  value,
unsigned long  data 
void tntdb::mysql::setUnsignedShort ( MYSQL_BIND &  value,
unsigned short  data 
template<typename c_type >
void tntdb::mysql::setValue ( MYSQL_BIND &  bind,
c_type  value,
enum_field_types  mysql_type 
void tntdb::mysql::transferValue ( MYSQL_BIND &  fromValue,
MYSQL_BIND &  toValue,
bool  doRelease = true