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>
|
| 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
|
|
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
- Parameters
-
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 |
sqlite::connection::~connection |
( |
| ) |
|
destructor closes the database automatically
void sqlite::connection::access_check |
( |
| ) |
|
|
private |
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
- Parameters
-
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
- Parameters
-
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 |
sqlite3* sqlite::connection::handle |
|
private |
The documentation for this struct was generated from the following file: