tntdb
1.3
|
Main namespace for tntdb. More...
Classes | |
class | Blob |
Binary large objects. More... | |
class | BlobIStream |
istream for reading from a tntdb::Blob More... | |
class | BlobStreamBuf |
streambuf for reading from a tntdb::Blob More... | |
class | Connection |
This class holds a connection to a database. More... | |
class | ConnectionPool |
class | ConnectionPools |
class | Date |
This class holds a date. More... | |
class | Datetime |
This class holds a date and a time. More... | |
class | Decimal |
class | Error |
Baseclass for database-errors. More... | |
class | FieldNotFound |
class | Hostvar |
Helper class to hold a tntdb::Statement and a column name. More... | |
class | LibraryManager |
class | NotFound |
Thrown, if selectRow or selectValue does not fetch any data. More... | |
class | NullValue |
This exception is thrown, when a value is extracted with Value::get...(), but the value is null. More... | |
class | Result |
The class holds a resultset of a query. More... | |
class | Row |
Row represents a row, which is fetched from the database. More... | |
class | RowReader |
A RowReader is a class which helps reading multiple columns from a row. More... | |
class | SqlBuilder |
class | SqlError |
Exception, which is a direct result of a sql-statement. More... | |
class | Statement |
This class represents a sql-statement. More... | |
class | StmtEvent |
class | StmtParser |
class | Time |
This class holds a time. More... | |
class | Transaction |
The class Transaction monitors the state of a transaction on a database-conection. More... | |
class | TypeError |
Exception to indicate, that a value couldn't be converted to a requested type. More... | |
class | Value |
The class Value represents a value, which is fetched from the database. More... | |
Functions | |
Connection | connect (const std::string &url) |
Establish a connection to a database. More... | |
Connection | connectCached (const std::string &url) |
Fetch a connection from a pool or create a new one. More... | |
void | dropCached (unsigned keep=0) |
Releases unused connections. More... | |
void | dropCached (const std::string &url, unsigned keep=0) |
Releases unused connections, which match the given url. More... | |
void | setMaxPoolSize (unsigned max) |
Sets the maximum pool-size of new connectionpools. More... | |
unsigned | getMaxPoolSize () |
Returns the current setting for maximum pools size. More... | |
std::istream & | operator>> (std::istream &in, Decimal &dec) |
std::ostream & | operator<< (std::ostream &out, const Decimal &dec) |
void | operator<< (Hostvar &hostvar, bool data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, int data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, long data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, unsigned data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, unsigned long data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, int32_t data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, uint32_t data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, int64_t data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, uint64_t data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, const Decimal &data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, float data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, double data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, char data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, const std::string &data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, const char *data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, const cxxtools::String &data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, const Blob &data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, const Date &data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, const Time &data) |
Set operators for host variables. More... | |
void | operator<< (Hostvar &hostvar, const Datetime &data) |
Set operators for host variables. More... | |
template<typename T > | |
void | operator<< (Hostvar &hostvar, const std::vector< T > &data) |
Set operators for host variables. More... | |
template<typename T > | |
void | operator<< (Hostvar &hostvar, const std::list< T > &data) |
Set operators for host variables. More... | |
template<typename T > | |
void | operator<< (Hostvar &hostvar, const std::deque< T > &data) |
Set operators for host variables. More... | |
template<typename T > | |
void | operator<< (Hostvar &hostvar, const std::set< T > &data) |
Set operators for host variables. More... | |
bool | operator>> (const Value &value, bool &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, short &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, int &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, long &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, unsigned short &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, unsigned &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, unsigned long &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, int32_t &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, uint32_t &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, int64_t &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, uint64_t &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, Decimal &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, float &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, double &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, char &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, std::string &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, cxxtools::String &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, Blob &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, Date &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, Time &out) |
Extraction operators for standard types. More... | |
bool | operator>> (const Value &value, Datetime &out) |
Extraction operators for standard types. More... | |
Main namespace for tntdb.
All code is in this namespace.
Connection tntdb::connect | ( | const std::string & | url | ) |
Establish a connection to a database.
The url is prefixed with a drivername followed by a colon and a driver- specific part. If the connection can't be established, a exception of type tntdb::Error or derived is thrown.
Examples:
Connection tntdb::connectCached | ( | const std::string & | url | ) |
Fetch a connection from a pool or create a new one.
A static pool of connections is kept in memory. The function looks in this pool, if there is a connection, which matches the url. If found the connection is removed from the pool and returned. When the returned connection-object is destroyed (and all copies of it), the actual connection is put back into the pool.
When there is no connections in the pool, which match the url, a new connection is established.
void tntdb::dropCached | ( | unsigned | keep = 0 | ) |
Releases unused connections.
Keeps the given number of connections.
void tntdb::dropCached | ( | const std::string & | url, |
unsigned | keep = 0 |
||
) |
Releases unused connections, which match the given url.
Keeps the given number of connections.
unsigned tntdb::getMaxPoolSize | ( | ) |
Returns the current setting for maximum pools size.
The maximum pools size is used, when a new pool is created
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
|
inline |
Set operators for host variables.
Set operators for host variables.
Set operators for host variables.
Set operators for host variables.
Set operators for host variables.
void tntdb::operator<< | ( | Hostvar & | hostvar, |
const std::vector< T > & | data | ||
) |
Set operators for host variables.
void tntdb::operator<< | ( | Hostvar & | hostvar, |
const std::list< T > & | data | ||
) |
Set operators for host variables.
void tntdb::operator<< | ( | Hostvar & | hostvar, |
const std::deque< T > & | data | ||
) |
Set operators for host variables.
void tntdb::operator<< | ( | Hostvar & | hostvar, |
const std::set< T > & | data | ||
) |
Set operators for host variables.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
|
inline |
Extraction operators for standard types.
Extraction operators for standard types.
Extraction operators for standard types.
Extraction operators for standard types.
Extraction operators for standard types.
void tntdb::setMaxPoolSize | ( | unsigned | max | ) |
Sets the maximum pool-size of new connectionpools.
When the maximum number of connections to a specific url is reached, connectCached blocks until a connection is available. The setting do not affect pools with active connections. You should release all connections and drop clear the pool to your url with dropCached(url), which recreates the pool.