#include <sqlite_cpp.h>
Connection to a SQLite database
◆ Conn()
SQLite::Conn::Conn |
( |
const char * |
db_name | ) |
|
Open a connection to a SQLite3 database
- Parameters
-
[in] | db_name | Path to SQLite3 database |
◆ close()
void SQLite::Conn::close |
( |
| ) |
|
|
noexcept |
Close the active database connection. If there are active prepared statements using this connection, they are also closed. Attempting to use the database or any associated statements after calling close() will throw an error.
In most cases, calling this method explicitly is not necessary because it gets called automatically when Conn goes out of scope.
Memory/Exception Safety
This method will never throw an exception. Calling close() after the first time will harmlessly do nothing.
◆ exec()
void SQLite::Conn::exec |
( |
const std::string |
query | ) |
|
Execute a query that doesn't return anything
- Parameters
-
◆ get_ptr()
sqlite3 * SQLite::Conn::get_ptr |
( |
| ) |
|
Return a raw pointer to the sqlite3 handle.
Memory Safety
This function will never return invalid pointers. A runtime_error is thrown if this is used after Conn::close() has been called.
◆ prepare()
Prepare a query for execution
◆ query()
◆ base
std::shared_ptr<conn_base> SQLite::Conn::base |
Initial value:=
std::make_shared<conn_base>()
◆ error_message
char* SQLite::Conn::error_message |
◆ stmts
Buffer for error messages
The documentation for this class was generated from the following files: