|
VSQLite++
0.3
|
connection is used to open, close, attach and detach a database. Further it has to be passed to all classes since it represents the connection to the database and contains the internal needed handle, so you can see a connection object as handle to the database An object of this class is not copyable More...
#include <connection.hpp>
Public Member Functions | |
| connection (std::string const &db) | |
| constructor opens the database | |
| ~connection () | |
| destructor closes the database automatically | |
| void | attach (std::string const &db, std::string const &database_alias) |
| attaches another database file to the database represented by the object of this class. It is possible to attach up to 10 times the same database file with different aliases | |
| void | detach (std::string const &database_alias) |
| detaches a database via alias, if the same database was attached with several names they will be still present | |
Private Member Functions | |
| void | open (std::string const &db) |
| void | close () |
| void | access_check () |
Private Attributes | |
| sqlite3 * | handle |
Friends | |
| struct | private_accessor |
connection is used to open, close, attach and detach a database. Further it has to be passed to all classes since it represents the connection to the database and contains the internal needed handle, so you can see a connection object as handle to the database An object of this class is not copyable
Definition at line 45 of file connection.hpp.
| sqlite::connection::connection | ( | std::string const & | db | ) |
constructor opens the database
| db | filename of the database file if the given file already exists the file will be opened as database. If the file does not exist a new database will be created |
destructor closes the database automatically
| void sqlite::connection::access_check | ( | ) | [private] |
Referenced by sqlite::private_accessor::acccess_check().
| void sqlite::connection::attach | ( | std::string const & | db, |
| std::string const & | database_alias | ||
| ) |
attaches another database file to the database represented by the object of this class. It is possible to attach up to 10 times the same database file with different aliases
| db | database filename of the database should be attached |
| database_alias | alias which should be used |
| void sqlite::connection::close | ( | ) | [private] |
| void sqlite::connection::detach | ( | std::string const & | database_alias | ) |
detaches a database via alias, if the same database was attached with several names they will be still present
| database_alias | of the database (must be the same alias which was passed in the attach() call) |
| void sqlite::connection::open | ( | std::string const & | db | ) | [private] |
friend struct private_accessor [friend] |
Definition at line 74 of file connection.hpp.
sqlite3* sqlite::connection::handle [private] |
Definition at line 80 of file connection.hpp.
Referenced by sqlite::private_accessor::get_handle().
1.7.6.1