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/test/test.cpp

32 lines
682 B

2 years ago
#include <iostream>
using namespace std;
2 years ago
#include "../lib/sqlite3.hpp"
using namespace marcelb::SQlite3;
2 years ago
int main() {
try {
2 years ago
SQLite3 mydb("../example/example.db", false);
2 years ago
// cout << mydb.ask("Select * from Tab1");
2 years ago
// cout << mydb.ask("INSERT INTO Tab1 VALUES(3,'Pakora', 'marijanab@bitelex.ml');");
auto res = mydb.query("Select * from Tab1 Where id > ?", {"3"});
// cout << endl << res["NAME"][1];
2 years ago
// cout << endl << res["MAIL"][1];
for (auto i : res) {
for (auto j: i.second) {
cout << i.first << " : " << j << endl;
}
}
} catch (const string err) {
cout << err << endl;
}
2 years ago
return 0;
}