{ "db_name": "PostgreSQL", "query": "UPDATE research_topics t\n SET status = 'reviewing', updated_at = now()\n WHERE t.id = (\n SELECT research_topic_id FROM topology_runs\n WHERE id = $1 AND research_topic_id IS NOT NULL\n )\n AND t.status = 'processing'\n AND NOT EXISTS (\n SELECT 1 FROM topology_runs\n WHERE research_topic_id = t.id\n AND id <> $1\n AND status IN ('queued', 'running')\n )\n RETURNING t.id", "describe": { "columns": [ { "ordinal": 0, "name": "id", "type_info": "Uuid" } ], "parameters": { "Left": [ "Uuid" ] }, "nullable": [ false ] }, "hash": "e26955627419e4773f72abb9010fcdcd589d777f0fd20b444a629feed2bf75e4" }