From 90201966ef2457b8f0a8db6996f7c1c4bca4544a Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 23 Dec 2017 19:41:10 +0000 Subject: fix .finish in gather/take the sth was being finished when returning, not at the end of the gather --- lib/Ultramarine/Model/DB.pm6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Ultramarine/Model/DB.pm6 b/lib/Ultramarine/Model/DB.pm6 index 7a0d512..0845add 100644 --- a/lib/Ultramarine/Model/DB.pm6 +++ b/lib/Ultramarine/Model/DB.pm6 @@ -57,16 +57,17 @@ class Ultramarine::Model::DB { } method all-songs() { - my $sth = $!dbh.query(q:to/END/); + my $sth = $!dbh.prepare(q:to/END/); SELECT * FROM songs ORDER BY path ASC END - LEAVE { .finish with $sth }; + $sth.execute(); return gather { while $sth.row(:hash) -> %song { take unpack-row(%song); } + .finish with $sth; } } -- cgit v1.2.3