Documentation
¶
Overview ¶
Example: relationships
Demonstrates eager loading with Include using split queries: has_many (Author -> Books), has_one (Author -> Profile), and belongs_to (Book -> Author).
Models use `rel` struct tags, and `drel generate` emits RelationInfo and IncludeSpec variables in the db/ package for cross-package support.
Usage:
cd examples/relationships go run ../../cmd/drel generate export DATABASE_URL="postgres://localhost:5432/drelexample?sslmode=disable" go run .
Click to show internal directories.
Click to hide internal directories.