BMAD-METHOD/.claude/rules/go-backend-scalability-curs.../database-interaction-best-p...

10 lines
402 B
Plaintext

---
description: Best practices when interacting with databases in backend Go code.
globs: */db/**/*.go
---
When interacting with databases:
- Use prepared statements to prevent SQL injection.
- Handle database errors gracefully.
- Consider using an ORM for complex queries and data modeling.
- Close database connections when they are no longer needed.
- Use connection pooling to improve performance.