Skip to content

Correct API names and generated-key types in guide examples - #133

Open
dajiaohuang wants to merge 3 commits into
ctripcorp:feature/bug-fixes-2.6.0from
dajiaohuang:docs/correct-guide-api-examples
Open

dajiaohuang wants to merge 3 commits into
ctripcorp:feature/bug-fixes-2.6.0from
dajiaohuang:docs/correct-guide-api-examples

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem and correction

Several existing examples do not compile against the documented API:

  • Both root READMEs call SelectStatement.getResult(), but the public method is getResults() (SelectStatement.kt).
  • Both getting-start guides import DSLDBConfiguration from com.ctrip.sqllin.driver, but its declaration is in com.ctrip.sqllin.dsl.
  • The English collation example imports nonexistent NoCase, although it uses CollateNoCase.
  • Both CREATE examples declare @PrimaryKey(autoIncrement = true) val id: Long = 0. ColumnConstraintParser explicitly rejects this: AUTOINCREMENT requires a nullable Long, so use Long? = null, as the primary-key section already explains.

This only corrects those API names/imports and the key type, keeping English and Chinese examples aligned.

Validation

Checked the corrections against the public declarations, processor validation and existing KSP-generated test entities at main 2fb681437e4c0f0f352aaee7be7f3fa6c1cf8647. git diff --check passes. The whole Markdown snippets were not compiled as standalone applications (they are illustrative fragments with surrounding setup omitted). No runtime code changes.

@qiaoyuang qiaoyuang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! Each correction checks out against the code: getResults() is the public method, DSLDBConfiguration is declared in com.ctrip.sqllin.dsl, the annotation is CollateNoCase, and the processor rejects autoIncrement = true on a non-null Long.

A few things before we can merge it:

  1. Four more getResult(): the same mistake is in the query guide, which this PR doesn't touch:
    • sqllin-dsl/doc/query.md, lines 19 and 81
    • sqllin-dsl/doc/query-cn.md, lines 17 and 79
  2. Target branch: please change the base of this PR to feature/bug-fixes-2.6.0, for the same reason as in #132: fixes go to a feature branch, then to release/2.6.0, which is merged into main on release. It merges without conflicts.
  3. CHANGELOG: please add an entry under ## 2.6.0 / 2026-xx-xx → ### sqllin-dsl, after the existing entries, in the style of the other documentation fixes, e.g. * Fix documentation: the examples of ... called getResult(), which doesn't exist; it is getResults() .... That section only exists on feature/bug-fixes-2.6.0, so please merge it into your branch, or rebase onto it, first.

@dajiaohuang
dajiaohuang changed the base branch from main to feature/bug-fixes-2.6.0 October 15, 2026 19:10
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.

2 participants