fix(docs): fix ClickHouse port inconsistency and add apply-graph-schema.sh
What
- Add
scripts/apply-graph-schema.sh— a robust script to applyconfig/graph.sqlstatement-by-statement against a ClickHouse database - Replace the brittle inline
sed/trpipeline indocs/dev/local-development.mdwith a call to the new script - Clarify the two ClickHouse ports (native TCP 9001 vs HTTP 8123) in the troubleshooting section
Why
The inline sed pipeline in the docs is fragile: the -- comment strip breaks on any -- inside a string literal, and naive ; splitting can mangle statements. The docs also inconsistently reference ports 9001 and 8123 without explaining which is which.
How to test
- Start a local ClickHouse (per
docs/dev/local-development.md) - Run
scripts/apply-graph-schema.shagainstgkg-development - Confirm tables exist:
clickhouse client --port 9001 --database gkg-development --query "SHOW TABLES" - Re-run the script — confirm it is idempotent (no errors)
- Run with
--dry-runto verify statement parsing
Closes #823 (closed)