codeql_databases
Creates, updates, deletes, gets or lists a codeql_databases resource.
Overview
| Name | codeql_databases |
| Type | Resource |
| Id | github.code_scanning.codeql_databases |
Fields
The following fields are returned by SELECT queries:
- get_codeql_database
- list_codeql_databases
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The ID of the CodeQL database. |
name | string | The name of the CodeQL database. |
commit_oid | string | The commit SHA of the repository at the time the CodeQL database was created. |
content_type | string | The MIME type of the CodeQL database file. |
created_at | string (date-time) | The date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. |
language | string | The language of the CodeQL database. |
size | integer | The size of the CodeQL database file in bytes. |
updated_at | string (date-time) | The date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. |
uploader | object | A GitHub user. (title: Simple User) |
url | string (uri) | The URL at which to download the CodeQL database. The Accept header must be set to the value of the content_type property. |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The ID of the CodeQL database. |
name | string | The name of the CodeQL database. |
commit_oid | string | The commit SHA of the repository at the time the CodeQL database was created. |
content_type | string | The MIME type of the CodeQL database file. |
created_at | string (date-time) | The date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. |
language | string | The language of the CodeQL database. |
size | integer | The size of the CodeQL database file in bytes. |
updated_at | string (date-time) | The date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. |
uploader | object | A GitHub user. (title: Simple User) |
url | string (uri) | The URL at which to download the CodeQL database. The Accept header must be set to the value of the content_type property. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_codeql_database | select | owner, repo, language | Gets a CodeQL database for a language in a repository. By default this endpoint returns JSON metadata about the CodeQL database. To download the CodeQL database binary content, set the Accept header of the requestto application/zip, and make sureyour HTTP client is configured to follow redirects or use the Location headerto make a second request to get the redirect URL. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories. | |
list_codeql_databases | select | owner, repo | Lists the CodeQL databases that are available in a repository. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories. | |
delete_codeql_database | delete | owner, repo, language | Deletes a CodeQL database for a language in a repository. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
language | string | The language of the CodeQL database. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_codeql_database
- list_codeql_databases
Gets a CodeQL database for a language in a repository.
By default this endpoint returns JSON metadata about the CodeQL database. To
download the CodeQL database binary content, set the Accept header of the request
to application/zip, and make sure
your HTTP client is configured to follow redirects or use the Location header
to make a second request to get the redirect URL.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.
SELECT
id,
name,
commit_oid,
content_type,
created_at,
language,
size,
updated_at,
uploader,
url
FROM github.code_scanning.codeql_databases
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND language = '{{ language }}' -- required
;
Lists the CodeQL databases that are available in a repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.
SELECT
id,
name,
commit_oid,
content_type,
created_at,
language,
size,
updated_at,
uploader,
url
FROM github.code_scanning.codeql_databases
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;
DELETE examples
- delete_codeql_database
Deletes a CodeQL database for a language in a repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.
DELETE FROM github.code_scanning.codeql_databases
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND language = '{{ language }}' --required
;