Skip to content

Instantly share code, notes, and snippets.

@FCO

FCO/p-extra.p6 Secret

Last active December 16, 2018 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FCO/1d086832e9532c1c3eb11402a3d32c02 to your computer and use it in GitHub Desktop.
Save FCO/1d086832e9532c1c3eb11402a3d32c02 to your computer and use it in GitHub Desktop.
use Red;
model Person {
has UInt $.id is id;
has Str $.name is column;
has Str $.email is column{ :nullable };
}
my $*RED-DB = database "SQLite";
Person.^create-table;
Person.^create: :name<Fernando>, :email<fco@aco.com>;
Person.^create: :name<Aline>, :email<aja@aco.com>;
Person.^create: :name<Fernanda>;
Person.^create: :name<Sophia>;
.say for Person.^all.map: { "{ .name }{ " => { .email }" if .email }" };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment