Obtaining a snapshot

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. If a project uses multiple languages, then you can have a snapshot for each language.

Important

A snapshot is usually saved and used as a zip archive. However, to use the snapshot in QL for Visual Studio you need to unzip it first. Once you've unzipped a snapshot, you can select it when running a query.

Here are a few ways to obtain a snapshot to use in QL for VS:

Downloading a snapshot from LGTM

If you log in to LGTM.com, you can download a snapshot from any LGTM project, using the Integrations tab on the project page. The QL snapshot for local analysis section contains the available snapshots.

If you use LGTM Enterprise, then you can also download snapshots from any LGTM Enterprise projects that are visible to you.

Exporting a database from Semmle Core

Every time you analyze a project using Semmle Core, a snapshot is created. You can convert this Semmle Core snapshot into a QL for VS snapshot using the export command:

To export a snapshot from Semmle Core
  1. Open a command prompt on a server where Semmle Core is running.
  2. Check that the environment is set up correctly.
  3. Run odasa export --project projects/<project> --latest where projects/<project> is the relative or absolute path for the project that you want to export.

This creates a snapshot in the directory where you ran the export command.

Note

The --latest flag means that you export the most recently analyzed snapshot for the project that you specified. If you want to export an older snapshot, see the other available flags in the export command reference.

If you create a project using the bootstrap command, you can also choose to export a snapshot automatically at the end of the process.

Related Topics Link IconRelated Topics

JavaScript is not enabled

Your browser currently does not have JavaScript turned on. Please enable JavaScript.

For details of how to do this, see: http://enable-javascript.com/