# CodeQL: create and query a source database Create and query a source database. ## 1. Run the example [Download the CodeQL example](https://www.security.run/docs/examples/codeql.zip). Extract it, install `httpx`, set your API URL and token, then run `python client.py`. The client uploads the included inputs, submits the command, and saves the result under `results/RUN_ID`. ## 2. Check the result Read report.sarif for the query findings. Keep db.zip to reuse the database. Read the native exit code and cleanup status printed by the client. [Read results and save reports](https://www.security.run/docs/visibility.html) explains the returned files. ## 3. Use your own inputs Edit `example.json` to change the command arguments, requested outputs or deadline. Replace the files under `inputs/` with your own data, keeping the staged paths aligned with the command. The client creates the artifact IDs for you; illustrative IDs shown here must not be copied into a live request. ### Files used by this example - `analyze.py` - `src/app.js` The example uses supplied files or the disposable execution environment. Nothing from the environment carries into a later run unless you request and reuse its output. Qualified version: `2.27.4`. Commands: `codeql`, `python`. - Includes language extractors, a JVM and query packs under /opt/qlpacks; point --search-path at the selected pack/version directory listed in data\_assets. Additional build SDKs and project dependencies may be required. Linux ARM64 support is upstream beta. Inspect `GET /v1/tools/codeql` for the current installed version and readiness. The published snapshot has 2 functional case(s), plus timeout and cancellation checks. These examples demonstrate the native path; other flags and inputs are supported within the tool’s runtime limits. ## Command submitted by the example ```json { "tool": "codeql", "timeout_seconds": 90, "invocation": { "args": [ "analyze.py" ], "outputs": [ "report.sarif", "db.zip" ], "success_exit_codes": [ 0 ], "executable": "python", "files": [ { "path": "analyze.py", "artifact_id": "artifact_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "executable": false }, { "path": "src/app.js", "artifact_id": "artifact_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "executable": false } ] } } ```