What problem does it solve?
GORM users often need to run low-level SQL and fine-tune queries while still leveraging the ORM for models and relationships. This Skill provides direct access to raw SQL execution, clause customization, and debugging utilities to build efficient, database-specific queries without sacrificing ORM integration.
Core Features & Use Cases
- Raw SQL execution and scanning: run queries with db.Raw and scan results into models or primitive types.
- Clause customization: apply and compose custom clauses for inserts, updates, and complex queries.
- Debugging and validation: generate executable SQL strings with ToSQL and preview queries prior to execution.
- Named arguments and parameter binding: safely bind named, map, or struct parameters to SQL statements.
- Prepared statements and performance: enable prepared statements to optimize repeated query paths.
Quick Start
Start by writing a raw SQL query with db.Raw and scanning the result into a struct.