boost_sqlite 1
A sqlite C++ library
|
main object for a connection to a database. More...
#include <include/boost/sqlite/connection.hpp>
Public Types | |
using | handle_type = sqlite3* |
The handle of the connection. | |
Public Member Functions | |
connection ()=default | |
Default constructor. | |
connection (connection &&)=default | |
Move constructor. | |
connection (cstring_ref filename, int flags=SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE) | |
Construct a connection and connect it to filename .. flags is set by SQLITE_OPEN_* flags. | |
connection (handle_type handle, bool take_ownership=true) | |
Construct the connection from a handle. | |
handle_type | handle () const |
Returns the handle. | |
bool | has_column (cstring_ref table, cstring_ref column, cstring_ref db_name="main") const |
Check if the database has the table. | |
bool | has_table (cstring_ref table, cstring_ref db_name="main") const |
Check if the database has the table. | |
connection & | operator= (connection &&)=default |
Move assign operator. | |
handle_type | release () && |
Release the owned handle. | |
bool | valid () const |
Check if the database holds a valid handle. | |
void | connect (cstring_ref filename, int flags=SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE) |
void | connect (cstring_ref filename, int flags, system::error_code &ec) |
void | close () |
void | close (system::error_code &ec, error_info &ei) |
resultset | query (core::string_view q, system::error_code &ec, error_info &ei) |
resultset | query (core::string_view q) |
template<typename T > | |
static_resultset< T > | query (core::string_view q, system::error_code &ec, error_info &ei) |
template<typename T > | |
static_resultset< T > | query (core::string_view q) |
void | execute (cstring_ref q, system::error_code &ec, error_info &ei) |
void | execute (cstring_ref q) |
template<typename StringLike , typename = decltype(std::declval<const StringLike&>().c_str())> | |
void | execute (const StringLike &q, system::error_code &ec, error_info &ei) |
template<typename StringLike , typename = decltype(std::declval<const StringLike&>().c_str())> | |
void | execute (const StringLike &q) |
statement | prepare (core::string_view q, system::error_code &ec, error_info &ei) |
statement | prepare (core::string_view q) |
main object for a connection to a database.
Definition at line 31 of file connection.hpp.
|
inline |
Construct a connection and connect it to filename
.. flags
is set by SQLITE_OPEN_*
flags.
Definition at line 50 of file connection.hpp.
void boost::sqlite::connection::close | ( | ) |
Close the database connection.
void boost::sqlite::connection::close | ( | system::error_code & | ec, |
error_info & | ei ) |
Close the database connection.
void boost::sqlite::connection::connect | ( | cstring_ref | filename, |
int | flags, | ||
system::error_code & | ec ) |
Connect the database to filename
. flags
is set by SQLITE_OPEN_*
flags.
void boost::sqlite::connection::connect | ( | cstring_ref | filename, |
int | flags = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE ) |
Connect the database to filename
. flags
is set by SQLITE_OPEN_*
flags.
|
inline |
Perform a query without parameters, executes multiple statements.
Definition at line 127 of file connection.hpp.
|
inline |
Perform a query without parameters, executes multiple statements.
Definition at line 118 of file connection.hpp.
void boost::sqlite::connection::execute | ( | cstring_ref | q | ) |
Perform a query without parameters, executes multiple statements.
void boost::sqlite::connection::execute | ( | cstring_ref | q, |
system::error_code & | ec, | ||
error_info & | ei ) |
Perform a query without parameters, executes multiple statements.
statement boost::sqlite::connection::prepare | ( | core::string_view | q | ) |
Perform a query with parameters. Can only execute a single statement.
statement boost::sqlite::connection::prepare | ( | core::string_view | q, |
system::error_code & | ec, | ||
error_info & | ei ) |
Perform a query with parameters. Can only execute a single statement.
resultset boost::sqlite::connection::query | ( | core::string_view | q | ) |
Perform a query without parameters. Can only execute a single statement.
|
inline |
Perform a query without parameters. Can only execute a single statement.
Definition at line 96 of file connection.hpp.
resultset boost::sqlite::connection::query | ( | core::string_view | q, |
system::error_code & | ec, | ||
error_info & | ei ) |
Perform a query without parameters. Can only execute a single statement.
|
inline |
Perform a query without parameters. Can only execute a single statement.
Definition at line 80 of file connection.hpp.