Files
Alexey MilovidovandClaude Opus 4.8 4c956bc220 Docs: autogenerate 65 format reference pages from system.formats
Extend the generator to formats (generate-formats.sql + format_generators in
the port, same mechanism as engines). Convert the 65 format pages whose
structured docs reproduce the page (content-neutral / whitespace-only).

Deferred (kept hand-written): pages that include shared Mintlify snippets
(<PrettyFormatSettings/>, <RowBinaryFormatSettings/>, <DataTypeMapping/> from
/snippets/) which the Docusaurus->Mintlify transform can't synthesize, and a
few (Values, HiveText, Arrow, ArrowStream, Parquet) whose structured
description is less complete than the page and needs enriching.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-12 20:52:34 +00:00

21 lines
1.0 KiB
SQL

-- Format documentation generator.
-- Usage: one page per format, driven by the doc page's basename, e.g.:
-- clickhouse --param_format='JSONEachRow' --queries-file generate-formats.sql
--
-- system.formats.description holds the full Markdown body of the format's
-- reference page (populated from the `Documentation` attached via
-- FormatFactory::setDocumentation). We emit that body verbatim; the Python
-- port then applies the same Docusaurus->Mintlify body transforms it runs on
-- migrated pages. The page basename is matched to the format name case- and
-- separator-insensitively; format aliases carry only a short "Alias of ..."
-- description, so notEmpty()+LIMIT 1 selects the canonical format. Pages that
-- are not a single format (index) produce no output and are skipped.
SELECT description
FROM system.formats
WHERE lower(replaceRegexpAll(name, '[^0-9a-zA-Z]', ''))
= lower(replaceRegexpAll({format:String}, '[^0-9a-zA-Z]', ''))
AND notEmpty(description)
ORDER BY name ASC
LIMIT 1
INTO OUTFILE 'temp-format.md' TRUNCATE FORMAT LineAsString