1 #ifndef SILICIUM_SQLITE3_HPP
2 #define SILICIUM_SQLITE3_HPP
18 sqlite3_close(database);
29 sqlite3_finalize(statement);
44 return sqlite3_errstr(ev);
62 int rc = sqlite3_open_v2(path.
c_str(), &database, SQLITE_OPEN_READWRITE,
nullptr);
72 sqlite3_stmt *statement;
73 int rc = sqlite3_prepare_v2(&database, query.
c_str(), -1, &statement,
nullptr);
81 inline boost::system::error_code
bind(sqlite3_stmt &statement,
int zero_based_index, sqlite3_int64 value)
83 return make_error_code(sqlite3_bind_int64(&statement, zero_based_index, value));
86 inline boost::system::error_code
bind(sqlite3_stmt &statement,
int zero_based_index,
char const *
begin,
int length)
88 return make_error_code(sqlite3_bind_text(&statement, zero_based_index, begin, length,
nullptr));
Definition: c_string.hpp:10
Definition: sqlite3.hpp:35
virtual const char * name() const BOOST_SYSTEM_NOEXCEPT SILICIUM_OVERRIDE
Definition: sqlite3.hpp:37
boost::system::error_code make_error_code(int code)
Definition: sqlite3.hpp:54
boost::system::error_code bind(sqlite3_stmt &statement, int zero_based_index, sqlite3_int64 value)
Definition: sqlite3.hpp:81
std::unique_ptr< sqlite3, database_deleter > database_handle
Definition: sqlite3.hpp:22
error_or< statement_handle > prepare(sqlite3 &database, c_string query)
Definition: sqlite3.hpp:70
Definition: absolute_path.hpp:19
void operator()(sqlite3_stmt *statement) const
Definition: sqlite3.hpp:26
#define SILICIUM_OVERRIDE
Definition: config.hpp:140
Definition: sqlite3.hpp:24
void operator()(sqlite3 *database) const
Definition: sqlite3.hpp:15
SILICIUM_USE_RESULT char_type const * c_str() const BOOST_NOEXCEPT
Definition: c_string.hpp:45
BOOST_CONSTEXPR Iterator const & begin(iterator_range< Iterator > const &range)
Definition: iterator_range.hpp:123
error_or< database_handle > open(c_string path)
Definition: sqlite3.hpp:59
Definition: error_or.hpp:48
std::unique_ptr< sqlite3_stmt, statement_deleter > statement_handle
Definition: sqlite3.hpp:33
virtual std::string message(int ev) const SILICIUM_OVERRIDE
Definition: sqlite3.hpp:42
boost::system::error_category & sqlite_category()
Definition: sqlite3.hpp:48
Definition: sqlite3.hpp:13