|
| 1 | +--- |
| 2 | +title: bqrs decode |
| 3 | +versions: |
| 4 | + fpt: '*' |
| 5 | + ghae: '*' |
| 6 | + ghec: '*' |
| 7 | + ghes: '*' |
| 8 | +topics: |
| 9 | + - Advanced Security |
| 10 | + - Code scanning |
| 11 | + - CodeQL |
| 12 | +type: reference |
| 13 | +product: '{% data reusables.gated-features.codeql %}' |
| 14 | +autogenerated: codeql-cli |
| 15 | +intro: Convert result data from BQRS into other forms. |
| 16 | +--- |
| 17 | + |
| 18 | + |
| 19 | +<!-- Content after this section is automatically generated --> |
| 20 | + |
| 21 | +{% data reusables.codeql-cli.man-pages-version-note %} |
| 22 | + |
| 23 | +## Synopsis |
| 24 | + |
| 25 | +```shell{:copy} |
| 26 | +codeql bqrs decode [--output=<file>] [--result-set=<name>] [--sort-key=<col>[,<col>...]] <options>... -- <file> |
| 27 | +``` |
| 28 | + |
| 29 | +## Description |
| 30 | + |
| 31 | +Convert result data from BQRS into other forms. |
| 32 | + |
| 33 | +The decoded output will be written to standard output, unless the |
| 34 | +`--output` option is specified. |
| 35 | + |
| 36 | +## Primary options |
| 37 | + |
| 38 | +#### `<file>` |
| 39 | + |
| 40 | +\[Mandatory] BQRS file to decode. |
| 41 | + |
| 42 | +#### `-o, --output=<file>` |
| 43 | + |
| 44 | +The file to write the desired output to. |
| 45 | + |
| 46 | +#### `-r, --result-set=<name>` |
| 47 | + |
| 48 | +Select a particular result set from the BQRS file to decode. The |
| 49 | +available results sets can be listed by [codeql bqrs info](/code-security/codeql-cli/codeql-cli-manual/bqrs-info). |
| 50 | + |
| 51 | +If no result set is selected, all result sets will be decoded, provided |
| 52 | +the selected output format and processing options support that. |
| 53 | +Otherwise an error results. |
| 54 | + |
| 55 | +#### `-k, --sort-key=<col>[,<col>...]` |
| 56 | + |
| 57 | +Sort the selected result set by the indicated columns. |
| 58 | + |
| 59 | +#### `--sort-direction=<direction>[,<direction>...]` |
| 60 | + |
| 61 | +Sort the selected result set using the indicated sort directions. |
| 62 | + |
| 63 | +If sort directions are not specified, then ascending order will be used |
| 64 | +for all columns. |
| 65 | + |
| 66 | +### Output format options |
| 67 | + |
| 68 | +#### `--format=<fmt>` |
| 69 | + |
| 70 | +Select output format. Choices include: |
| 71 | + |
| 72 | +`text` *(default)*: A human-readable plain text table. |
| 73 | + |
| 74 | +`csv`: Comma-separated values. |
| 75 | + |
| 76 | +`json`: Streaming JSON. |
| 77 | + |
| 78 | +`bqrs`: BQRS. This must be used with `--output`. Most useful together |
| 79 | +with `--sort-key`. |
| 80 | + |
| 81 | +#### `--no-titles` |
| 82 | + |
| 83 | +Omit column titles for `text` and `csv` formats |
| 84 | + |
| 85 | +#### `--entities=<fmt>[,<fmt>...]` |
| 86 | + |
| 87 | +\[Advanced] Control how result columns of entity type are shown. A |
| 88 | +comma-separated list of the following choices: |
| 89 | + |
| 90 | +`url`: A URL referring to a source location, if the query was compiled |
| 91 | +to produce such URLs for entitity types. |
| 92 | + |
| 93 | +`string`: A string computed by the toString() method in QL, if the query |
| 94 | +was compiled to produce such strings for the column. |
| 95 | + |
| 96 | +`id`: The internal ID of the entity, which may not be informative. |
| 97 | + |
| 98 | +`all`: Show columns with all the information the BQRS file provides. |
| 99 | + |
| 100 | +All the selected options are shown, if possible. |
| 101 | + |
| 102 | +### Options for pagination (for use by interactive front-ends) |
| 103 | + |
| 104 | +#### `--rows=<num>` |
| 105 | + |
| 106 | +\[Advanced] Output this many rows from the selected resultset, starting |
| 107 | +at the top, or at the location given by `--start-at`. |
| 108 | + |
| 109 | +#### `--start-at=<offset>` |
| 110 | + |
| 111 | +\[Advanced] Start printing the row defined at a particular byte offset |
| 112 | +in the BQRS file. The offset must be gotten from [codeql bqrs info](/code-security/codeql-cli/codeql-cli-manual/bqrs-info), or from the "next" pointer found in JSON output from a previous invocation with `--rows` |
| 113 | +set. Other offsets are likely to produce nonsense output and/or explicit |
| 114 | +errors. |
| 115 | + |
| 116 | +Must always be used together with `--rows`, and is incompatible with |
| 117 | +`--sort-key`. |
| 118 | + |
| 119 | +### Common options |
| 120 | + |
| 121 | +#### `-h, --help` |
| 122 | + |
| 123 | +Show this help text. |
| 124 | + |
| 125 | +#### `-J=<opt>` |
| 126 | + |
| 127 | +\[Advanced] Give option to the JVM running the command. |
| 128 | + |
| 129 | +(Beware that options containing spaces will not be handled correctly.) |
| 130 | + |
| 131 | +#### `-v, --verbose` |
| 132 | + |
| 133 | +Incrementally increase the number of progress messages printed. |
| 134 | + |
| 135 | +#### `-q, --quiet` |
| 136 | + |
| 137 | +Incrementally decrease the number of progress messages printed. |
| 138 | + |
| 139 | +#### `--verbosity=<level>` |
| 140 | + |
| 141 | +\[Advanced] Explicitly set the verbosity level to one of errors, |
| 142 | +warnings, progress, progress+, progress++, progress+++. Overrides `-v` |
| 143 | +and `-q`. |
| 144 | + |
| 145 | +#### `--logdir=<dir>` |
| 146 | + |
| 147 | +\[Advanced] Write detailed logs to one or more files in the given |
| 148 | +directory, with generated names that include timestamps and the name of |
| 149 | +the running subcommand. |
| 150 | + |
| 151 | +(To write a log file with a name you have full control over, instead |
| 152 | +give `--log-to-stderr` and redirect stderr as desired.) |
0 commit comments