|
|
@ -9,9 +9,11 @@ using namespace chrono; |
|
|
|
|
|
|
|
|
|
|
|
int main() { |
|
|
|
int main() { |
|
|
|
try { |
|
|
|
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(); |
|
|
|
auto start = high_resolution_clock::now(); |
|
|
@ -97,28 +99,28 @@ int main() { |
|
|
|
// t6.join();
|
|
|
|
// t6.join();
|
|
|
|
|
|
|
|
|
|
|
|
// one by one
|
|
|
|
// one by one
|
|
|
|
try { |
|
|
|
// try {
|
|
|
|
sqlQA test_qa; |
|
|
|
// sqlQA test_qa;
|
|
|
|
test_qa.select().from("records").where("enabled = 1"); |
|
|
|
// test_qa.select().from("records").where("enabled = 1");
|
|
|
|
mydb.exec(test_qa); |
|
|
|
// mydb.exec(test_qa);
|
|
|
|
test_qa.print(true); |
|
|
|
// test_qa.print(true);
|
|
|
|
} catch (const string err) { |
|
|
|
// } catch (const string err) {
|
|
|
|
cout << err << endl; |
|
|
|
// cout << err << endl;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
// try {
|
|
|
|
sqlQA test_qa; |
|
|
|
// sqlQA test_qa;
|
|
|
|
test_qa.select().from("users"); |
|
|
|
// test_qa.select().from("users");
|
|
|
|
mydb.exec(test_qa); |
|
|
|
// mydb.exec(test_qa);
|
|
|
|
test_qa.print(true); |
|
|
|
// test_qa.print(true);
|
|
|
|
} catch (const string err) { |
|
|
|
// } catch (const string err) {
|
|
|
|
cout << err << endl; |
|
|
|
// cout << err << endl;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
sqlQA test_qa; |
|
|
|
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); |
|
|
|
mydb.exec(test_qa); |
|
|
|
test_qa.print(true); |
|
|
|
test_qa.print(true); |
|
|
|
} catch (const string err) { |
|
|
|
} catch (const string err) { |
|
|
@ -130,7 +132,7 @@ int main() { |
|
|
|
auto duration = duration_cast<microseconds>(end - start); |
|
|
|
auto duration = duration_cast<microseconds>(end - start); |
|
|
|
cout << "-------------Izvršilo se za: " << (double)(duration.count() / 1000.0) << " ms"<< endl; |
|
|
|
cout << "-------------Izvršilo se za: " << (double)(duration.count() / 1000.0) << " ms"<< endl; |
|
|
|
|
|
|
|
|
|
|
|
sleep(100); |
|
|
|
// sleep(100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (const SQLException error) { |
|
|
|
} catch (const SQLException error) { |
|
|
|