# Pastebin FHt6aPjc $ perl6 -MRed -e ' my $*RED-DB = database "SQLite"; my $*RED-DEBUG = True; model A is table { has UInt $!id is serial; has Int $.a is column is rw } A.^create-table; my $a = A.^create: :42a; $a.a = 13; $a.^save; say A.^all.grep(*.a == 13).map: { .a > 3 ?? "the result is { .a }" !! "{ .a } isnt greater than 3" } ' SQL : CREATE TABLE aaaa( id integer NOT NULL primary key AUTOINCREMENT , a integer NOT NULL ) BIND: [] SQL : INSERT INTO aaaa( a ) VALUES( ? ) BIND: [42] SQL : SELECT aaaa.id , aaaa.a FROM aaaa WHERE _rowid_ = last_insert_rowid() LIMIT 1 BIND: [] SQL : UPDATE aaaa SET a = 13 WHERE id = 1 BIND: [] SQL : SELECT CASE WHEN a > 3 THEN 'the result is ' || a WHEN a <= 3 THEN a || ' isnt greater than 3' END as "data_1" FROM aaaa WHERE aaaa.a = 13 BIND: [] (the result is 13)