{"body":"my $*RED-DB = database \"SQLite\";\n\nmodel M2 { ... }\n\nmodel M1 {\n    has Int $.id is serial;\n    has Str $.name is column;\n    has M2 @.m2 is relationship{ .m1_id };\n}\n\nmodel M2 {\n    has Int $.m1_id is column{ :id, :references{ M1.id } };\n    has Int $.id is id;\n}\n\nM1.^create-table;\nM2.^create-table;\n\nmy $r = M1.^create: :name<a>;\n\nfor 0 .. 5 -> $id {\n    my $x = M2.^create: :m1_id($r.id), :$id;\n    $x.perl.say;\n}\n\n$r.perl.say;\n\nM2.^all.elems.perl.say;;\n\n$r.m2.perl.say;\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/QUqMTYof","modified":1572118129,"id":"QUqMTYof","size":474,"lines":30,"own_paste":false,"theme":"","date":1572118129}