|
|
@ -12,7 +12,7 @@ int main() { |
|
|
|
|
|
|
|
|
|
|
|
sqlQA test_qa; |
|
|
|
sqlQA test_qa; |
|
|
|
// id,user_id,zone_id,domain,record_type,auth_key,last_update,enabled
|
|
|
|
// id,user_id,zone_id,domain,record_type,auth_key,last_update,enabled
|
|
|
|
// test_qa.select().from("records").where("enabled = 1");
|
|
|
|
// test_qa.select().from("records").where("enabled = 0").limit(2);
|
|
|
|
// mydb.exec(test_qa);
|
|
|
|
// mydb.exec(test_qa);
|
|
|
|
|
|
|
|
|
|
|
|
// for (auto i : test_qa.result) {
|
|
|
|
// for (auto i : test_qa.result) {
|
|
|
@ -22,13 +22,22 @@ int main() { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_qa.update("records").set("enabled = 1").where("domain = 'bitelex.test'"); |
|
|
|
// test_qa.update("records").set("enabled = 1").where("domain = 'bitelex.test'");
|
|
|
|
|
|
|
|
// mydb.exec(test_qa);
|
|
|
|
|
|
|
|
// if (test_qa.executed) {
|
|
|
|
|
|
|
|
// cout << "Num rows affect " << test_qa.updateCatch << endl;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// cout << "Num rows " << test_qa.num_rows << " num columns " << test_qa.num_columns << " executed " << test_qa.executed << endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// test_qa.insertInTo("records", "id,user_id,zone_id,domain,record_type,auth_key,last_update,enabled").values("'5',2,2,'www.bitelex.test','AAAA','jebiga',NULL,1");
|
|
|
|
|
|
|
|
test_qa.deleteFrom("records").where("record_type = AAAA"); |
|
|
|
|
|
|
|
// test_qa.update("records").set("enabled = 0").where("record_type = 'AAAA'");
|
|
|
|
|
|
|
|
cout << test_qa.cmd << endl; |
|
|
|
mydb.exec(test_qa); |
|
|
|
mydb.exec(test_qa); |
|
|
|
if (test_qa.executed) { |
|
|
|
cout << "Num rows " << test_qa.num_rows << " num columns " << test_qa.num_columns << " catch " << test_qa.updateCatch << " executed " << test_qa.executed << endl; |
|
|
|
cout << "Num rows affect " << test_qa.updateCatch << endl; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cout << "Num rows " << test_qa.num_rows << " num columns " << test_qa.num_columns << " executed " << test_qa.executed << endl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|