moonbitstack/moonorm/examples/13-relationships does not have a README file

    Hero

    type Hero

    Rows

    type Rows

    A driver that returns a fixed result set for every query — enough to drive the load / bucket logic without a real backend. Seed it with the rows a real WHERE would return.

    Tag

    type Tag

    Team

    type Team

    Foreign-key relationships with explicit eager loading — MoonBit has no attribute interception, so a related load is a call, not a silent lazy attribute access (Diesel's preload / GORM's Preload). has_many (1:N), belongs_to (N:1), and many_to_many each build the resolving Select; Session::load / load_one / load_many run one, and load_batch / load_one_batch fetch related rows for many sources in a single query (the N+1-avoiding selectinload), bucketing them back to their sources in memory. The bound-value match keeps eager loading injection-safe. Execution runs over a small fixed-rows driver standing in for the backend.

    moon run examples/13-relationships

    Source Files