docs: add godoc comments to core APIs and improve README#18
Merged
AWaterColorPen merged 1 commit intomainfrom Apr 10, 2026
Merged
docs: add godoc comments to core APIs and improve README#18AWaterColorPen merged 1 commit intomainfrom
AWaterColorPen merged 1 commit intomainfrom
Conversation
Phase 1 tasks: Add godoc documentation for core APIs + Improve README Quick Start. - manager.go: package-level doc, Manager type, all public methods - client.go: ClientsOption, Clients type, all public methods - configuration.go: Configuration struct with field comments - database.go: DBOption struct with field docs, NewDB, getDialect - dictionary.go: Option, Dictionary, Translate, NewDictionary - run.go: RunChan, RunSync, BuildResultChan, BuildResultSync README improvements: - Architecture diagram showing query → dictionary → SQL → result flow - Complete runnable Quick Start with NewManager, BuildSQL, RunSync - Common patterns section: filters, streaming with RunChan, SQL inspection - Requirements section noting Go 1.22+ minimum - Cleaner documentation table
AWaterColorPen
commented
Apr 6, 2026
Owner
Author
AWaterColorPen
left a comment
There was a problem hiding this comment.
AI Review — LGTM ✅
Solid documentation PR. Notes:
README improvements:
- The ASCII architecture diagram clearly explains the
Query → Dictionary → Clause → SQL → Resultpipeline. - The end-to-end Quick Start example with a complete
main.go, generated SQL, and expected JSON output is exactly what new users need. - "Common Patterns" section (filters,
RunChan,BuildSQL) covers the most practical use cases. - Requirement callout (Go 1.22+) prevents silent breakage for users on older toolchains.
godoc comments:
- All public types and methods are covered across
manager.go,client.go,configuration.go,database.go,dictionary.go, andrun.go. - Comments follow Go conventions: sentences start with the identifier name, each explains what the symbol does and when to use it.
- The
Configurationstruct comments correctly note the optional semantics of each field. - Package-level doc in
manager.goincludes a minimal runnable example — good forpkg.go.dev.
No logic changes — purely additive documentation. CI passes. ✅
Ready to merge.
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.
Description
This PR completes two Phase 1 tasks:
Task: Add godoc comments (core API)
Added package-level and type/method-level documentation to the 6 core source files:
manager.go— package doc,Managertype, all public methods (GetClients,GetDictionary,SetLogger,RunSync,RunChan,BuildTransaction,BuildSQL,NewManager)client.go—ClientsOption,Clientstype, all public methods (RegisterByKV,RegisterByOption,SetLogger,Get,BuildDB,BuildSQL,NewClients)configuration.go—Configurationstruct with field-level commentsdatabase.go—DBOptionstruct with DSN format examples,NewDB,getDialectdictionary.go—Option,Dictionary,Translator,Translate,NewDictionaryrun.go—RunChan,RunSync,BuildResultChan,BuildResultSyncTask: Improve README (Quick Start)
Query → Dictionary → Clause → SQL → Database → ResultflowNewManager,BuildSQL,RunSyncRunChan, inspecting SQL without executingPhase 1 Status after this PR
Phase 1 is complete after this PR merges!