FOSSredder 0.5.0
Loading...
Searching...
No Matches
SqliteDb.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <memory>
9#include <string>
10
12
13struct sqlite3;
14
16public:
21 explicit SqliteDb(const std::string& path);
25 ~SqliteDb();
26
27 SqliteDb(const SqliteDb&) = delete;
28 SqliteDb& operator=(const SqliteDb&) = delete;
29
34 sqlite3* handle() const noexcept {
35 return db_;
36 }
37
42 sqlite3* sqliteHandle() const noexcept override {
43 return db_;
44 }
45
46private:
47 sqlite3* db_ = nullptr;
48};
SQLite connection handle provider used by persistence adapters.
SqliteDb(const SqliteDb &)=delete
SqliteDb & operator=(const SqliteDb &)=delete
SqliteDb(const std::string &path)
Open a SQLite database at the given path.
Definition SqliteDb.cpp:14
~SqliteDb()
Close the database connection.
Definition SqliteDb.cpp:36
sqlite3 * sqliteHandle() const noexcept override
Get the raw SQLite handle.
Definition SqliteDb.h:42
sqlite3 * handle() const noexcept
Get the raw SQLite handle.
Definition SqliteDb.h:34