infrastructure-layer

Implement SeaORM-backed repositories and query services for Rust DDD infrastructure crates.

Updated Jan 11, 2026
One-click install
npx skills add https://github.com/nftug/rust-ddd-book-manager --skill infrastructure-layer-nftug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infrastructure-layer
Source: https://github.com/nftug/rust-ddd-book-manager/tree/main/.agents/skills/infrastructure-layer
Command: npx skills add https://github.com/nftug/rust-ddd-book-manager --skill infrastructure-layer-nftug

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the risk of inconsistent, boilerplate-heavy infrastructure layer code in Rust DDD projects by enforcing repository-specific patterns for persistence, database mapping, and SeaORM integration, reducing debugging time and architectural drift.

Core Features & Use Cases

  • Standardized Repository & Query Service Implementation: Guides consistent creation of SeaORM-backed repository and query service traits that align with domain and application layer contracts, including proper error handling and transaction management.
  • Consistent Database Mapping & Macro Usage: Enforces standard patterns for row/aggregate conversion, audit data hydration, upsert operations, and configuration management to avoid ad-hoc, hard-to-maintain database code.
  • Use Case: For example, when adding a new book checkout persistence feature, this Skill ensures you follow existing ConnectionPool injection, log_db_error handling, and transaction boundary rules without deviating from project standards.

Quick Start

Use the infrastructure-layer skill to implement a new BookRepository that follows the project's existing SeaORM, transaction, and audit macro patterns.

Frequently Asked Questions about infrastructure-layer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a SeaORM repository in a Rust DDD project?

Implementing a SeaORM repository in a Rust DDD project requires standardizing row/aggregate conversion, using ConnectionPool injection, and enforcing explicit transaction boundaries to align with domain contracts.

What is the best way to handle database mapping and persistence errors in Rust DDD?

The best way to handle database mapping and persistence errors in Rust DDD is by enforcing standard patterns for row conversion and aggregating PersistenceError, reducing boilerplate and architectural drift.

How do I add paginated query services to an infrastructure crate using SeaORM?

To add paginated query services to an infrastructure crate using SeaORM, create query service traits aligning with application layer contracts while maintaining consistent pagination and filtering logic.

Does this approach support audit macro usage and upsert operations in Rust?

Yes, this approach supports audit macro usage and upsert operations in Rust by enforcing standard patterns for audit data hydration and database interactions to maintain code consistency.

Can I use this pattern for managing database configuration in a Cargo workspace?

Yes, you can use this pattern for managing database configuration in a Cargo workspace, as it specifically applies to database configuration management within the infrastructure crate.

Why does my Rust DDD infrastructure layer code become inconsistent across repositories?

Rust DDD infrastructure layer code becomes inconsistent due to ad-hoc, boilerplate-heavy database code, solved by enforcing project-specific patterns like ConnectionPool injection and transaction boundaries.