{"meta":{"title":"bqrs decode","intro":"Convert result data from BQRS into other forms.","product":"Security and code quality","breadcrumbs":[{"href":"/en/code-security","title":"Security and code quality"},{"href":"/en/code-security/reference","title":"Reference"},{"href":"/en/code-security/reference/code-scanning","title":"Code scanning"},{"href":"/en/code-security/reference/code-scanning/codeql","title":"CodeQL"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual","title":"CodeQL CLI manual"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual/bqrs-decode","title":"bqrs decode"}],"documentType":"article"},"body":"# bqrs decode\n\nConvert result data from BQRS into other forms.\n\n> \\[!NOTE]\n> This content describes the most recent release of the CodeQL CLI. For more information about this release, see <https://github.com/github/codeql-cli-binaries/releases>.\n>\n> To see details of the options available for this command in an earlier release, run the command with the <span style=\"white-space: nowrap;\">`--help`</span> option in your terminal.\n\n## Synopsis\n\n```shell copy\ncodeql bqrs decode [--output=<file>] [--result-set=<name>] [--sort-key=<col>[,<col>...]] <options>... -- <file>\n```\n\n## Description\n\nConvert result data from BQRS into other forms.\n\nThe decoded output will be written to standard output, unless the\n`--output` option is specified.\n\n## Options\n\n### Primary Options\n\n#### `<file>`\n\n\\[Mandatory] BQRS file to decode.\n\n#### `-o, --output=<file>`\n\nThe file to write the desired output to.\n\n#### `-r, --result-set=<name>`\n\nSelect a particular result set from the BQRS file to decode. The\navailable results sets can be listed by [codeql bqrs info](/en/code-security/reference/code-scanning/codeql/codeql-cli-manual/bqrs-info).\n\nIf no result set is selected, all result sets will be decoded, provided\nthe selected output format and processing options support that.\nOtherwise an error results.\n\n#### `-k, --sort-key=<col>[,<col>...]`\n\nSort the selected result set by the indicated columns.\n\n#### `--sort-direction=<direction>[,<direction>...]`\n\nSort the selected result set using the indicated sort directions.\n\nIf sort directions are not specified, then ascending order will be used\nfor all columns.\n\n### Output format options\n\n#### `--format=<fmt>`\n\nSelect output format. Choices include:\n\n`text` *(default)*: A human-readable plain text table.\n\n`csv`: Comma-separated values.\n\n`json`: Streaming JSON.\n\n`bqrs`: BQRS. This must be used with `--output`. Most useful together\nwith `--sort-key`.\n\n#### `--no-titles`\n\nOmit column titles for `text` and `csv` formats\n\n#### `--entities=<fmt>[,<fmt>...]`\n\n\\[Advanced] Control how result columns of entity type are shown. A\ncomma-separated list of the following choices:\n\n`url`: A URL referring to a source location, if the query was compiled\nto produce such URLs for entity types.\n\n`string`: A string computed by the toString() method in QL, if the query\nwas compiled to produce such strings for the column.\n\n`id`: The internal ID of the entity, which may not be informative.\n\n`all`: Show columns with all the information the BQRS file provides.\n\nAll the selected options are shown, if possible.\n\n### Options for pagination (for use by interactive front-ends)\n\n#### `--rows=<num>`\n\n\\[Advanced] Output this many rows from the selected resultset, starting\nat the top, or at the location given by `--start-at`.\n\n#### `--start-at=<offset>`\n\n\\[Advanced] Start printing the row defined at a particular byte offset\nin the BQRS file. The offset must be gotten from [codeql bqrs info](/en/code-security/reference/code-scanning/codeql/codeql-cli-manual/bqrs-info), or from the \"next\" pointer found in JSON output from a previous invocation with `--rows`\nset. Other offsets are likely to produce nonsense output and/or explicit\nerrors.\n\nMust always be used together with `--rows`, and is incompatible with\n`--sort-key`.\n\n### Common options\n\n#### `-h, --help`\n\nShow this help text.\n\n#### `-J=<opt>`\n\n\\[Advanced] Give option to the JVM running the command.\n\n(Beware that options containing spaces will not be handled correctly.)\n\n#### `-v, --verbose`\n\nIncrementally increase the number of progress messages printed.\n\n#### `-q, --quiet`\n\nIncrementally decrease the number of progress messages printed.\n\n#### `--verbosity=<level>`\n\n\\[Advanced] Explicitly set the verbosity level to one of errors,\nwarnings, progress, progress+, progress++, progress+++. Overrides `-v`\nand `-q`.\n\n#### `--logdir=<dir>`\n\n\\[Advanced] Write detailed logs to one or more files in the given\ndirectory, with generated names that include timestamps and the name of\nthe running subcommand.\n\n(To write a log file with a name you have full control over, instead\ngive `--log-to-stderr` and redirect stderr as desired.)\n\n#### `--common-caches=<dir>`\n\n\\[Advanced] Controls the location of cached data on disk that will\npersist between several runs of the CLI, such as downloaded QL packs and\ncompiled query plans. If not set explicitly, this defaults to a\ndirectory named `.codeql` in the user's home directory; it will be\ncreated if it doesn't already exist.\n\nAvailable since `v2.15.2`."}