Some changes

This commit is contained in:
WolverinDEV
2019-09-03 12:34:57 +02:00
parent a086dcc214
commit 2052317e6c
2 changed files with 18 additions and 2 deletions
+16 -1
View File
@@ -143,8 +143,23 @@ int main() {
});
#endif
#if true
#if false
//{":hello", "world"}, {":yyyy", "xxx"}, {":numeric", 2}
sql::command((SqlManager*) nullptr, std::string("SELECT *"), {":hello", "world"}, {":numeric", 2});
#endif
sql::mysql::MySQLManager manager;
if(!manager.connect("mysql://localhost:3306/test?userName=root&password=markus&connections=1")) {
cerr << "failed to connect" << endl;
return 1;
}
auto result = sql::command(&manager, "SELECT * FROM `level_miner`").query([](int length, std::string* values, std::string* names) {
cout << "-- entry" << endl;
for(int index = 0; index < length; index++) {
cout << " " << names[index] << " => " << values[index] << endl;
}
});
cout << result.fmtStr() << endl;
}