4 #include "../third-party/sqlite/sqlite3.h" 22 std::this_thread::sleep_for(std::chrono::milliseconds(100));
23 }
while (result ==
SQLITE_BUSY && ++retries < max_retries);
33 void connection_handle_traits::close(
ptr value)
45 throw runtime_error(
"cannot finalize statement");
57 m_handle =
move(handle);
60 void connection::execute(
const char *
command)
const 69 bool connection::table_exists(
const char*
name)
const 71 statement stmt(*
this,
"SELECT COUNT(name) FROM sqlite_master WHERE type=? AND name=?");
72 stmt.
bind(1,
"table");
74 return stmt()[0].get_bool();
77 void connection::transaction(std::function<
void()> transaction)
const 100 bool statement::step()
const 110 int statement::get_int(
int const column)
const 115 double statement::get_double(
int const column)
const 126 vector<uint8_t> statement::get_blob(
int column)
const 151 void statement::bind(
int param,
const std::vector<uint8_t>&
value)
const 161 void statement::row_value::assert_good()
const 164 throw runtime_error(
"query returned zero results");
SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *, int iCol)
int do_with_retries(T action, int max_retries=1000)
const char * get_string(rs2_rs400_visual_preset value)
GLuint const GLchar * name
SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *, int iCol)
SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt *, int, const char *, int, void(*)(void *))
GLuint64 GLenum void * handle
SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *)
ImVec4 operator*(const ImVec4 &color, float t)
SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *)
GLenum GLenum GLsizei void GLsizei void * column
sql::statement::iterator end(sql::statement &stmt)
SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *, int, double)
SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt *, int, const void *, int n, void(*)(void *))
SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt)
void bind(int param, int value) const
sql::statement::iterator begin(sql::statement &stmt)
SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *, int iCol)
SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *, int iCol)
SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *)
SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(sqlite3 *db, const char *zSql, int nByte, sqlite3_stmt **ppStmt, const char **pzTail)
SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *)
connection_handle m_handle
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
SQLITE_API int SQLITE_STDCALL sqlite3_exec(sqlite3 *, const char *sql, int(*callback)(void *, int, char **, char **), void *, char **errmsg)
SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *, int, int)
SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *, int iCol)
SQLITE_API int SQLITE_STDCALL sqlite3_open(const char *filename, sqlite3 **ppDb)
void copy(void *dst, void const *src, size_t size)