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

45 lines
774 B

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