#ifndef _MARCELB_SQLITE3_ #define _MARCELB_SQLITE3_ #include #include #include #include #include #include #include #include using namespace std; namespace marcelb::SQlite3 { class SQLite3 { mutex io; sqlite3* db; string path; bool keepOpen; bool open(); bool close(); public: /** * Open SQLite3 database * path - path to the file * _keepOpen - true: keeps the file open, false: opens it when needed */ SQLite3(const string path, bool _keepOpen = false); /** * Make a request to the database */ map> query(const string& sql_command, const vector& values = {}); /** * Close the database and destroy the object */ ~SQLite3(); }; } #endif