{
  "db_name": "SQLite",
  "query": "SELECT DISTINCT t.id as \"id!: Uuid\", t.project_id as \"project_id!: Uuid\", t.title, t.description, t.status as \"status!: TaskStatus\", t.parent_task_attempt as \"parent_task_attempt: Uuid\", t.created_at as \"created_at!: DateTime<Utc>\", t.updated_at as \"updated_at!: DateTime<Utc>\"\n               FROM tasks t\n               WHERE (\n                   -- Find children: tasks that have this attempt as parent\n                   t.parent_task_attempt = $1 AND t.project_id = $2\n               ) OR (\n                   -- Find parent: task that owns the parent attempt of current task\n                   EXISTS (\n                       SELECT 1 FROM tasks current_task \n                       JOIN task_attempts parent_attempt ON current_task.parent_task_attempt = parent_attempt.id\n                       WHERE parent_attempt.task_id = t.id \n                       AND parent_attempt.id = $1 \n                       AND current_task.project_id = $2\n                   )\n               )\n               -- Exclude the current task itself to prevent circular references\n               AND t.id != (SELECT task_id FROM task_attempts WHERE id = $1)\n               ORDER BY t.created_at DESC",
  "describe": {
    "columns": [
      {
        "name": "id!: Uuid",
        "ordinal": 0,
        "type_info": "Blob"
      },
      {
        "name": "project_id!: Uuid",
        "ordinal": 1,
        "type_info": "Blob"
      },
      {
        "name": "title",
        "ordinal": 2,
        "type_info": "Text"
      },
      {
        "name": "description",
        "ordinal": 3,
        "type_info": "Text"
      },
      {
        "name": "status!: TaskStatus",
        "ordinal": 4,
        "type_info": "Text"
      },
      {
        "name": "parent_task_attempt: Uuid",
        "ordinal": 5,
        "type_info": "Blob"
      },
      {
        "name": "created_at!: DateTime<Utc>",
        "ordinal": 6,
        "type_info": "Text"
      },
      {
        "name": "updated_at!: DateTime<Utc>",
        "ordinal": 7,
        "type_info": "Text"
      }
    ],
    "parameters": {
      "Right": 2
    },
    "nullable": [
      true,
      false,
      false,
      true,
      false,
      true,
      false,
      false
    ]
  },
  "hash": "8aba98bb4d1701d1686d68371bca4edb4ba7f8b70693f86fc83860f8adda9065"
}
