| 118 | // ---------------------------------------------------------------------------------------- |
| 119 | |
| 120 | inline int query_int ( |
| 121 | database& db, |
| 122 | const std::string& query |
| 123 | ) |
| 124 | { |
| 125 | statement st(db, query); |
| 126 | st.exec(); |
| 127 | if (st.move_next() && st.get_num_columns() == 1) |
| 128 | { |
| 129 | int temp = st.get_column_as_int(0); |
| 130 | if (st.move_next()) |
| 131 | throw sqlite_error("query doesn't result in exactly 1 element"); |
| 132 | return temp; |
| 133 | } |
| 134 | else |
| 135 | { |
| 136 | throw sqlite_error("query doesn't result in exactly 1 element"); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | // ---------------------------------------------------------------------------------------- |
| 141 |
no test coverage detected