Skip to content

Instantly share code, notes, and snippets.

@Altai-man
Created September 14, 2019 17:15
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 Altai-man/fd7583e7c291117b57fec9b96195c71f to your computer and use it in GitHub Desktop.
Save Altai-man/fd7583e7c291117b57fec9b96195c71f to your computer and use it in GitHub Desktop.
use Red;
model Person is rw {
has Int $.id is serial;
has Str $.name is column;
}
my $*RED-DB = database “SQLite”;
Person.^create-table;
my $p = Person.^create: :name<John>;
lives-ok { $p.name = <Jack> }, "Column is rw when the model is marked as rw";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment