This method extracts some column from the cursor's current row.
| 262 | |
| 263 | // This method extracts some column from the cursor's current row. |
| 264 | static int xColumn(sqlite3_vtab_cursor* _cursor, sqlite3_context* invocation, int column) { |
| 265 | Cursor* cursor = Cursor::Upcast(_cursor); |
| 266 | CustomTable* self = cursor->GetVTab()->parent; |
| 267 | TempDataConverter temp_data_converter(self); |
| 268 | Napi::Env env = self->env; |
| 269 | Napi::HandleScope scope(env); |
| 270 | |
| 271 | Napi::Array row = cursor->row.Value(); |
| 272 | Napi::Value maybeColumnValue = SafeGetElement(env, row, (uint32_t)column); |
| 273 | if (maybeColumnValue.IsEmpty()) { |
| 274 | temp_data_converter.PropagateJSError(NULL); |
| 275 | } else { |
| 276 | Data::ResultValueFromJS(env, invocation, maybeColumnValue, &temp_data_converter); |
| 277 | } |
| 278 | return temp_data_converter.status; |
| 279 | } |
| 280 | |
| 281 | // This method outputs the rowid of the cursor's current row. |
| 282 | static int xRowid(sqlite3_vtab_cursor* cursor, sqlite_int64* output) { |
nothing calls this directly
no test coverage detected