Help language development. Donate to The Perl Foundation

Red cpan:FCO last updated on 2020-11-22

t/lib/Post.pm
use Red;

model Post is rw {
    has Int         $.id        is serial;
    has Int         $.author-id is referencing(model => 'Person', column => 'id' );
    has Str         $.title     is column{ :unique };
    has Str         $.body      is column;
    has             $.author    is relationship({ .author-id }, model => 'Person');
}