
GitHub as ordinary DuckDB tables — a read-only VGI worker. Repositories, issues, pull requests, commits, releases, contributors and Actions runs, over SQL with LATERAL joins.
Repo Query-farm/vgi-github, read from GitHub 1 d ago. Query-farm has not joined Take My Repo.
Full Changelog: v0.3.0...v0.3.1
Speaks VGI protocol 3.3 (vgi-python 0.51.0) and requires the current VGI DuckDB extension; 3.2 extensions are incompatible. The github secret type now documents its token parameter and links to how to create one.
vgi-github now speaks VGI protocol 3.2 (vgi-python 0.50.0, vgi-rpc 0.53.1). This release also adds typed Discussions and Projects tables, a generated rest schema covering every GitHub GET operation, and query-only GraphQL.
INSTALL vgi FROM community; LOAD vgi; ATTACH 'github' (TYPE vgi, LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-github@v0.2.0 vgi-github'); CREATE SECRET github (TYPE github, token 'ghp_...'); -- optional
main.discussions, discussion_comments and discussion_replies come through GraphQL, and projects, project_items and project_fields through REST. They paginate automatically within bounds, take named filters and work inside correlated LATERAL joins. Custom Project field values stay JSON.rest schema has all 780 distinct GET operations from the pinned GitHub.com and Enterprise Cloud API descriptions. api.endpoints lists them and api.rest() calls any of them. Complete JSON, HTTP statuses, binary downloads and pagination links come through intact.api.graphql() runs queries only. The worker parses every document before sending it and rejects mutations, subscriptions and schema definitions.cache_ttl ATTACH option: sets a default result TTL for lookups and searches. A per-call TTL overrides it.token_source ATTACH option: 'gh' uses the GitHub CLI's login and 'env' uses GH_TOKEN/GITHUB_TOKEN. An HTTP or socket server refuses it unless started with VGI_GITHUB_ALLOW_TOKEN_SOURCE=1.duckdb_logs_parsed('VGI')).catalog_contents loads the whole catalog in one RPC.GitHub API and there is a one-sentence vgi.subtitle. CI now lints with vgi-lint-check 2.2.0 and fails on info-level findings.vgi-agent-tests.yaml.See CHANGELOG.md for the full list.
GitHub as DuckDB tables: repositories, issues, pull requests, commits, releases, contributors and Actions runs, all read-only, and every per-repository function works inside a LATERAL join.
INSTALL vgi FROM community; LOAD vgi; ATTACH 'github' (TYPE vgi, LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-github@v0.1.0 vgi-github'); CREATE SECRET github (TYPE github, token 'ghp_...'); -- optional, see below
The search functions take GitHub's own query syntax and stream results, so they make a good starting point. Each row's full_name then feeds any per-repository function:
-- Open issues across an organization's five most-starred repositories SELECT r.full_name, count(i.number) AS open_issues FROM (SELECT full_name FROM github.search_repositories('org:duckdb', sort => 'stars') LIMIT 5) r, LATERAL github.issues(r.full_name, state => 'open') i GROUP BY r.full_name ORDER BY open_issues DESC; -- Where a project's top contributors say they work SELECT c.login, c.contributions, u.company, u.location FROM github.contributors('duckdb/duckdb', max_rows => 10) c, LATERAL github.user(c.login, cache_ttl => 3600) u ORDER BY c.contributions DESC; -- CI failure rate per workflow SELECT name, count(*) FILTER (WHERE conclusion = 'failure') / count(*) AS failure_rate FROM github.workflow_runs('duckdb/duckdb', status => 'completed') GROUP BY name ORDER BY failure_rate DESC;
List functions return up to max_rows rows per input row (100 by default, which is one request). Filter with their arguments, like state =>, since => and branch =>, rather than WHERE, because a WHERE only sees the rows that were already fetched.
Without a token GitHub allows 60 requests an hour; with one, 5,000, and private repositories become visible. Use a DuckDB secret of type github; it can have any name. Attach with auth 'required' if a missing token should be an error rather than a quiet fall back to anonymous access.
Run one long-lived server instead of a worker per connection:
uvx --from git+https://github.com/Query-farm/vgi-github@v0.1.0 vgi-github-http --port 8000
ATTACH 'github' (TYPE vgi, LOCATION 'http://localhost:8000'); CREATE SECRET github (TYPE github, token 'ghp_...');
Each client sends its own token, and one client's token never authorizes another's queries. The server doesn't authenticate clients itself, though, so keep it on localhost or put it behind a proxy, and don't set VGI_GITHUB_TOKEN on a shared server unless you mean every client to use that token. The README covers --host, --prefix and the other options.
duckdb_functions() can show named arguments with each other's types. Queries are unaffected, and vgi_function_arguments() reports them correctly. A fix is proposed upstream in duckdb/duckdb#26409.stargazers() only works for repositories your token administers, because GitHub refuses the listing for anyone else's. repo() still gives you stargazers_count.