docs(readme): sync with code, document AST layer and correct dialect claims - #15
Merged
Conversation
…claims The README had drifted from the code in ways that would mislead a reader rather than merely omit detail. Broken or wrong: - CI badges pointed at tests.yml/integration.yml, neither of which exists; the repo has ci.yml, baseline.yml, linter.yml, static-analysis.yml. - The aggregations example claimed `HAVING \`total\` > ?`. The builder expands an aggregate alias back to its expression, so it emits `HAVING COUNT(*) > ?` -- standard SQL forbids aliases in HAVING. - The wire-protocol section listed seven write keywords that actually classify as Unknown (RENAME, REPLACE, LOAD, MERGE, EXECUTE, HANDLER, IMPORT) while omitting the real one (LOCK); put SAVEPOINT/RELEASE/SET under TransactionEnd when they return Type::Transaction; omitted the Transaction case entirely; named COM_INIT_DB/COM_QUIT, which do not exist; and claimed the PostgreSQL parser handles X and startup messages, which fall through to Unknown, while omitting B and E. Overstated UnsupportedException claims -- these are worse than omissions because the documented failure mode was loud and the real one is silent: - Column-level ttl() is ignored outside ClickHouse, not rejected. - MongoDB drops CHECK constraints and generated columns silently, and maps SERIAL to int rather than throwing. - SQLite supports foreign keys inline via foreignKey($column); only the ALTER-based form is absent. The inline form was undocumented. - ClickHouse procedures/triggers are absent from the class, so calling them is a fatal error, not a catchable exception. Dialect drift: MariaDB was missing from five capability lists it inherits from MySQL; Upsert was attributed to Builder\SQL, which does not implement it; SQLite was missing from String Aggregates; vector was "PostgreSQL only" but also exists on ClickHouse and MongoDB; partitions were claimed on ClickHouse, which has only its own partitionBy(). The Feature Matrix is rebuilt from the actual implements clauses. The AST and tokenizer subsystems had no coverage at all, so this adds a section for them, plus the executor pattern, materialized views, renameIndex, database and analyze DDL, and the Query factories and modifiers that were missing. Query::elemMatch() is documented as compilable only by a custom Compiler, since every bundled builder rejects it, and groupByTimeBucket is scoped to ClickHouse. Every documented output in the new and corrected content was produced by executing the code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
📊 Coverage
Full per-file breakdown in the job summary. |
Contributor
Greptile SummaryThe PR comprehensively updates the README to match the library’s current APIs and dialect behavior.
Confidence Score: 5/5The documentation-only PR appears safe to merge with no actionable inaccuracies identified. The changed API examples and capability statements checked against source and tests match the implemented interfaces, method signatures, traversal behavior, and builder round-trip contract. Important Files Changed
Reviews (1): Last reviewed commit: "docs(readme): sync with code, document A..." | Re-trigger Greptile |
This was referenced Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The README had drifted from the code. Most of this is correcting claims that would actively mislead a reader, not just filling gaps.
Every documented output in the new and corrected content was produced by executing the code against
src/.Broken or wrong
tests.yml/integration.ymlci.yml,baseline.yml,linter.yml,static-analysis.ymlHAVING `total` > ?HAVING COUNT(*) > ?— the builder expands the aggregate alias, since SQL forbids aliases inHAVINGRENAME,REPLACE,LOAD,MERGE,EXECUTE,HANDLER,IMPORTType::Unknown. The real one it omitted isLOCKSAVEPOINT/RELEASE/SET→TransactionEndType::Transaction, a case the README never mentionedCOM_INIT_DB,COM_QUITXand startup messagesUnknown;BandEare handled but were undocumentedOverstated
UnsupportedExceptionclaimsWorse than omissions, because the documented failure mode was loud and the real one is silent:
ttl()is silently ignored outside ClickHouse.int.foreignKey($column)— only the ALTER-based form is absent. The inline form was undocumented entirely.Error, not a catchable exception.Dialect drift
MariaDB was missing from five capability lists it inherits from MySQL.
Upsertwas attributed toBuilder\SQL, which does not implement it. SQLite was missing from String Aggregates.vectorwas "PostgreSQL only" but exists on ClickHouse and MongoDB too. Partitions were claimed on ClickHouse, which has only its ownpartitionBy(). The Feature Matrix is rebuilt from the actualimplementsclauses.Added
src/Query/AST/andsrc/Query/Tokenizer/had zero coverage. Tokenizer, recursive-descent parser, dialect serializers,Walker/Visitorwith the three shipped visitors, andtoAst()/fromAst()round-trip.setExecutor(),execute(),Statement::withExecutor().renameIndex(),createDatabase/dropDatabase,analyzeTable(), inlineforeignKey(),srid()/dimensions(),Query::distinct/fingerprint/getCursorQueries, the full date-helper set,NullsPositionordering,ParsedQuery::$timeBuckets.Two code issues surfaced while verifying
Documented as-is here; both are worth separate fixes:
Query::elemMatch()is a dead factory. It serializes fine but no builder compiles it — all six throw. Documented as usable only by consumers implementing their ownCompiler.groupByTimeBucketon MongoDB silently drops the bucket instead of rejecting it. Scoped the docs to ClickHouse.Test plan
composer test— 5299 tests, 12289 assertions, all passcomposer lint— pass🤖 Generated with Claude Code