cesium-native 0.43.0
Loading...
Searching...
No Matches
SqliteHelper.h
1#pragma once
2
3#include "cesium-sqlite3.h"
4
5#include <memory>
6#include <string>
7
8struct CESIUM_SQLITE(sqlite3);
9struct CESIUM_SQLITE(sqlite3_stmt);
10
11namespace CesiumAsync {
12
19 void operator()(CESIUM_SQLITE(sqlite3*) pConnection) noexcept;
20};
21
28 void operator()(CESIUM_SQLITE(sqlite3_stmt*) pStatement) noexcept;
29};
30
36 std::unique_ptr<CESIUM_SQLITE(sqlite3), DeleteSqliteConnection>;
37
43 std::unique_ptr<CESIUM_SQLITE(sqlite3_stmt), DeleteSqliteStatement>;
44
58 const SqliteConnectionPtr& pConnection,
59 const std::string& sql);
60};
61
62} // namespace CesiumAsync
Classes that support asynchronous operations.
std::unique_ptr< CESIUM_SQLITE(sqlite3), DeleteSqliteConnection > SqliteConnectionPtr
A std::unique_ptr<sqlite3> that will properly delete the connection using the SQLite API.
std::unique_ptr< CESIUM_SQLITE(sqlite3_stmt), DeleteSqliteStatement > SqliteStatementPtr
A std::unique_ptr<sqlite3_stmt> that will properly delete the statement using the SQLite API.
A deleter that can be used with std::unique_ptr to properly destroy a SQLite connection when it is no...
void operator()(CESIUM_SQLITE(sqlite3 *) pConnection) noexcept
Closes the provided sqlite connection when called.
A deleter that can be used with std::unique_ptr to properly destroy a SQLite prepared statement when ...
void operator()(CESIUM_SQLITE(sqlite3_stmt *) pStatement) noexcept
Finalizes the provided sqlite statement when called.
Helper functions for working with SQLite.
static SqliteStatementPtr prepareStatement(const SqliteConnectionPtr &pConnection, const std::string &sql)
Create a prepared statement.