relationships

command
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 6 Imported by: 0

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 .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL