Add type specifications to more purspgpp functions

This commit is contained in:
rightfold 2016-12-22 20:32:52 +01:00
parent 1c770e8f20
commit d98f1e3174

View File

@ -62,11 +62,11 @@ my Str:D %types{Int:D} =
2950 => 'UUID', 2950 => 'UUID',
; ;
sub process-module($conn, Str:D $segment) { sub process-module(libpq::Connection:D $conn, Str:D $segment --> Str:D) {
S:g/'[query|' (.*?) '|]'/&process-query($conn, ~$0)/ given $segment; S:g/'[query|' (.*?) '|]'/&process-query($conn, ~$0)/ given $segment;
} }
sub process-query($conn, Str:D $source) { sub process-query(libpq::Connection:D $conn, Str:D $source --> Str:D) {
$conn.prepare('', $source); $conn.prepare('', $source);
my $description = $conn.describe-prepared(''); my $description = $conn.describe-prepared('');
my &convert-types = { ($_.map({%types{$_}}), "Unit").flat.join(" × "); }; my &convert-types = { ($_.map({%types{$_}}), "Unit").flat.join(" × "); };