| 164 | } |
| 165 | |
| 166 | static int |
| 167 | my_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 | |
| 189 | static int |
| 190 | my_rowid(cursor *c, sqlite3_int64 *pRowid) { |