OxL Reference

data Many

The rows of the table T that point to this row with their ref field (§12.8, D-4780): no column; filled by load(orders), empty otherwise. The type is written many<Order>; a field of this type is declared orders: many<Order> = Many<Order>{}.

Example:

oxl✓ checked in CI
use std.orm { Many, many, ref }

@table("users")
data User {
  @pk id: i64
  name: str
  orders: many<Order> = Many<Order>{}
}

@table("orders")
data Order {
  @pk id: i64
  owner: ref<User>
}
pub(api) data Many<T>

Since. 1.0.0-beta

Fields

pub(api) rows: List<T> = []

The rows that point to this row, when load(..) fetched them; empty otherwise.

Defined in: std/orm/orm.oxl:159

See also