Skip to content

fix(sqlite): 读路径 SQL 文本构建收敛到专用构建器消 S2077 - #544

Merged
AlianBlank merged 1 commit into
mainfrom
feature/auto-server-source-worker-run-10097-20261012T1050
Oct 12, 2026
Merged

AlianBlank merged 1 commit into
mainfrom
feature/auto-server-source-worker-run-10097-20261012T1050

Conversation

@AlianBlank

@AlianBlank AlianBlank commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Linear: GFX-889

Summary by CodeRabbit

  • 重构
    • 调整 SQLite 查询语句的构建方式,整表查询、按 ID 查询和 ID 集合查询的结果与原有结构保持一致。

SqliteDbService.Query.cs 三处 CommandText 表名内插改为调用新增私有静态
构建器 BuildSelectAllCommandText/BuildIdEqualsCommandText/BuildIdInCommandText,
SQL 文本逐字节不变(无格式符内插等价 string.Concat 串联),id 值仍走
$id/$idN 参数绑定;表名为编译期封闭类型名的双引号转义、非运行期输入,
SQL 标识符不可绑定参数,该不变量在构建器注释中声明。消除 Sonar
csharpsquid:S2077 三处 MAJOR/VULNERABILITY 发现(GFX-889)。

Linear: GFX-889
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f9a2b0f1-4a6a-411d-880a-4fde5ae067ef

📥 Commits

Reviewing files that changed from the base of the PR and between a6c50d2 and 79ddbb2.


📒 Files selected for processing (1)
  • GameFrameX.DataBase.Sqlite/SqliteDbService.Query.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

三个 SQLite 查询命令构建器改为调用对应的静态文本构建方法。查询 SQL 结构保持不变,ID 值仍通过参数绑定。

Changes

SQLite 查询命令构建

层 / 文件 摘要
查询文本构建与参数绑定
GameFrameX.DataBase.Sqlite/SqliteDbService.Query.cs
整表查询、按 ID 查询和 ID 集合查询改为调用对应的静态文本构建方法。按 ID 查询继续使用 $id 占位符,ID 值仍通过绑定参数传入。

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor


Merge Risk: ⚪ Minimal · up to 79ddb

This change centralizes SQLite query-text construction while preserving the described SQL and parameter-binding behavior. No merge-blocking risk is identified.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 标题准确描述了主要变更:将 SQLite 读路径的 SQL 文本构建收敛到专用构建器,并处理 Sonar S2077 问题。
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@AlianBlank
AlianBlank merged commit 0206b50 into main Oct 12, 2026
3 checks passed
@AlianBlank
AlianBlank deleted the feature/auto-server-source-worker-run-10097-20261012T1050 branch October 12, 2026 11:25
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