{"body":"$ perl6 -Ilib -MRed -e '\nmodel B is table<bbb> { ... }\nmodel A is table<aaa> { has UInt $.id is serial; has B @.bs is relationship{ .a-id } }\nmodel B { has UInt $.id is serial; has UInt $.a-id is referencing{ A.id }; has A $.a is relationship{ .a-id } }\n\nmy $*RED-DB = database \"SQLite\"; A.^create-table; B.^create-table;\nmy $a = A.^create;\n\ngiven $a { .bs.create; .bs.create; .bs.create }\nmy $*RED-DEBUG = True;\n.say for $a.bs.map: { .id > 2 ?? \"the big id is { .id }\" !! \"the small id is { .id }\" }\n\n'\nSQL : SELECT\n   CASE \n      WHEN id <= 2 THEN 'the small id is ' || id\n      WHEN id > 2 THEN 'the big id is ' || id\n\n   END\n    as \"data_1\"\nFROM\n   bbb\nWHERE\n   bbb.a_id = ?\nBIND: [1]\nthe small id is 1\nthe small id is 2\nthe big id is 3","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/LV9qOiwq","modified":1552603149,"id":"LV9qOiwq","size":740,"lines":28,"own_paste":false,"theme":"","date":1552603149}