-
Notifications
You must be signed in to change notification settings - Fork 7
Query
Xin Yang edited this page May 2, 2016
·
4 revisions
Here are some examples about how to query our database.
Default status in Gerrit includes Merged, Abandoned and New
SELECT COUNT(*), ch_status FROM t_change GROUP BY ch_status;
SELECT * FROM t_history
WHERE hist_message LIKE '%Do not submit%'
OR hist_message LIKE '%Code-Review-2%'
ORDER BY hist_createdTime ASC;
SELECT * FROM t_history
WHERE hist_message LIKE '%I would prefer that you didn\'t submit this%'
OR hist_message LIKE '%Code-Review-1%'
ORDER BY hist_createdTime ASC;
SELECT * FROM t_history
WHERE hist_message LIKE '%Looks good to me, but someone else must approve%'
OR hist_message LIKE '%Code-Review+1%'
ORDER BY hist_createdTime ASC;
(note: some projects have different rules about patch approvals)
SELECT * FROM t_history
WHERE hist_message LIKE '%Looks good to me, approved%'
OR hist_message LIKE '%Code-Review+2%'
ORDER BY hist_createdTime ASC;
Here we define the core reviewers as the reviewers who voted +2 or -2
SELECT distinct hist_authorId FROM t_history
WHERE hist_message LIKE '%Looks good to me, approved%'
OR hist_message LIKE '%Code-Review+2%'
OR hist_message LIKE '%Do not submit%'
OR hist_message LIKE '%Code-Review-2%'
ORDER BY hist_createdTime ASC;