SELECT id, did, json FROM events WHERE json_extract(json, '$.when') > ?1 ORDER BY json_extract(json, '$.when') ASC