{
  "db_name": "PostgreSQL",
  "query": "\n        DELETE FROM asset\n        WHERE (workspace_id, path, kind) IN (\n            SELECT workspace_id, path, kind FROM (\n                SELECT a.workspace_id, a.path, a.kind, a.usage_kind, ROW_NUMBER() OVER (\n                    PARTITION BY a.workspace_id, a.path, a.kind\n                    ORDER BY a.created_at DESC\n                ) as rn,\n                limits.max_n\n                FROM asset a\n                INNER JOIN (\n                    SELECT * FROM UNNEST(\n                        $1::varchar[], \n                        $2::varchar[], \n                        $3::asset_kind[],\n                        $4::int[]\n                    ) AS t(workspace_id, path, kind, max_n)\n                ) limits\n                ON a.workspace_id = limits.workspace_id \n                AND a.path = limits.path \n                AND a.kind = limits.kind\n                WHERE a.usage_kind = 'job'\n            ) ranked\n            WHERE rn > max_n\n        )",
  "describe": {
    "columns": [],
    "parameters": {
      "Left": [
        "VarcharArray",
        "VarcharArray",
        {
          "Custom": {
            "name": "asset_kind[]",
            "kind": {
              "Array": {
                "Custom": {
                  "name": "asset_kind",
                  "kind": {
                    "Enum": [
                      "s3object",
                      "resource",
                      "variable",
                      "ducklake",
                      "datatable",
                      "volume"
                    ]
                  }
                }
              }
            }
          }
        },
        "Int4Array"
      ]
    },
    "nullable": []
  },
  "hash": "02e526146f3584cd599dec708e1be48db3b0cd1c74adbfa2e4039377daa016f0"
}
