What problem does it solve? It standardizes how Go developers implement the persistence layer for domain aggregates, eliminating ad-hoc decisions about transaction handling, error translation, and domain-to-row mapping when writing repositories against PostgreSQL. ## Core Features & Use Cases - Two persistence patterns: Implements either a standard type (FindByID / Create / Update overwriting state) or an event-sourced type (FindByID plus Apply{Event} appending domain events and reflecting them into a current row with optimistic locking), chosen from the data model document. - Marshaller conventions: Defines pure functions named {source}To{target} that convert between domain values and sqlc rows/Params, restoring aggregates only through New* and Restore* constructors. - Error translation: Maps DB constraint violations to domain sentinels, ErrNoRows to rdb.ErrNotFound, and optimistic-lock conflicts to rdb.ErrConflict, with context added exactly once per method. - Use Case: Given a domain aggregate with a Repository interface and a logical data model document, generate the full repository implementation including sqlc queries, marshallers, and constraint translation, then compile and report. ## Quick Start Implement the repository for this aggregate from the domain-model and data-model documents using PostgreSQL with pgx and sqlc.