Repository navigation
Correct API names and generated-key types in guide examples - #133
Open
dajiaohuang wants to merge 3 commits into
Open
dajiaohuang wants to merge 3 commits into
dajiaohuang wants to merge 3 commits into
Conversation
qiaoyuang
reviewed
Oct 15, 2026
qiaoyuang
left a comment
Collaborator
There was a problem hiding this comment.
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:
- 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 81sqllin-dsl/doc/query-cn.md, lines 17 and 79
- 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 torelease/2.6.0, which is merged intomainon release. It merges without conflicts. - 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 onfeature/bug-fixes-2.6.0, so please merge it into your branch, or rebase onto it, first.
…docs/correct-guide-api-examples
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.
Problem and correction
Several existing examples do not compile against the documented API:
SelectStatement.getResult(), but the public method isgetResults()(SelectStatement.kt).DSLDBConfigurationfromcom.ctrip.sqllin.driver, but its declaration is incom.ctrip.sqllin.dsl.NoCase, although it usesCollateNoCase.@PrimaryKey(autoIncrement = true) val id: Long = 0.ColumnConstraintParserexplicitly rejects this: AUTOINCREMENT requires a nullable Long, so useLong? = 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 --checkpasses. The whole Markdown snippets were not compiled as standalone applications (they are illustrative fragments with surrounding setup omitted). No runtime code changes.