Skip to content

v0.5.0: Feed COPY import and export

Choose a tag to compare

@rustyconover rustyconover released this 13 Nov 04:17
· 13 commits to main since this release

vgi-feed can now import feed documents directly into DuckDB tables and generate RSS, Atom, and JSON Feed documents from SQL query results.

  • COPY FROM ... (FORMAT 'feed.auto') fetches HTTP(S) URLs or reads worker-local files, detecting RSS, Atom, and JSON Feed automatically. It matches destination columns by name and supports subsets, reordered columns, timeout_ms, and an explicit max_items cap. Imports default to all items instead of the table function's 1,000-item default.
  • COPY TO supports feed.rss (RSS 2.0), feed.atom (Atom 1.0), and feed.jsonfeed (JSON Feed 1.1), with feed title, home-page link, description, language, and author options. Writers preserve query order, generate missing IDs, handle empty feeds, and replace destination files only after successful encoding.
  • URL examples now cover querying, metadata inspection, table creation, and Parquet export. The README also documents the COPY formats, column mapping, limits, and container/remote-worker file paths.
  • Oversized HTTP responses now raise an explicit error instead of passing a truncated document to the parser.
INSTALL vgi FROM community;
LOAD vgi;
ATTACH 'feed' AS feed
  (TYPE vgi, LOCATION 'github-auto://Query-farm/vgi-feed@v0.5.0');

CREATE TABLE items AS SELECT * FROM feed.feed_items(NULL);
COPY items FROM 'https://hnrss.org/frontpage' (FORMAT 'feed.auto');

COPY (SELECT * FROM items ORDER BY seq) TO 'headlines.xml'
  (FORMAT 'feed.rss', title 'Headlines', link 'https://example.com',
   description 'Recent headlines');

Requires a VGI client compatible with protocol 3.3.0. COPY exports write to the worker's filesystem; mount a writable directory when running in Docker. Imports reject documents over 64 MiB and enforce a one-million-item safety ceiling. Exports enforce 64 MiB serialized-input and output limits plus the same item ceiling. The exported fields are the normalized feed_items columns, not a lossless representation of all feed extensions.

Validation includes Go tests, vet, golangci-lint, VGI metadata/execution checks, and SQL integration tests over stdio, HTTP, and Unix sockets, including 5,000-item ordered round trips and failed-write preservation.

Full changelog: v0.4.0...v0.5.0