Skip to content

Commit d11ad5d

Browse files
committed
Fix example sql formatting
Signed-off-by: Carlos Martín <[email protected]>
1 parent bcd874a commit d11ad5d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

frontend/src/App.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ class App extends Component {
7575
name: 'Files named main.go',
7676
sql: `/* Files named main.go in HEAD */
7777
SELECT t.repository_id, t.tree_entry_name,
78-
language(t.tree_entry_name, b.blob_content) AS lang, b.blob_content,
79-
uast(b.blob_content, language(t.tree_entry_name, b.blob_content))
78+
LANGUAGE(t.tree_entry_name, b.blob_content) AS lang, b.blob_content,
79+
UAST(b.blob_content, LANGUAGE(t.tree_entry_name, b.blob_content)) AS uast
8080
FROM tree_entries AS t
8181
JOIN blobs b ON tree_entries.blob_hash = blobs.blob_hash
8282
JOIN commit_trees ON tree_entries.tree_hash = commit_trees.tree_hash
@@ -87,16 +87,16 @@ WHERE ref_name = 'HEAD'
8787
{
8888
name: 'Last commit for each repository',
8989
sql: `/* Last commit for each repository */
90-
SELECT r.repository_id,commit_author_name,commit_author_when,commit_message
90+
SELECT r.repository_id, commit_author_name, commit_author_when, commit_message
9191
FROM refs r
9292
natural JOIN commits
9393
WHERE r.ref_name = 'HEAD' `
9494
},
9595
{
9696
name: 'Top repositories by commits',
9797
sql: `/* Top repositories by number of commits in HEAD */
98-
SELECT repository_id,commit_count
99-
FROM (SELECT r.repository_id,count(*) AS commit_count
98+
SELECT repository_id, commit_count
99+
FROM (SELECT r.repository_id, COUNT(*) AS commit_count
100100
FROM refs r
101101
JOIN ref_commits AS c ON r.ref_name = c.ref_name
102102
WHERE r.ref_name = 'HEAD'
@@ -108,10 +108,10 @@ LIMIT 10 `
108108
name: 'Top languages by repository count',
109109
sql: `/* Top languages by repository count */
110110
SELECT *
111-
FROM (SELECT language,Count(repository_id) AS repository_count
111+
FROM (SELECT language, COUNT(repository_id) AS repository_count
112112
FROM (SELECT DISTINCT
113113
r.repository_id,
114-
language(t.tree_entry_name, b.blob_content) AS language
114+
LANGUAGE(t.tree_entry_name, b.blob_content) AS language
115115
FROM refs r
116116
JOIN commits c ON r.commit_hash = c.commit_hash
117117
JOIN commit_trees ct ON c.commit_hash = ct.commit_hash
@@ -123,7 +123,7 @@ ORDER BY repository_count DESC `
123123
},
124124
{
125125
name: 'Number of commits per month',
126-
sql: `/* Contributor's number of commits, each month of 2018, for each repository */
126+
sql: `/* Commits per committer, each month of 2018, for each repository */
127127
SELECT COUNT(*) as num_commits, month, repository_id, committer_name, committer_email
128128
FROM ( SELECT MONTH(committer_when) as month,
129129
r.repository_id,

0 commit comments

Comments
 (0)