| 159 | } |
| 160 | |
| 161 | static void vector_debug(sqlite3_context *context, |
| 162 | int argc, |
| 163 | sqlite3_value **argv) { |
| 164 | |
| 165 | vec_ptr pVec = valueAsVector(argv[0]); |
| 166 | |
| 167 | if (pVec == nullptr) { |
| 168 | |
| 169 | sqlite3_result_error(context, "Value not a vector", -1); |
| 170 | return; |
| 171 | } |
| 172 | |
| 173 | sqlite3_str *str = sqlite3_str_new(0); |
| 174 | sqlite3_str_appendf(str, "size: %lld [", pVec->size()); |
| 175 | |
| 176 | for (int i = 0; i < pVec->size(); i++) { |
| 177 | |
| 178 | if (i == 0) |
| 179 | sqlite3_str_appendf(str, "%f", pVec->at(i)); |
| 180 | else |
| 181 | sqlite3_str_appendf(str, ", %f", pVec->at(i)); |
| 182 | } |
| 183 | |
| 184 | sqlite3_str_appendchar(str, 1, ']'); |
| 185 | sqlite3_result_text(context, sqlite3_str_finish(str), -1, sqlite3_free); |
| 186 | } |
| 187 | |
| 188 | #pragma endregion |
| 189 |
nothing calls this directly
no test coverage detected