Experimental gh:// filesystem support
Maintainer(s):
carlopi
Installing and Loading
INSTALL gh FROM community;
LOAD gh;
Example
-- Read a CSV straight from GitHub
SELECT * FROM read_csv('gh://duckdb/duckdb@main/data/csv/issue2934.csv') LIMIT 5;
-- Star counts for all DuckDB repos
SELECT name, stargazers_count, language
FROM gh_repo('duckdb/*')
ORDER BY stargazers_count DESC;
-- Open issues for a repo
SELECT number, title, labels
FROM gh_issues('duckdb/duckdb')
ORDER BY number DESC
LIMIT 20;
-- Recursively read all CSVs under a directory
SELECT count(*) FROM read_csv('gh://duckdb/duckdb@main/data/csv/glob/**/*.csv');
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| gh_issues | table | Fetches GitHub issues for a repository as a table, one row per issue. Pull requests are excluded. Paginates automatically. The optional 'state' parameter filters by issue state: 'open' (default), 'closed', or 'all'. | NULL | [SELECT number, title, user FROM gh_issues('duckdb/duckdb');, SELECT number, title FROM gh_issues('duckdb/duckdb', state := 'closed') ORDER BY closed_at DESC;, SELECT count(*) FROM gh_issues('duckdb/duckdb', state := 'all');] |
| gh_repo | table | Fetches GitHub repository metadata for a single repository or all repositories for an org/user. Pass 'owner/repo' for one repo, or 'owner/*' to expand to all repos belonging to that org or user. | NULL | [SELECT name, stargazers_count, language FROM gh_repo('duckdb/duckdb');, SELECT name, stargazers_count FROM gh_repo('my-org/*') ORDER BY stargazers_count DESC;] |
| gh_repos | table | Table in-out function that fetches GitHub repository metadata for each 'owner/repo' string in the input table. 'owner/*' rows are expanded to all repositories for that org or user. Accepts any subquery or VALUES list that returns a single VARCHAR column. | NULL | [SELECT name, stargazers_count FROM gh_repos((VALUES ('duckdb/duckdb'), ('duckdb/pg_duckdb')));, SELECT r.name, r.language FROM my_repos, gh_repos((SELECT repo_name FROM my_repos)) r;] |
Overloaded Functions
| function_name | function_type | description | comment | examples | |—————|—————|————-|———|———-|
Added Types
| type_name | type_size | logical_type | type_category | internal | |———–|———-:|————–|—————|———-|
Added Settings
| name | description | input_type | scope | aliases | |——|————-|————|——-|———|