/usr/share/perl5/GO/Handlers/abstract_sql_writer.pm is in libgo-perl 0.15-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | package GO::Handlers::abstract_sql_writer;
use base qw(Data::Stag::Writer Exporter);
use strict;
sub out {
my $self = shift;
print "@_";
}
sub cmt {
my $self = shift;
my $cmt = shift;
$self->out(" % $cmt") if $cmt;
return;
}
sub sqlquote {
my $s = shift;
$s =~ s/\'/\\\'/g;
"'$s'";
}
sub nl {
shift->print("\n");
}
sub fact {
my $self = shift;
my $pred = shift;
my @args = @{shift||[]};
my $cmt = shift;
$self->out(sprintf("INSERT INTO $pred VALUES (%s); ",
join(', ', map {sqlquote($_)} @args)));
$self->cmt($cmt);
$self->nl;
}
1;
|