AnCH Framework  0.1
Another C++ Hack Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Typedefs | Functions
anch::sql Namespace Reference

SQL namespace. More...

Classes

class  Connection
 SQL connection virtual class. More...
 
class  MySQLConnection
 MySQL connection. More...
 
class  MySQLResultSet
 MySQL result set implementation. More...
 
class  PostgreSQLConnection
 PostgreSQL connection. More...
 
class  PostgreSQLResultSet
 PostgreSQL result set implementation. More...
 
class  ResultSet
 SQL result representation. More...
 
struct  SqlConnectionConfiguration
 SQL database connection configuration. More...
 
class  SqlConnectionFactory
 SQL connection factory. More...
 
class  SqlException
 SQL exception. More...
 
class  SQLite3Connection
 SQLite3 connection. More...
 
class  SQLite3ResultSet
 SQLite3 result set implementation. More...
 

Typedefs

using SqlConnectionPool = anch::ResourcePool< Connection, SqlConnectionConfiguration, make_shared_connection >
 

Functions

std::shared_ptr< Connectionmake_shared_connection (const SqlConnectionConfiguration &config) throw (SqlException)
 
template<>
bool ResultSet::get< std::string > (std::size_t idx, std::string &out) throw (SqlException)
 
template<>
const std::string * ResultSet::get< std::string > (std::size_t idx) throw (SqlException)
 

Detailed Description

SQL namespace.

Provides abstraction layer for several SQL clients.
Supported SQL database are (for now):

Typedef Documentation

SQL connections pool definition

Function Documentation

std::shared_ptr<Connection> anch::sql::make_shared_connection ( const SqlConnectionConfiguration config)
throw (SqlException
)

Create a new shared pointer on SQL connection.

Parameters
configthe SQL database configuration
Returns
the connection
Exceptions
SqlExceptionany error
template<>
bool anch::sql::ResultSet::get< std::string > ( std::size_t  idx,
std::string &  out 
)
throw (SqlException
)

Get field string value by index.
The output parameter will be set only if SQL result is not NULL.

Parameters
idxthe index
outthe result
Returns
true if result is NULL, false otherwise
Exceptions
SqlExceptionany error
template<>
const std::string* anch::sql::ResultSet::get< std::string > ( std::size_t  idx)
throw (SqlException
)

Get field string value by index.
You have to delete result once treated.

Parameters
idxthe index
Returns
the result
Exceptions
SqlExceptionany error