| 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 |
Data persistence patterns in Go covering raw SQL with sqlx/pgx, ORMs like Ent and GORM, connection pooling, migrations with golang-migrate, and transaction management. Use when implementing database access, designing repositories, or managing schema migrations. Source: existential-birds/beagle.