Library for easy work with SQLite 3 database
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sql3/lib/sqlite3.hpp

46 lines
908 B

#ifndef _MARCELB_SQLITE3_
#define _MARCELB_SQLITE3_
2 years ago
#include <stdio.h>
#include <sqlite3.h>
#include <string.h>
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include <mutex>
2 years ago
using namespace std;
namespace marcelb::SQlite3 {
2 years ago
static string responseDatabase;
static int callback(void* data, int argc, char** argv, char** azColName);
class SQLite3 {
mutex io;
2 years ago
sqlite3* db;
string path;
bool keepOpen;
2 years ago
bool open();
bool close();
map<string, vector<string>> parse(const string& result);
2 years ago
public:
// string Answer;
// map<string, vector<string>> parsed;
2 years ago
SQLite3(const string path, bool _keepOpen = false);
// map<string, vector<string>> query(const string sql_command);
std::map<std::string, std::vector<std::string>> query(const std::string& sql_command, const std::vector<std::string>& values);
~SQLite3();
2 years ago
};
}
2 years ago
#endif