| 75 | |
| 76 | == Non Ticket Reports == |
| 77 | |
| 78 | SQL reports do not have to be limited to tickets. They can report on revisions, wiki pages, or user activity. |
| 79 | |
| 80 | === User Changesets === |
| 81 | The follow report will lists all of the changes for the current user, or add "?USER=''user''" to the end of the URL to report on another user. |
| 82 | {{{ |
| 83 | !#sql |
| 84 | SELECT |
| 85 | "changeset" AS _realm, rev as id, |
| 86 | time AS date, time, |
| 87 | SUBSTR(message, 1, 80 )AS message |
| 88 | FROM revision |
| 89 | WHERE author='$USER' |
| 90 | ORDER BY time DESC |
| 91 | }}} |
| 92 | This report only gives the first 80 characters of the check-in message. To give the full message, make the following change: |
| 93 | {{{ |
| 94 | #!diff |
| 95 | --- Report.sql |
| 96 | +++ Report.sql |
| 97 | @@ -1,7 +1,7 @@ |
| 98 | SELECT |
| 99 | "changeset" AS _realm, rev as id, |
| 100 | time AS date, time, |
| 101 | - SUBSTR(message, 1, 80 )AS message |
| 102 | + message AS _message_ |
| 103 | FROM revision |
| 104 | WHERE author='$USER' |
| 105 | ORDER BY time DESC |
| 106 | }}} |
| 107 | === Wiki Changes === |
| 108 | This reports the wiki pages ever modified by the current user, or add "?USER=''user''" to the end of the URL to report on another user. Version is the highest version that the user modified. |
| 109 | {{{ |
| 110 | #!sql |
| 111 | SELECT |
| 112 | "wiki" AS _realm, |
| 113 | name AS id, |
| 114 | max(version) AS Version, |
| 115 | time AS date, time, |
| 116 | comment |
| 117 | FROM wiki |
| 118 | WHERE author='$USER' |
| 119 | GROUP BY name |
| 120 | }}} |
| 121 | For wiki pages that were last modified by the current user: |
| 122 | {{{ |
| 123 | #!sql |
| 124 | SELECT |
| 125 | "wiki" AS _realm, |
| 126 | wiki.name AS id, |
| 127 | time AS date, time, |
| 128 | comment |
| 129 | FROM wiki, |
| 130 | (SELECT max(version) AS maxVer, name |
| 131 | FROM wiki |
| 132 | GROUP BY name) maxResults |
| 133 | WHERE wiki.name = maxResults.name |
| 134 | AND version = maxVer |
| 135 | AND author = '$USER' |
| 136 | ORDER BY wiki.name |
| 137 | }}} |