EyeQL reference guide
Fisheye contains a powerful query language called EyeQL. EyeQL is an intuitive SQL-like language that allows you to write your own specific queries. See examples.
EyeQL allows you to perform complex searches either within the Advanced Search or incorporated in scripts when programming the Fisheye API.
query: | select revisions ( from ( dir|directory ) word )? ( where clauses )? ( order by date ( asc | desc )? )? Notes: asc produces 'ascending order'. desc produces 'descending order'. ( group by group-by-clauses )? ( return return-clauses )? ( limit limit-args )? |
clauses: | clause (( or | and | , ) clause )* Notes: and binds more tightly than or . ',' (comma) means 'and'. |
clause: | ( clauses ) csid = word p4:jobid = word p4:jobid =~ word reviewed (in | before | in or before) review word (in | before | in or before) any (review states)? review Notes: |
tag-range: | ( ( | [ ) T1:word, T2:word ( ) | ] ) Having trouble with Subversion tags? See How tags work in Subversion for more information. |
word: | Any string , or any non-quoted word that does not contain white space or any other separators. |
string: | A sequence enclosed in either " (double quotes) or ' (single quotes). The following escapes work: \' \" \n \r \t \b \f . Unicode characters can be escaped with \uXXXX . You can also specify strings in 'raw' mode like r"foo" . (Similar to Python's raw strings. See Python's own documentation ). |
dateExp: | See our Date expressions reference guide for more information on date formats. |
group-by-clauses: | group-by-clause (, group-by-clause)* |
group-by-clause: | file | dir | directory | csid | changeset | author | day | month |
return-clauses: | return-clause (, return-clause )* A return clause signifies that you want control over what data is returned/displayed. |
return-clause: | ( path | dir | directory | revision | author | date | day | month | comment | csid | isBinary | totalLines | linesAdded | linesRemoved | isAdded | isDeleted | isCopied | isMoved | tags | reviews | aggregate) Notes: reviews applies to Crucible reviews. |
aggregate-return-field: | ( count(revisions ) | count( binary-field ) | count(distinct other-field ) | sum( numeric-field ) | average( numeric-field ) | max( numeric-field ) | min( numeric-field ) ) The aggregate field to return. メモ: binary-fields are isBinary, isAdded, isDeleted, isCopied, isMoved. e.g. count(isAdded) will return the number of added files. numeric-fields are totalLines, linesAdded, linesRemoved. other-field can be path, dir, author, date, csid, tags or reviews. e.g. count(distinct path) will return the number of unique paths. count(distinct tags) will return the number of unique tags. If a With no
With a
With a
With a
i.e. The EyeQL can contain a returns clause that contains all non-aggregate columns, or all aggregate columns. |
limit-clause: | ( length | offset, length | length offset offset ) Notes: Limits the number of results to return. offset specifies the starting point of the truncated result set and length specifies the set length. offset is zero-based. |
例
The following examples demonstrate using EyeQL to extract information from your repository.
Find files removed on the Ant 1.5 branch:
select revisions where modified on branch ANT_15_BRANCH and is dead group by changeset
As above, but just return the person and time the files were deleted:
select revisions where modified on branch ANT_15_BRANCH and is dead return path, author, date
Find files on branch and exclude delete files:
select revisions where modified on branch ANT_15_BRANCH and not is deleted group by changeset
Find changes made to Ant 1.5.x after 1.5FINAL:
select revisions where on branch ANT_15_BRANCH and after tag ANT_MAIN_15FINAL group by changeset
Find changes made between Ant 1.5 and 1.5.1:
select revisions where between tags (ANT_MAIN_15FINAL, ANT_151_FINAL] group by changeset
As above, but show the history of each file separately:
select revisions where between tags (ANT_MAIN_15FINAL, ANT_151_FINAL] group by file
Find Java files that are tagged ANT_151_FINAL and are head on the ANT_15_BRANCH: (i.e. files that haven't changed in 1.5.x since 1.5.1)
select revisions from dir /src/main where is head and tagged ANT_151_FINAL and on branch ANT_15_BRANCH and path like *.java group by changeset
Find changes made by conor to Ant 1.5.x since 1.5.0:
select revisions where between tags (ANT_MAIN_15FINAL, ANT_154] and author = conor group by changeset
Find commits that do not have comments:
select revisions from dir / where comment = "" group by changeset
Find the 10 most recent revisions:
select revisions order by date desc limit 10
Find the 5th, 6th & 7th revisions:
select revisions order by date limit 4, 3
Find commits between two dates:
select revisions where date in [2008-03-08, 2008-04-08]
Find revisions that do not have any associated review:
select revisions where (not in any review)
Return number of matched revisions, the number of files modified, authors who modified code, changesets, tags, and reviews:
select revisions
where date in [ 2003-10-10, 2004-12-12 ]
return count(revisions), count(distinct path), count(distinct author), count(distinct csid), count(distinct tags), count(distinct reviews)
As Sub-totals for each distinct changeset, Return csid, the author, date, comment, number of matched revisions, the number of files modified, the lines added/removed:
select revisions
where date in [ 2003-10-10, 2004-12-12 ]
group by changeset
return csid, author, date, comment, count(revisions), count(distinct path), sum(linesAdded), sum(linesRemoved)
For each matched file, return the file name, number of matched revisions, the lines added/removed:
select revisions
where date in [ 2003-10-10, 2004-12-12 ]
group by file
return path, count(revisions), sum(linesAdded), sum(linesRemoved)
Show all the changesets that are not in or before any closed review:
select revisions
from dir /
where not reviewed
group by changeset
return csid, author, count(revisions), comment
Includes changesets that were explicitly in a review:
select revisions
where not in any closed review and not in any open review
group by changeset
return path, revision, author, date, csid, reviews
Show lines added and lines removed per month for all authors in a given period:
select revisions
where date in [2016-07-01, 2017-01-01)
order by date
group by author, month
return author, month, sum(linesAdded), sum(linesRemoved)
Show range of revisions:
Explicitly add all the revisions to your query.
select revisions
where csid = 20 or csid = 21 or csid=22
order by date desc
return path, revision, author, date, csid, comment