Permalink
Browse files

get rid of PgPir backend, which never really worked

Note that Pg now works, and that the parrot folks want to deprecated the Pg PIR module at some point
  • Loading branch information...
1 parent 8f525bc commit 7f80cb44a331e05d47556032a2f4865e5a50afe5 @moritz moritz committed Apr 22, 2012
Showing with 4 additions and 92 deletions.
  1. +4 −17 Makefile
  2. +0 −75 lib/MiniDBD/PgPir.pm6
View
@@ -25,43 +25,38 @@ lib/MiniDBD/mysql.pir: lib/MiniDBD/mysql.pm6 lib/MiniDBD.pir
lib/MiniDBD/Pg.pir: lib/MiniDBD/Pg.pm6 lib/MiniDBD.pir
export PERL6LIB=lib; $(PERL6_EXE) --target=pir --output=lib/MiniDBD/Pg.pir lib/MiniDBD/Pg.pm6
-lib/MiniDBD/PgPir.pir: lib/MiniDBD/PgPir.pm6 lib/MiniDBD.pir
- export PERL6LIB=lib; $(PERL6_EXE) --target=pir --output=lib/MiniDBD/PgPir.pir lib/MiniDBD/PgPir.pm6
-
lib/MiniDBD/SQLite.pir: lib/MiniDBD/SQLite.pm6 lib/MiniDBD.pir
export PERL6LIB=lib; $(PERL6_EXE) --target=pir --output=lib/MiniDBD/SQLite.pir lib/MiniDBD/SQLite.pm6
-lib/MiniDBI.pir: lib/MiniDBI.pm6 lib/MiniDBD/CSV.pir lib/MiniDBD/mysql.pir lib/MiniDBD/PgPir.pir lib/MiniDBD/Pg.pir lib/MiniDBD/SQLite.pir
+lib/MiniDBI.pir: lib/MiniDBI.pm6 lib/MiniDBD/CSV.pir lib/MiniDBD/mysql.pir lib/MiniDBD/Pg.pir lib/MiniDBD/SQLite.pir
export PERL6LIB=lib; $(PERL6_EXE) --target=pir --output=lib/MiniDBI.pir lib/MiniDBI.pm6
-test: lib/MiniDBI.pir lib/MiniDBD/CSV.pir lib/MiniDBD/mysql.pir lib/MiniDBD/PgPir.pir lib/MiniDBD/Pg.pir lib/MiniDBD/SQLite.pir
+test: lib/MiniDBI.pir lib/MiniDBD/CSV.pir lib/MiniDBD/mysql.pir lib/MiniDBD/Pg.pir lib/MiniDBD/SQLite.pir
@#export PERL6LIB=lib; prove --exec $(PERL6_EXE) t/10-mysql.t
@#export PERL6LIB=lib; prove --exec $(PERL6_EXE) t/20-CSV-common.t
@#export PERL6LIB=lib; prove --exec $(PERL6_EXE) t/25-mysql-common.t
@#export PERL6LIB=lib; prove --exec $(PERL6_EXE) t/30-pgpir.t
export PERL6LIB=lib; prove --exec $(PERL6_EXE) t/
# standard install is to the shared system wide directory
-install: lib/MiniDBI.pir lib/MiniDBD.pir lib/MiniDBD/mysql.pir lib/MiniDBD/PgPir.pir lib/MiniDBD/Pg.pir lib/MiniDBD/SQLite.pir
+install: lib/MiniDBI.pir lib/MiniDBD.pir lib/MiniDBD/mysql.pir lib/MiniDBD/Pg.pir lib/MiniDBD/SQLite.pir
@echo "--> $(LIBSYSTEM)"
@$(CP) lib/MiniDBI.pm6 lib/MiniDBI.pir $(LIBSYSTEM)
@$(CP) lib/MiniDBD.pm6 lib/MiniDBD.pir $(LIBSYSTEM)
@$(MKPATH) $(LIBSYSTEM)/MiniDBD
@$(CP) lib/MiniDBD/CSV.pm6 lib/MiniDBD/CSV.pir $(LIBSYSTEM)/MiniDBD
@$(CP) lib/MiniDBD/mysql.pm6 lib/MiniDBD/mysql.pir $(LIBSYSTEM)/MiniDBD
- @$(CP) lib/MiniDBD/PgPir.pm6 lib/MiniDBD/PgPir.pir $(LIBSYSTEM)/MiniDBD
@$(CP) lib/MiniDBD/Pg.pm6 lib/MiniDBD/Pg.pir $(LIBSYSTEM)/MiniDBD
@$(CP) lib/MiniDBD/SQLite.pm6 lib/MiniDBD/SQLite.pir $(LIBSYSTEM)/MiniDBD
# if user has no permission to install globally, try a personal directory
-install-user: lib/MiniDBI.pir lib/MiniDBD.pir lib/MiniDBD/mysql.pir lib/MiniDBD/PgPir.pir lib/MiniDBD/Pg.pir lib/MiniDBD/SQLite.pir
+install-user: lib/MiniDBI.pir lib/MiniDBD.pir lib/MiniDBD/mysql.pir lib/MiniDBD/Pg.pir lib/MiniDBD/SQLite.pir
@echo "--> $(LIBUSER)"
@$(CP) lib/MiniDBI.pm6 lib/MiniDBI.pir $(LIBUSER)
@$(CP) lib/MiniDBD.pm6 lib/MiniDBD.pir $(LIBUSER)
@$(MKPATH) $(LIBUSER)/MiniDBD
@$(CP) lib/MiniDBD/CSV.pm6 lib/MiniDBD/CSV.pir $(LIBUSER)/MiniDBD
@$(CP) lib/MiniDBD/mysql.pm6 lib/MiniDBD/mysql.pir $(LIBUSER)/MiniDBD
- @$(CP) lib/MiniDBD/PgPir.pm6 lib/MiniDBD/PgPir.pir $(LIBUSER)/MiniDBD
@$(CP) lib/MiniDBD/Pg.pm6 lib/MiniDBD/Pg.pir $(LIBUSER)/MiniDBD
@$(CP) lib/MiniDBD/SQLite.pm6 lib/MiniDBD/SQLite.pir $(LIBUSER)/MiniDBD
@@ -81,10 +76,6 @@ uninstall:
@$(RM_F) $(LIBSYSTEM)/MiniDBD/mysql.pm6
@$(TEST_F) $(LIBSYSTEM)/MiniDBD/mysql.pir
@$(RM_F) $(LIBSYSTEM)/MiniDBD/mysql.pir
- @$(TEST_F) $(LIBSYSTEM)/MiniDBD/PgPir.pm6
- @$(RM_F) $(LIBSYSTEM)/MiniDBD/PgPir.pm6
- @$(TEST_F) $(LIBSYSTEM)/MiniDBD/PgPir.pir
- @$(RM_F) $(LIBSYSTEM)/MiniDBD/PgPir.pir
@$(TEST_F) $(LIBSYSTEM)/MiniDBD/Pg.pm6
@$(RM_F) $(LIBSYSTEM)/MiniDBD/Pg.pm6
@$(TEST_F) $(LIBSYSTEM)/MiniDBD/Pg.pir
@@ -110,10 +101,6 @@ uninstall-user:
@$(RM_F) $(LIBUSER)/MiniDBD/mysql.pm6
@$(TEST_F) $(LIBUSER)/MiniDBD/mysql.pir
@$(RM_F) $(LIBUSER)/MiniDBD/mysql.pir
- @$(TEST_F) $(LIBUSER)/MiniDBD/PgPir.pm6
- @$(RM_F) $(LIBUSER)/MiniDBD/PgPir.pm6
- @$(TEST_F) $(LIBUSER)/MiniDBD/PgPir.pir
- @$(RM_F) $(LIBUSER)/MiniDBD/PgPir.pir
@$(TEST_F) $(LIBUSER)/MiniDBD/Pg.pm6
@$(RM_F) $(LIBUSER)/MiniDBD/Pg.pm6
@$(TEST_F) $(LIBUSER)/MiniDBD/Pg.pir
View
@@ -1,75 +0,0 @@
-use MiniDBD;
-pir::load_bytecode("Pg.pir");
-
-class MiniDBD::PgPir::StatementHandle does MiniDBD::StatementHandle {
- has $!name;
- has $!RaiseError;
-
-}
-
-class MiniDBD::PgPir::Connection does MiniDBD::Connection {
- has $!pg_conn;
- has $!statement_name = 'a';
- has $!RaiseError;
-
- method prepare(Str $statement) {
- my $name = $!statement_name++;
-
- # the third argument to .prepare() is the number of
- # bind where we want to explicitly specify the type
- my $handle = $!pg_conn.prepare($name, $statement, 0);
- }
-
- method status {
- my $c = $!pg_conn;
- ! Q:PIR {
- $P0 = find_lex '$c'
- $I0 = $P0.'status'()
- %r = box $I0
- }
- }
-
- method Bool { $.status };
-
-}
-
-class MiniDBD::PgPir:auth<moritz> {
-
- has $.Version = 0.01;
-
- sub pg_escape($x) {
- q[']
- ~ $x.subst(rx/\\|\'/, -> $m { '\\' ~ $m }, :g)
- ~ q['];
- }
-
- method connect(Str $user, Str $password, Str $params, $RaiseError) {
- my $pg = pir::new__pS('Pg');
-
- my %params = $params.split(';').map({ .split(regex {\s*\=\s*}, 2)}).flat;
-
-
- my %opt =
- user => pg_escape($user),
- password => pg_escape($password),
-# user => $user,
-# password => $password,
- %params;
- %opt<application_name> //= 'Perl6MiniDBD';
-
- say "Options: %opt.perl()";
-
- # nearly scary how concise this is in Perl 6 :-)
- my $connection_string = %opt.fmt('%s=%s', ';');
- say "Connection string: $connection_string";
- my $con = $pg.connectdb($connection_string);
- say "con: $con";
- }
-
- method finish() {
- # TODO
-# $!pg_conn.finish() if $.Bool;
- }
-}
-
-# vim: ft=perl6

0 comments on commit 7f80cb4

Please sign in to comment.