|
|
|
@ -5,7 +5,6 @@ |
|
|
|
|
#include <mutex> |
|
|
|
|
#include <thread> |
|
|
|
|
#include <future> |
|
|
|
|
// #include <iostream>
|
|
|
|
|
#include <string> |
|
|
|
|
#include <vector> |
|
|
|
|
#include <tuple> |
|
|
|
@ -36,7 +35,8 @@ class MySQL_Res : public vector<tuple<Types...>> { |
|
|
|
|
bool have_result = false; |
|
|
|
|
uint16_t affected = 0; |
|
|
|
|
uint16_t rows = 0; |
|
|
|
|
uint16_t columns = (int)tuple_size<tuple<Types...>>::value; |
|
|
|
|
uint16_t columns = sizeof...(Types); |
|
|
|
|
vector<string> columns_name; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -156,8 +156,15 @@ class MySQL { |
|
|
|
|
ResultSet* res = stmt->getResultSet(); |
|
|
|
|
result.rows = res->rowsCount(); |
|
|
|
|
|
|
|
|
|
ResultSetMetaData *metaData = res->getMetaData(); |
|
|
|
|
int columnCount = metaData->getColumnCount(); |
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= columnCount; ++i) { |
|
|
|
|
result.columns_name.push_back(metaData->getColumnName(i)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
while (res->next()) { |
|
|
|
|
result.push_back(MySQL::getRow<Types...>(res, std::make_index_sequence<sizeof...(Types)>{})); |
|
|
|
|
result.push_back(MySQL::getRow<Types...>(res, make_index_sequence<sizeof...(Types)>{})); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
res->close(); |
|
|
|
|