|
|
|
@ -9,9 +9,11 @@ using namespace chrono; |
|
|
|
|
|
|
|
|
|
int main() { |
|
|
|
|
try { |
|
|
|
|
mySQL mydb("tcp://192.168.2.10:3306", "dinio", "H€r5elfInd1aH@nds", "dinio", 1); |
|
|
|
|
// mySQL mydb("tcp://192.168.2.10:3306", "dinio", "H€r5elfInd1aH@nds", "dinio", 1);
|
|
|
|
|
mySQL mydb("tcp://192.168.2.10:3306", "dinio", "H€r5elfInd1aH@nds", "dinio", 5); |
|
|
|
|
|
|
|
|
|
sleep(3); |
|
|
|
|
// sleep(3600*10);
|
|
|
|
|
sleep(30); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto start = high_resolution_clock::now(); |
|
|
|
@ -97,28 +99,28 @@ int main() { |
|
|
|
|
// t6.join();
|
|
|
|
|
|
|
|
|
|
// one by one
|
|
|
|
|
try { |
|
|
|
|
sqlQA test_qa; |
|
|
|
|
test_qa.select().from("records").where("enabled = 1"); |
|
|
|
|
mydb.exec(test_qa); |
|
|
|
|
test_qa.print(true); |
|
|
|
|
} catch (const string err) { |
|
|
|
|
cout << err << endl; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
sqlQA test_qa; |
|
|
|
|
test_qa.select().from("users"); |
|
|
|
|
mydb.exec(test_qa); |
|
|
|
|
test_qa.print(true); |
|
|
|
|
} catch (const string err) { |
|
|
|
|
cout << err << endl; |
|
|
|
|
} |
|
|
|
|
// try {
|
|
|
|
|
// sqlQA test_qa;
|
|
|
|
|
// test_qa.select().from("records").where("enabled = 1");
|
|
|
|
|
// mydb.exec(test_qa);
|
|
|
|
|
// test_qa.print(true);
|
|
|
|
|
// } catch (const string err) {
|
|
|
|
|
// cout << err << endl;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
// sqlQA test_qa;
|
|
|
|
|
// test_qa.select().from("users");
|
|
|
|
|
// mydb.exec(test_qa);
|
|
|
|
|
// test_qa.print(true);
|
|
|
|
|
// } catch (const string err) {
|
|
|
|
|
// cout << err << endl;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
sqlQA test_qa; |
|
|
|
|
test_qa.select().from("users"); |
|
|
|
|
test_qa.select("zone_id,record_type,enabled").from("records").where("domain = 'bitelex.test'"); |
|
|
|
|
mydb.exec(test_qa); |
|
|
|
|
test_qa.print(true); |
|
|
|
|
} catch (const string err) { |
|
|
|
@ -130,7 +132,7 @@ int main() { |
|
|
|
|
auto duration = duration_cast<microseconds>(end - start); |
|
|
|
|
cout << "-------------Izvršilo se za: " << (double)(duration.count() / 1000.0) << " ms"<< endl; |
|
|
|
|
|
|
|
|
|
sleep(100); |
|
|
|
|
// sleep(100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (const SQLException error) { |
|
|
|
|