Skip to content

v0.1.0

Choose a tag to compare

@rustyconover rustyconover released this 27 Sep 22:46
· 29 commits to main since this release

The first release: Bluesky as ordinary DuckDB tables — posts, threads, profiles, the follow graph, likes, reposts, quotes, custom feeds, trending topics, and the live firehose via Jetstream. Read-only and public: no credentials, no account.

ATTACH 'bluesky' (TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-bluesky@v0.1.0 vgi-bluesky');

What's in it

  • trends — what Bluesky reports as trending, in rank order.
  • Lookups that compose under a correlated LATERAL, batched 25 to a request: profile, post, thread.
  • Listings that stream one API page per batch, so a LIMIT stops early — bsky.app alone has 35 million followers: search_actors, followers, follows, author_feed, likes, reposted_by, quotes, feed, popular_feeds, actor_feeds.
  • search_posts, with author and time predicates pushed to the API — only where that is provably no narrower.
  • jetstream() — every post, like, repost, follow and block on the network, about 400 events a second.

Actors can be given as a handle, a DID, @handle or a pasted profile URL; posts and feeds as an AT-URI or the bsky.app URL the app shows.

The firehose

-- The most-liked posts of the last 30 seconds, hydrated through post()
SELECT p.author_handle, p.text, j.likes
FROM (SELECT subject_uri, count(*) AS likes
      FROM bluesky.jetstream(collections => 'app.bsky.feed.like', seconds => 30)
      WHERE subject_uri LIKE '%/app.bsky.feed.post/%'
      GROUP BY subject_uri ORDER BY likes DESC LIMIT 5) j,
     LATERAL bluesky.post(j.subject_uri) p;
  • Bounded or endless. A call stops at seconds (default 10), max_events, a LIMIT, or an upper bound on event_time — or never, with seconds => 0. Each batch closes at batch_events or batch_ms.
  • Replay from Jetstream's ~36-hour buffer with cursor or a WHERE event_time >= …; a range replays exactly that window and stops.
  • Gapless polling. Feed the highest time_us back as cursor: it resumes after that event (Jetstream's own cursor is inclusive). Three chained polls were verified to return exactly the events of one continuous read.

Important

Streaming to a DuckDB client: SET streaming_buffer_size = '1KB' first. DuckDB holds a streaming result until ~1 MB (976.5 KiB) has accumulated. A firehose of small rows is slow to fill that — with the default, an endless scan delivered nothing to the client in 90 seconds, even though rows were passing through DuckDB's pipeline every second. With a 1 KB buffer, batches arrive about once a second over both stdio and HTTP ATTACH.

Verified

316 offline tests; 28 live tests against the public API, Jetstream and a real ATTACH; vgi-lint 100/100 with every shipped example executed. See the README and CHANGELOG for the design notes, including what the probes found: search's 403 on a cursor, getPosts' 500 on a handle URI, and a ten-second WebSocket close.