rust-database
Skill47 starsChanged 10 months agoMITView on GitHub
How do we guarantee data correctness while keeping queries and migrations operationally safe?
2 other projects use a version of this.
Adopted by
Most recently taken up by
- po4yka/rust-skillstheir own version, first seen Aug 20, 2026
- dawidpereira/rust-skillstheir own version, first seen Mar 22, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- po4yka/rust-skills★ 2same name
- dawidpereira/rust-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- SKILL.mdSkill
- rust-actorSkill
- rust-anti-patternSkill
- rust-async-patternSkill
- rust-asyncSkill
- rust-authSkill
- rust-cacheSkill
- rust-codingSkill
- rust-concurrencySkill
- rust-constSkill
- rust-coroutineSkill
- rust-distributedSkill
- rust-dpdkSkill
- rust-ebpfSkill
- rust-ecosystemSkill
- rust-embeddedSkill
- rust-error-advancedSkill
- rust-errorSkill
- rust-ffiSkill
- rust-gpuSkill
- rust-learnerSkill
- rust-lifetime-complexSkill
- rust-linear-typeSkill
- rust-macroSkill
- rust-middlewareSkill
- rust-mutabilitySkill
- rust-observabilitySkill
- rust-ownershipSkill
- rust-performanceSkill
- rust-pinSkill
- rust-resourceSkill
- rust-skill-indexSkill
- rust-skillSkill
- rust-testingSkill
- rust-type-drivenSkill
- rust-unsafeSkill
- rust-webSkill
- rust-xacmlSkill
- rust-zero-costSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Keep repository/data-access layer separate from business logic.
- Distinctive: line 23
Do not perform network calls inside transactions.
- Distinctive: line 28
Use indexes based on real access patterns.
- Distinctive: line 34
Prefer additive migrations for rolling deployments.
- Distinctive: line 36
Verify backward/forward compatibility windows.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
name: rust-database description: "Rust database skill for SQLx/Diesel/SeaORM design, transaction boundaries, migration safety, query performance, and operational reliability."---
Rust Database Skill
Core Question
How do we guarantee data correctness while keeping queries and migrations operationally safe?
Persistence Architecture
- Keep repository/data-access layer separate from business logic.
- Define explicit transaction boundaries around business invariants.
- Choose stack by need:
- sqlx: explicit SQL and compile-time query checks.
- diesel: typed query builder with strong schema coupling.
- sea-orm: async ORM convenience with rapid CRUD iteration.
Transaction and Consistency Rules
- Keep transactions short. - Do not perform network calls inside transactions. - Handle deadlock/serialization retries with bounded policy.
Query Performance
- Use indexes based on real access patterns. - Detect and remove N+1 query behavior. - Inspect query plans for slow paths.
Migration Safety
- Prefer additive migrations for rolling deployments. - Separate destructive changes into phased rollouts. - Verify backward/forward compatibility windows.
Common Pitfalls
- Long-lived transactions causing lock contention. - Schema changes incompatible with old app versions. - Inconsistent timezone/nullability handling across layers. - Pool exhaustion under burst traffic.
Review Checklist
- [ ] Transaction boundaries align with domain invariants. - [ ] Retry/timeout policy is explicit for DB operations. - [ ] Migrations are safe for rolling deploy. - [ ] Query plans and indexes are validated. - [ ] Metrics cover pool usage, latency, and error rates.
Verification Commands
cargo check
cargo test
cargo clippy
cargo sqlx prepare
cargo sqlx migrate runRelated Skills
- rust-web
- rust-cache
- rust-observability
Localized Reference
- Original Chinese version is preserved in SKILL_ZH.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

