# Pastebin RhTFnJMn MacBook-Pro-de-Fernando:BestTree fernando$ cat Tree.pm6 use Red; model Tree { has UInt $!id is id; has Rat $.latitude is column; has Rat $.longitude is column; has Rat $.height is column; has Str $.description is column; ::?CLASS.^add-unique-constraint: { .latitude, .longitude }; method all-trees { self.^all.sort: -*.height } method find-tree(Rat $longitude, Rat $latitude) { self.^find: :$longitude, :$latitude } method suggest-tree(Rat $longitude, Rat $latitude, Rat $height, Str $description) { self.^create: :$longitude, :$latitude, :$height, :$description } } MacBook-Pro-de-Fernando:BestTree fernando$ perl6 -I../Red2/lib/ -MRed -I. -MTree -e ' my $*RED-DB = database "SQLite"; Tree.^create-table; Tree.suggest-tree: 1.1, 2.2, 3.3, "bla"; Tree.suggest-tree: 1.2, 2.3, 3.4, "ble"; say Tree.all-trees; ' (Tree.new(latitude => "2.3", longitude => "1.2", height => "3.4", description => "ble") Tree.new(latitude => "2.2", longitude => "1.1", height => "3.3", description => "bla"))