| Connection pool internals, sizing, pgx pools, monitoring | references/connection-pooling.md | | golang-migrate setup, file conventions, CI/CD integration | references/migrations.md | | Transaction helpers, service-layer transactions, isolation levels | references/transactions.md |
| Factor | Raw SQL (sqlx/pgx) | ORM (Ent/GORM) |
| Complex queries | Preferred | Awkward | | Type safety | Manual | Auto-generated | | Performance control | Full | Limited | | Rapid prototyping | Slower | Faster | | Schema migrations | golang-migrate | Built-in (Ent) | | Learning curve | SQL knowledge | ORM API |
Patrones de persistencia de datos en Go que cubren SQL sin formato con sqlx/pgx, ORM como Ent y GORM, agrupación de conexiones, migraciones con golang-migrate y gestión de transacciones. Utilícelo al implementar el acceso a bases de datos, diseñar repositorios o gestionar migraciones de esquemas. Fuente: existential-birds/beagle.