MCPcopy Create free account
hub / github.com/mattn/go-sqlite3 / my_column

Function my_column

_example/mod_vtable/sqlite3_mod_vtable.cc:166–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166static int
167my_column(cursor *c, sqlite3_context *ctxt, int i) {
168 picojson::value v = c->rows->get<picojson::array>()[c->index];
169 picojson::object row = v.get<picojson::object>();
170 const char* p = NULL;
171 switch (i) {
172 case 0:
173 p = row["id"].to_str().c_str();
174 break;
175 case 1:
176 p = row["full_name"].to_str().c_str();
177 break;
178 case 2:
179 p = row["description"].to_str().c_str();
180 break;
181 case 3:
182 p = row["html_url"].to_str().c_str();
183 break;
184 }
185 sqlite3_result_text(ctxt, strdup(p), strlen(p), free);
186 return SQLITE_OK;
187}
188
189static int
190my_rowid(cursor *c, sqlite3_int64 *pRowid) {

Callers

nothing calls this directly

Calls 1

to_strMethod · 0.80

Tested by

no test coverage detected