repository-adapters
Modify database repository adapters using sqlc-generated SQLite queries.
When & Why to Use This Skill
This Claude skill automates the maintenance and synchronization of database repository adapters in Go applications. By integrating with sqlc and SQLite, it streamlines the end-to-end workflow of updating SQL queries, regenerating type-safe code, and modifying repository implementations while strictly adhering to clean architecture conventions.
Use Cases
- Synchronizing Database Changes: Automatically update Go repository adapters whenever SQL definitions in queries.sql are modified, ensuring the data access layer remains consistent with the schema.
- Boilerplate Reduction: Eliminate manual coding tasks by automating the mapping between sqlc-generated structures and domain-specific repository interfaces.
- Workflow Automation: Execute the full development cycle of 'Edit-Generate-Update-Test' for database layers through simple natural language commands, significantly increasing developer productivity.
- Maintaining Architectural Integrity: Ensure that database implementation details remain isolated within the adapters directory, preventing leaks into the domain layer while following project-specific repo conventions.
| name | repository-adapters |
|---|---|
| description | Modify database repository adapters using sqlc-generated SQLite queries. |
| license | MIT |
| compatibility | Requires bash, git, Go, and sqlc v1.30.0+. |
| repo | mjrwtf |
| runner | github-copilot-cli |
| version | 1.2 |
| allowed-tools | Bash(git:*) Bash(make:*) Bash(go:*) Bash(sqlc:*) Read |
Repo conventions
- Domain interfaces live in
internal/domain/**/repository.go. - Implementations live in
internal/adapters/repository/. - Do not edit generated code under
internal/adapters/repository/sqlc/**.
Making a change
- Update
internal/adapters/repository/sqlc/sqlite/queries.sql - Regenerate:
make generate
- Update adapters in
internal/adapters/repository/*.go. - Verify:
make test