Skip to content

Instantly share code, notes, and snippets.

Created Apr 2, 2022
What would you like to do?
model User {
has Int $.id is serial;
has Str $.name is column;
has Str $.role is column;
red-defaults "SQLite";
for <user admin root> -> $role { User.^create(:name("user " ~ ++$), :$role) }
submodel Admin of User where *.role eq "admin";
say<admin>) ~~ User;
Admin.^create: :name("new admin");
.say for Admin.^all;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment