This commit is contained in:
Scott E. Graves 2024-10-09 19:50:05 -05:00
parent 67053645e1
commit 55bcf082ec
3 changed files with 4 additions and 4 deletions

View File

@ -458,7 +458,7 @@ private:
i_provider &provider_;
private:
utils::db::sqlite::db3_t db_{nullptr};
utils::db::sqlite::db3_t db_;
std::uint64_t next_handle_{0U};
mutable std::recursive_mutex open_file_mtx_;
std::unordered_map<std::string, std::shared_ptr<i_closeable_open_file>>

View File

@ -48,6 +48,7 @@ meta_db::meta_db(const app_config &cfg) {
'|' + sqlite3_errstr(res));
return;
}
db_ = utils::db::sqlite::db3_t{
db3,
utils::db::sqlite::sqlite3_deleter(),

View File

@ -39,6 +39,7 @@ using db3_t = std::unique_ptr<sqlite3, sqlite3_deleter>;
struct sqlite3_statement_deleter {
void operator()(sqlite3_stmt *stmt) const {
if (stmt != nullptr) {
std::cout << "freeing stmt" << std::endl;
sqlite3_reset(stmt);
sqlite3_finalize(stmt);
}
@ -61,12 +62,10 @@ struct db_context_t {
db_context_t(sqlite3 &db3_, std::string table_name_)
: db3(db3_), table_name(std::move(table_name_)) {}
virtual ~db_context_t() = default;
sqlite3 &db3;
std::string table_name;
db3_stmt_t stmt{nullptr};
db3_stmt_t stmt;
};
class db_column final {