Skip to content

Commit

Permalink
Merge pull request #67 from carlosms/update-default-query
Browse files Browse the repository at this point in the history
Update default query for gitbase v0.12.1-rc1
  • Loading branch information
carlosms authored Jun 6, 2018
2 parents ac7cbfd + 0423859 commit b0f881f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ class App extends Component {
this.state = {
sql: `/* Contributor's number of commits, each month of 2018, for each repository */
SELECT COUNT(*) as num_commits, month, repo_id, committer_name FROM (
SELECT MONTH(committer_when) as month, r.id as repo_id, committer_name
FROM repositories r
INNER JOIN refs ON refs.repository_id = r.id AND refs.name = 'HEAD'
INNER JOIN commits c ON YEAR(committer_when) = 2018 AND history_idx(refs.hash, c.hash) >= 0
) as t
GROUP BY committer_name, month, repo_id`,
SELECT COUNT(*) as num_commits, month, repo_id, committer_name
FROM ( SELECT MONTH(committer_when) as month,
r.repository_id as repo_id,
committer_name
FROM ref_commits r
INNER JOIN commits c
ON YEAR(c.committer_when) = 2018 AND r.commit_hash = c.commit_hash
WHERE r.ref_name = 'HEAD'
) as t GROUP BY committer_name, month, repo_id`,
results: new Map(),
schema: undefined,
// modal
Expand Down

0 comments on commit b0f881f

Please sign in to comment.