Some changes
This commit is contained in:
+16
-1
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user