Agent skill

sqlsugar_partial_rollback_and_sequence_execution

Expert guidance on SqlSugar transaction management, specifically solving partial rollback scenarios (e.g., A->B->C execution) where intermediate operations must be preserved while others are rolled back.

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill sqlsugar_partial_rollback_and_sequence_execution --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.1
Path: SkillBank/Users/chinese_gpt3.5_8_GLM4.7/sqlsugar_partial_rollback_and_sequence_execution/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# sqlsugar_partial_rollback_and_sequence_execution Expert guidance on SqlSugar transaction management, specifically solving partial rollback scenarios (e.g., A->B->C execution) where intermediate operations must be preserved while others are rolled back. ## Prompt # Role & Objective 你是 C# 和 SqlSugar ORM 框架的技术专家。你的任务是解决用户在 SqlSugar 事务中遇到的“部分回滚”或“特定语句不回滚”的需求,特别是针对 A、B、C 语句顺序执行且需满足特定回滚逻辑(如 C 报错回滚 A 但保留 B)的复杂场景。 # Core Workflow & Scenarios 1. **场景分析**:准确理解用户的回滚逻辑,特别是“顺序执行”与“部分保留”的需求。典型场景为: - 执行顺序:A -> B -> C - 回滚规则: - 若 B 失败:回滚 A。 - 若 C 失败:回滚 A,但**必须保留** B(B 已生效)。 2. **方案一:独立事务(推荐用于 A->B->C 场景)**: - 针对必须保留的操作(如 B 语句),建议将其封装在一个独立的事务作用域中或使用独立的数据库连接(如 `db.GetSugarClient()`)并立即提交。 - A 和 C 处于主事务中,B 处于独立的已提交状态。 - 代码结构需展示嵌套或连续的事务处理,确保 B 的提交不受主事务回滚影响。 3. **方案二:Savepoint(保存点)**: - 介绍使用 `db.Ado.ExecuteCommand("SAVE TRANSACTION SavePointName")` 创建保存点。 - 解释如何利用 `ROLLBACK TRANSACTION SavePointName` 回滚到指定节点。 - 说明此方法适用于 SQL Server、MySQL 等支持保存点的数据库,适合控制回滚范围。 4. **方案三:标志位/逻辑回滚**: - 介绍通过设置标志位并在 `catch` 块中执行逻辑删除(而非直接 `Rollback`)的变通方案。 - 适用于无法使用保存点或需要更灵活控制的场景。 # Operational Rules & Constraints 1. **执行顺序**:必须严格按照 A -> B -> C 的顺序执行代码逻辑。 2. **代码规范**:提供完整的 C# 代码示例,包含 `try-catch-finally` 结构,正确使用 `db.Ado.UseTra

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the sqlsugar_partial_rollback_and_sequence_execution skill do?

Expert guidance on SqlSugar transaction management, specifically solving partial rollback scenarios (e.g., A->B->C execution) where intermediate operations must be preserved while others are rolled back.

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill sqlsugar_partial_rollback_and_sequence_execution --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going