diff options
author | dakkar <dakkar@thenautilus.net> | 2017-12-23 19:41:10 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2017-12-23 19:41:10 +0000 |
commit | 90201966ef2457b8f0a8db6996f7c1c4bca4544a (patch) | |
tree | 52de33481ad3bdecfe8a467023fe22380ab2ec4d | |
parent | DirScanner can emit the class, no need to .new (diff) | |
download | Ultramarine-90201966ef2457b8f0a8db6996f7c1c4bca4544a.tar.gz Ultramarine-90201966ef2457b8f0a8db6996f7c1c4bca4544a.tar.bz2 Ultramarine-90201966ef2457b8f0a8db6996f7c1c4bca4544a.zip |
fix .finish in gather/take
the sth was being finished when returning, not at the end of the
gather
-rw-r--r-- | lib/Ultramarine/Model/DB.pm6 | 5 |
1 files 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; } } |