mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
Table-engine reference pages duplicated the structured `Documentation` that is already attached at registerStorage time and exposed via system.table_engines. Generate them instead, the same way settings and functions are generated. - ci/.../sql/generate-table-engines.sql: emit an engine's page body from system.table_engines.description, matching the doc page's basename to the engine name case/separator-insensitively. Concept pages match no engine, produce empty output, and are skipped. - autogenerate_docs.py: discover engine .mdx pages carrying the AUTOGENERATED markers (one generator per engine, like aggregate functions) and regenerate their body. Whole-page bodies need the full Docusaurus->Mintlify pipeline, so route them through a new full-body transform. - migrate.py: extract migrate_file's body pipeline into transform_body_content so generated pages get byte-for-byte the same treatment as migrated pages from a single source of truth (behavior-preserving refactor). - Convert the 20 engine pages whose structured docs are already in sync with the page into autogenerated stubs. Verified content-neutral: regenerating reproduces each page exactly (git diff shows only the marker lines), and --check drift mode passes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
22 lines
1.1 KiB
SQL
22 lines
1.1 KiB
SQL
-- Table-engine documentation generator.
|
|
-- Usage: one page per engine, driven by the doc page's basename, e.g.:
|
|
-- clickhouse --param_engine='mergetree' --queries-file generate-table-engines.sql
|
|
--
|
|
-- system.table_engines.description holds the full Markdown body of the engine's
|
|
-- reference page (populated from the `Documentation` attached at registerStorage
|
|
-- time). We emit that body verbatim; the Python port then applies the same
|
|
-- Docusaurus->Mintlify body transforms it runs on migrated pages.
|
|
--
|
|
-- The page basename (`mergetree`, `embedded-rocksdb`, `time-series`, ...) is
|
|
-- matched to the engine name (`MergeTree`, `EmbeddedRocksDB`, `TimeSeries`, ...)
|
|
-- case- and separator-insensitively, so pages that are not engines (concept
|
|
-- pages such as `replication` or `annindexes`) produce no output and are skipped.
|
|
SELECT description
|
|
FROM system.table_engines
|
|
WHERE lower(replaceRegexpAll(name, '[^0-9a-zA-Z]', ''))
|
|
= lower(replaceRegexpAll({engine:String}, '[^0-9a-zA-Z]', ''))
|
|
AND notEmpty(description)
|
|
ORDER BY name ASC
|
|
LIMIT 1
|
|
INTO OUTFILE 'temp-table-engine.md' TRUNCATE FORMAT LineAsString
|