MCPcopy Create free account
hub / github.com/asg017/sqlite-vss / vector_debug

Function vector_debug

src/sqlite-vector.cpp:161–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161static 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

Callers

nothing calls this directly

Calls 1

valueAsVectorFunction · 0.85

Tested by

no test coverage detected