Before you can write and run queries to analyze a project, you need a snapshot of that project. Each snapshot contains a database for a single language and a copy of the code to show your query results on. If a project uses multiple languages, then you can have a snapshot for each language.
There are a few ways to obtain a snapshot to use in CodeQL for Eclipse.
As of November 2019, "snapshots" have been renamed "CodeQL databases." The QL command-line tools (
odasa) that were previously used to create snapshots have been superseded by a more streamlined tool—the CodeQL CLI. CodeQL databases created with this new CLI are not directly compatible with CodeQL for Eclipse, but you can run an additional command to convert them into the appropriate form. For more information, see the Database compatibility notes in the CodeQL help. You can still download and use CodeQL databases from LGTM as normal.
You can download CodeQL databases to analyze in
You may also analyze databases downloaded from LGTM.com, if they are compatible with your version of the
Creating a database using the CodeQL CLI
You can create and bundle a CodeQL database locally using the new CodeQL CLI. For more information, see Notes for legacy QL CLI users in the CodeQL help.
You can also create a snapshot locally using the QL command-line tools. You can convert this snapshot into the correct format for CodeQL for Eclipse using the export command. For more information, see Exporting data for QL plugins and extensions and LGTM in the QL command-line tools help.
To find out more about snapshots, and how they are created, see What is a snapshot?