Table: github_my_gist - Query GitHub Gists using SQL
GitHub Gists are a simple way to share snippets and pastes with others. Gists are Git repositories, which means that you can fork and clone them. Gists can be public or secret, and you can share them with specific people using the GitHub interface.
Table Usage Guide
The github_my_gist
table provides insights into Gists within GitHub. As a developer or GitHub user, explore gist-specific details through this table, including file content, comments, and associated metadata. Utilize it to manage and analyze your Gists, such as those with certain content, the number of comments, and the details of the files in the Gists.
Important Notes
- To query ANY gist that you have access to (including any public gists), use the
github_gist
table.
Examples
List your gists
Identify and review all the gists you have created on GitHub. This is useful for managing and keeping track of your code snippets shared through GitHub.
select *from github_my_gist;
select *from github_my_gist;
List your public gists
Explore which of your code snippets on GitHub are publicly accessible. This is useful for reviewing your open-source contributions and ensuring you're not unintentionally sharing private code.
select *from github_my_gistwhere public;
select *from github_my_gistwhere public = 1;
Summarize your gists by language.
Determine the distribution of your GitHub gists by programming language. This will help you understand the languages you use most frequently when creating gists.
select file ->> 'language' as language, count(*)from github_my_gist g cross join jsonb_array_elements(g.files) filegroup by languageorder by count desc;
select json_extract(file.value, '$.language') as language, count(*)from github_my_gist g, json_each(g.files) as filegroup by languageorder by count(*) desc;
Schema for github_my_gist
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
comments | bigint | The number of comments for the gist. | |
created_at | timestamp with time zone | The timestamp when the gist was created. | |
description | text | The gist description. | |
files | jsonb | Files in the gist. | |
git_pull_url | text | The https url to pull or clone the gist. | |
git_push_url | text | The https url to push the gist. | |
html_url | text | The HTML URL of the gist. | |
id | text | The unique id of the gist. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the user login. |
node_id | text | The Node ID of the gist. | |
owner_id | bigint | The user id (number) of the gist owner. | |
owner_login | text | The user login name of the gist owner. | |
owner_type | text | The type of the gist owner (User or Organization). | |
public | boolean | If true, the gist is public, otherwise it is private. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
updated_at | timestamp with time zone | The timestamp when the gist was last updated. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- github
You can pass the configuration to the command with the --config
argument:
steampipe_export_github --config '<your_config>' github_my_gist