| 92 | } |
| 93 | |
| 94 | std::vector<std::unordered_map<std::string, std::string>> sqlite::execute(const std::string& s) |
| 95 | { |
| 96 | std::vector<std::unordered_map<std::string, std::string>> result; |
| 97 | impl->exec(s.c_str(), [&](int n, char** texts, char** names) { |
| 98 | std::unordered_map<std::string, std::string> row; |
| 99 | row.reserve(n); |
| 100 | std::transform( |
| 101 | names, |
| 102 | names + n, |
| 103 | texts, |
| 104 | std::inserter(row, row.begin()), |
| 105 | [&](const char* name, const char* text) { return std::make_pair(name, text); }); |
| 106 | result.push_back(row); |
| 107 | }); |
| 108 | return result; |
| 109 | } |
| 110 | |
| 111 | } // namespace MIGRAPHX_INLINE_NS |
| 112 | } // namespace migraphx |