feat(rdb): 支持 LIKE 忽略大小写 - #121
Merged
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.2 #121 +/- ##
=============================================
+ Coverage 64.92% 79.00% +14.07%
- Complexity 2341 3418 +1077
=============================================
Files 343 374 +31
Lines 9375 11002 +1627
Branches 940 1336 +396
=============================================
+ Hits 6087 8692 +2605
+ Misses 2810 1662 -1148
- Partials 478 648 +170 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
变更内容
like$ignoreCase/nlike$ignoreCase查询选项忽略大小写。Dialect默认方法,方言可覆盖buildLike使用原生策略。lower(left) [not] like lower(right);反向 LIKE 的通配符使用两参数concat嵌套,兼容 Oracle 等方言。ILIKE / NOT ILIKE;普通 LIKE 保持不变。测试
定向片段及 H2 集成测试:
mvn -pl hsweb-easy-orm-rdb -am clean test \ -Dtest=LikeTermFragmentBuilderTest,DialectTest,QueryTermsFragmentBuilderTest,LikeIgnoreCaseH2IntegrationTest \ -Dsurefire.failIfNoSpecifiedTests=false结果:19 个测试通过,失败 0,错误 0,跳过 0。
真实数据库 Testcontainers 集成测试覆盖:
结果:8 个新增方言测试通过,失败 0,错误 0。实际 SQL 已确认 PostgreSQL/OpenGauss 使用
ilike,H2、MySQL、Oracle、MSSQL 使用lower(...) like lower(?),Oracle 反向 LIKE 使用嵌套两参数concat(...)。H2 基础测试清理阶段有已有的表不存在告警,但不影响测试结果。JaCoCo 定向报告:
LikeTermFragmentBuilder:行覆盖 25/25,分支覆盖 12/12。Dialect默认方法的空值、普通/反向 LIKE、NOT LIKE、大小写和连接边界均有测试覆盖。兼容性与风险
LOWER、LIKE和两参数CONCAT,由方言扩展点保留原生操作符适配空间。LOWER(column)可能影响普通索引命中;本次不新增函数索引、collation 或通配符转义策略,使用方需结合数据库索引方案评估。