Add out file parameter to purspgpp

This commit is contained in:
rightfold 2016-12-22 23:02:02 +01:00
parent 8fbd7e38b0
commit d86e229702

View File

@ -75,7 +75,7 @@ sub process-query(libpq::Connection:D $conn, Str:D $source --> Str:D) {
"(Query \"\"\"$source\"\"\" :: Query ($parameters) ($fields))";
}
sub MAIN(Str $connection-string, IO(Cool) $filename) {
sub MAIN(Str $connection-string, IO(Cool) $in-file, IO(Cool) $out-file) {
my $conn = libpq::Connection.new($connection-string);
print process-module($conn, $filename.slurp);
$out-file.spurt(process-module($conn, $in-file.slurp));
}