github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.51k stars 1.49k forks source link

database index-files doesn't work with --db-cluster database #10183

Open PavelBansky opened 2 years ago

PavelBansky commented 2 years ago

Running following command

codeql.exe database index-files --include-extension .definitions --language xml --size-limit 5m --db-cluster D:\a\_temp\d

Returns:

Unknown option: '--db-cluster'

All other database commands do support --db-cluster option

aibaars commented 2 years ago

Only some of the high level commands support --db-cluster, the high level commands are implemented by calling lower level (plumbling) commands that perform specific sub-tasks. The codeql database index-files is such a plumbing command.

For your use case I think you'd have to call codeql database index-files for each of the sub-folders of the database cluster.

codeql database
Usage: codeql database <command> <argument>...
Create, analyze and process CodeQL databases.
Commands:
  create             Create a CodeQL database for a source tree that can be analyzed using one of the CodeQL products.
  analyze            Analyze a database, producing meaningful results in the context of the source code.
  upgrade            Upgrade a database so it is usable by the current tools.
  cleanup            Compact a CodeQL database on disk.
  bundle             Create a relocatable archive of a CodeQL database.
  unbundle           Extracts a CodeQL database archive.
  run-queries        [Plumbing] Run a set of queries together.
  import             [Advanced] [Plumbing] Import unfinalized database(s) into another unfinalized database.
  interpret-results  [Plumbing] Interpret computed query results into meaningful formats such as SARIF or CSV.
  init               [Plumbing] Create an empty CodeQL database.
  trace-command      [Plumbing] Run a single command as part of a traced build.
  print-baseline     [Plumbing] Print a summary of the baseline lines of code seen.
  index-files        [Plumbing] Index standalone files with a given CodeQL extractor.
  finalize           [Plumbing] Final steps in database creation.