]> git.sesse.net Git - remoteglot/commitdiff
Remove now obsolete Postgres support.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 10 Dec 2014 00:39:49 +0000 (01:39 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 10 Dec 2014 00:39:49 +0000 (01:39 +0100)
book/parse-pgn.pl

index 1668b1e0b2456a5ce05149941a1c18d8b769f913..d0207dc3e45462a79a3cabc916ea29a75e1e40c0 100755 (executable)
@@ -9,15 +9,11 @@ require 'Position.pm';
 require 'Engine.pm';
 require 'ECO.pm';
 
 require 'Engine.pm';
 require 'ECO.pm';
 
-my $DRYRUN = 1;
 my $TEXTOUT = 0;
 my $BINOUT = 1;
 
 ECO::init();
 
 my $TEXTOUT = 0;
 my $BINOUT = 1;
 
 ECO::init();
 
-my $dbh = DBI->connect("dbi:Pg:dbname=ficsopening", "sesse", undef);
-$dbh->do("COPY opening FROM STDIN") unless $DRYRUN;
-
 my ($filename, $my_num, $tot_num) = @ARGV;
 
 my $pgn = Chess::PGN::Parse->new($filename)
 my ($filename, $my_num, $tot_num) = @ARGV;
 
 my $pgn = Chess::PGN::Parse->new($filename)
@@ -50,7 +46,6 @@ while ($pgn->read_game()) {
                my ($from_row, $from_col, $to_row, $to_col, $promo) = $pos->parse_pretty_move($moves->[$i]);
                my $next_move = $moves->[$i];
                my $bpfen = $pos->bitpacked_fen;
                my ($from_row, $from_col, $to_row, $to_col, $promo) = $pos->parse_pretty_move($moves->[$i]);
                my $next_move = $moves->[$i];
                my $bpfen = $pos->bitpacked_fen;
-               my $bpfen_q = $dbh->quote($bpfen, { pg_type => DBD::Pg::PG_BYTEA });
                my $fen = $pos->fen;
                $opening = ECO::get_opening_num($pos) // $opening;
                print "$fen $next_move $result $opening\n" if $TEXTOUT;
                my $fen = $pos->fen;
                $opening = ECO::get_opening_num($pos) // $opening;
                print "$fen $next_move $result $opening\n" if $TEXTOUT;
@@ -59,8 +54,6 @@ while ($pgn->read_game()) {
                        print $binresult . $binwhiteelo . $binblackelo;
                        print pack('l', $opening);
                }
                        print $binresult . $binwhiteelo . $binblackelo;
                        print pack('l', $opening);
                }
-               $dbh->pg_putcopydata("$bpfen_q\t$next_move\t$result\n") unless $DRYRUN;
                $pos = $pos->make_move($from_row, $from_col, $to_row, $to_col, $promo, $moves->[$i]);
        }
 }
                $pos = $pos->make_move($from_row, $from_col, $to_row, $to_col, $promo, $moves->[$i]);
        }
 }
-$dbh->pg_putcopyend unless $DRYRUN;