Next: , Previous: edit-pr, Up: GNATS user tools

2.4 Querying the database

Obtain information from the database by using the program query-pr. query-pr uses search parameters you provide to find matching Problem Reports in the database. You can invoke query-pr from the shell or from within Emacs. query-pr uses the same arguments whether it is invoked from the shell or from Emacs.

PRs may be selected via the use of the --expr option, directly by number, or by the use of the (now deprecated) field-specific query operators.

By default, query options are connected with a logical AND. For example,

     query-pr --category=foo --responsible=bar

only prints PRs which have a Category field of foo and a Responsible field of bar.

The --or option may be used to connect query options with a logical OR. For example,

     query-pr --category=baz --or --responsible=blee

prints PRs which have either a Category field of baz or a Responsible field of blee.

It should be emphasized, however, that the use of these field-specific options is strongly discouraged, since they exist only for compatibility with older versions of gnats and are likely to be deleted in the next release. The expressions specified by the --expr option are much more flexible (see below).