What's the difference/advantage between defining the virtual column or creating the index directly like this:
CREATE INDEX test_idx ON events(JSON_EXTRACT(data, '$.someKey'));
CREATE INDEX test_idx ON events(JSON_EXTRACT(data, '$.someKey'));
Also, depending on your access patterns, you might want the generated column to be stored (evaluated on write) rather than virtual (evaluated on read).
[append] And SQLite's json_extract doesn't have anything like '$[*].foo' or any mapping functions. You could use json_each to do that, but the process is very different from creating an index.