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 More...
|
|
| ~connection () |
| destructor closes the database automatically More...
|
|
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 More...
|
|
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 More...
|
|
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.
◆ connection()
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 |
◆ ~connection()
sqlite::connection::~connection |
( |
| ) |
|
destructor closes the database automatically
◆ access_check()
void sqlite::connection::access_check |
( |
| ) |
|
|
private |
◆ attach()
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 |
◆ close()
void sqlite::connection::close |
( |
| ) |
|
|
private |
◆ detach()
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) |
◆ open()
void sqlite::connection::open |
( |
std::string const & |
db | ) |
|
|
private |
◆ private_accessor
◆ handle
sqlite3* sqlite::connection::handle |
|
private |
The documentation for this struct was generated from the following file: