Skip to content

docs: add godoc comments to core APIs and improve README#18

Merged
AWaterColorPen merged 1 commit intomainfrom
feature/godoc-and-readme
Apr 10, 2026
Merged

docs: add godoc comments to core APIs and improve README#18
AWaterColorPen merged 1 commit intomainfrom
feature/godoc-and-readme

Conversation

@AWaterColorPen
Copy link
Copy Markdown
Owner

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, Manager type, all public methods (GetClients, GetDictionary, SetLogger, RunSync, RunChan, BuildTransaction, BuildSQL, NewManager)
  • client.goClientsOption, Clients type, all public methods (RegisterByKV, RegisterByOption, SetLogger, Get, BuildDB, BuildSQL, NewClients)
  • configuration.goConfiguration struct with field-level comments
  • database.goDBOption struct with DSN format examples, NewDB, getDialect
  • dictionary.goOption, Dictionary, Translator, Translate, NewDictionary
  • run.goRunChan, RunSync, BuildResultChan, BuildResultSync

Task: Improve README (Quick Start)

  • Added architecture diagram showing Query → Dictionary → Clause → SQL → Database → Result flow
  • Complete runnable Quick Start example with NewManager, BuildSQL, RunSync
  • Common patterns section: adding filters, streaming with RunChan, inspecting SQL without executing
  • Requirements section noting Go 1.22+ minimum
  • Cleaner documentation table linking to existing docs

Phase 1 Status after this PR

  • Upgrade Go to 1.24
  • Upgrade patch dependencies
  • All tests passing
  • Go syntax modernization (range over integers)
  • Improve README with Quick Start
  • Add godoc comments (core APIs)

Phase 1 is complete after this PR merges!

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
Copy link
Copy Markdown
Owner Author

@AWaterColorPen AWaterColorPen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review — LGTM ✅

Solid documentation PR. Notes:

README improvements:

  • The ASCII architecture diagram clearly explains the Query → Dictionary → Clause → SQL → Result pipeline.
  • 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, and run.go.
  • Comments follow Go conventions: sentences start with the identifier name, each explains what the symbol does and when to use it.
  • The Configuration struct comments correctly note the optional semantics of each field.
  • Package-level doc in manager.go includes a minimal runnable example — good for pkg.go.dev.

No logic changes — purely additive documentation. CI passes. ✅

Ready to merge.

@AWaterColorPen AWaterColorPen merged commit eac2f28 into main Apr 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant