{"body":"$ perl6 -MRed -e '\nmodel Bla {\n   has UInt $.id is id;\n   has Str  $.bla is column{ :nullable };\n}\nmy $*RED-DB = database \"SQLite\"; Bla.^create-table;\nfor (|<a b c>, Nil).roll(10) { Bla.^create: :bla($_) }\n\nsay formatter Bla.^all;\n\nsub formatter(Red::ResultSeq:D $rs --> Str ) {\n    my @cols   = $rs.of.^attributes.grep(Red::Attr::Column).map( -> $c { $c.name.substr(2) });\n\n    my $str = @cols.join(\"\\t\\t|\");\n    $str ~= \"\\n\" ~ ( \"-\" x 50 ) ~ \"\\n\";\n    for $rs -> $row {\n        $str ~= @cols.map( -> $n { $row.\"$n\"() // \"\" }).join(\"\\t\\t|\") ~ \"\\n\";\n    }\n\n   $str;\n}\n\n'\nid\t\t|bla\n--------------------------------------------------\n1\t\t|b\n2\t\t|a\n3\t\t|\n4\t\t|b\n5\t\t|a\n6\t\t|\n7\t\t|c\n8\t\t|b\n9\t\t|\n10\t\t|\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/Uc3VELXi","modified":1553083120,"id":"Uc3VELXi","size":688,"lines":35,"own_paste":false,"theme":"","date":1553083120}