CocoaPods / trunk.cocoapods.org

The authentication server for CocoaPods push

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch `/:name/specs/latest` to use GH API?

orta opened this issue · comments

Right now there's a pretty chunky query going on:

commits = DB[<<-SQL, params[:name]].all
          SELECT DISTINCT ON (pod_versions.id)
              pods.name          "name",
              pod_versions.name  "version",
              commits.sha        "sha",
              commits.created_at "created_at"
          FROM
              pods
          LEFT JOIN
              pod_versions ON pods.id = pod_versions.pod_id
          INNER JOIN
              commits      ON pod_versions.id = commits.pod_version_id
          WHERE
              pods.name = ? AND pods.deleted is false AND pod_versions.deleted is false
          ORDER BY
              pod_versions.id
        SQL

Could this be replaced by the GH API?