summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2017-12-30 14:41:22 +0000
committerdakkar <dakkar@thenautilus.net>2017-12-30 14:41:22 +0000
commitcb51bf36a6cd26bd127a9408bc25a45bcf530066 (patch)
tree90741299c12473f4c40b2633f8b194604e637fe3
parentbetter db structure, plus notes (diff)
downloadUltramarine-cb51bf36a6cd26bd127a9408bc25a45bcf530066.tar.gz
Ultramarine-cb51bf36a6cd26bd127a9408bc25a45bcf530066.tar.bz2
Ultramarine-cb51bf36a6cd26bd127a9408bc25a45bcf530066.zip
move coercions to signatures
-rw-r--r--lib/Ultramarine/Model/DB.pm68
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Ultramarine/Model/DB.pm6 b/lib/Ultramarine/Model/DB.pm6
index 596da6a..24a6a4a 100644
--- a/lib/Ultramarine/Model/DB.pm6
+++ b/lib/Ultramarine/Model/DB.pm6
@@ -159,14 +159,14 @@ class Ultramarine::Model::DB {
return %song;
}
- method get-song(:$path!) {
+ method get-song(Str() :$path!) {
my $sth = $!dbh.prepare(q:to/END/);
SELECT *
FROM songs
WHERE path=?
END
LEAVE { .finish with $sth }
- $sth.execute($path.Str);
+ $sth.execute($path);
return unpack-row($sth.row(:hash));
}
@@ -185,7 +185,7 @@ class Ultramarine::Model::DB {
}
}
- method is-up-to-date(:$path!,:$mtime!) {
+ method is-up-to-date(Str() :$path!,:$mtime!) {
my $sth = $!dbh.prepare(q:to/END/);
SELECT COUNT(*)
FROM songs
@@ -193,7 +193,7 @@ class Ultramarine::Model::DB {
AND mtime >= $mtime
END
LEAVE { .finish with $sth };
- $sth.execute($path.Str,$mtime);
+ $sth.execute($path,$mtime);
return ($sth.row[0]//0).Bool;
}
}