-
-
Notifications
You must be signed in to change notification settings - Fork 28
Classify
Fernando Correa de Oliveira edited this page Apr 5, 2019
·
1 revision
use Red;
model Bla {
has Str $.first-name is column;
has Str $.last-name is column;
}
my $*RED-DB = database "SQLite";
Bla.^create-table: :if-not-exists;
Bla.^create: :first-name<Fernando>, :last-name<Collor>;
Bla.^create: :first-name<Fernando>, :last-name<Cardoso>;
my $*RED-DEBUG = True;
.say for Bla.^all.classify(*.first-name)<Fernando>
SQL : SELECT
bla.first_name as "first-name", bla.last_name as "last-name"
FROM
bla
WHERE
bla.first_name = ?
BIND: ["Fernando"]
Bla.new(first-name => "Fernando", last-name => "Collor")
Bla.new(first-name => "Fernando", last-name => "Cardoso")