FORMAT 'feed.atom'
COPY … TO · exportCOPY atom feed. Export feed items to a worker-local file, preserving query order.
-- Write a query's rows out to a file
COPY (SELECT * FROM my_table) TO 'out.atom' (FORMAT 'feed.atom');
Options
Pass these inside the COPY statement's parentheses, after FORMAT. Unknown options are rejected.
- titleVARCHAR
- Required feed title
- linkVARCHAR
- Required absolute HTTP or HTTPS home-page URL
- descriptionVARCHAR
- Feed description; required for RSS
- languageVARCHAR
- Feed language code
- authorVARCHAR
- Feed author name; defaults to the feed title for Atom
Full reference
Generate a atom feed
Export atom using COPY TO a worker-local file. Source columns are matched by feed_items column names and types. title and link options are required; RSS also requires description. Optional language and author describe the feed. Use ORDER BY to choose item order. Missing item IDs are generated deterministically; Atom dates default to the export time.
Input and output
Alias and cast source columns to the item schema; subsets are supported. This is a sink with no result columns. DuckDB reports the COPY row count. Every item needs title, summary, or content; Atom requires a title. Empty input produces a valid empty feed.
Example
COPY (SELECT 'First post' AS title, 'https://example.com/1' AS link)
TO '/tmp/posts.feed' (FORMAT 'feed.atom', title 'Posts', link 'https://example.com', description 'Recent posts');
Limits
Only worker-local destinations are supported. Buffered input and encoded output are limited to 64 MiB, and exports to one million items. The destination is replaced after successful encoding.