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 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 64 of file connection.hpp.
◆ connection() [1/5]
| sqlite::v2::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 |
Referenced by connection(), and operator=().
◆ connection() [2/5]
◆ connection() [3/5]
| sqlite::v2::connection::connection |
( |
connection const & | | ) |
|
|
delete |
◆ connection() [4/5]
| sqlite::v2::connection::connection |
( |
std::string const & | db, |
|
|
sqlite::open_mode | open_mode ) |
◆ connection() [5/5]
◆ ~connection()
| sqlite::v2::connection::~connection |
( |
| ) |
|
destructor closes the database automatically
◆ access_check()
| void sqlite::v2::connection::access_check |
( |
| ) |
|
|
private |
◆ acquire_cached_statement()
| sqlite3_stmt * sqlite::v2::connection::acquire_cached_statement |
( |
std::string const & | sql | ) |
|
|
private |
◆ attach()
| void sqlite::v2::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 |
◆ clear_statement_cache()
| void sqlite::v2::connection::clear_statement_cache |
( |
| ) |
|
◆ close()
| void sqlite::v2::connection::close |
( |
| ) |
|
|
private |
◆ configure_statement_cache()
◆ detach()
| void sqlite::v2::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) |
◆ get_last_insert_rowid()
| std::int64_t sqlite::v2::connection::get_last_insert_rowid |
( |
| ) |
|
Returns the last inserted rowid in the currently opened database.
◆ open() [1/3]
| void sqlite::v2::connection::open |
( |
std::string const & | db | ) |
|
|
private |
◆ open() [2/3]
| void sqlite::v2::connection::open |
( |
std::string const & | db, |
|
|
bool | readonly ) |
|
private |
◆ open() [3/3]
| void sqlite::v2::connection::open |
( |
std::string const & | db, |
|
|
sqlite::open_mode | open_mode ) |
|
private |
◆ open_with_flags()
| void sqlite::v2::connection::open_with_flags |
( |
std::string const & | db, |
|
|
int | flags ) |
|
private |
◆ operator=()
◆ release_cached_statement()
| void sqlite::v2::connection::release_cached_statement |
( |
std::string const & | sql, |
|
|
sqlite3_stmt * | stmt ) |
|
private |
◆ statement_cache_settings()
◆ private_accessor
| friend struct private_accessor |
|
friend |
◆ cache_
◆ filesystem
◆ handle
| sqlite3* sqlite::v2::connection::handle |
|
private |
The documentation for this struct was generated from the following file: