moonbitstack/moonorm/examples/22-annotations does not have a README file

    Email

    pub struct Email(String) derive(Eq,
    Debug
    )

    A type of the program's own: stored as text, refused on the way back when it has no @.

    Hero

    pub struct Hero {
    id : Int64?
    name : String
    secret : String
    age : Int?
    power : Double
    team_id : Int64?
    email : Email
    visits : Int
    }

    A field without annotations is a column named after it, NOT NULL unless its type is T?. #orm.skip keeps a field out of the table and fills it from Default when a row is read. #orm.index adds an index over its columns; index=true on a column adds one over that column alone.

    Team

    pub struct Team {
    id : Int64?
    name : String
    }

    The parent table heroes point at. An autoincrement key is T?: None until the database assigns it, and left out of the INSERT meanwhile. heroes is a relation: Team::heroes(), loaded with Session::load.