cvsuser 04/09/02 13:59:16
Modified: App-Repository Makefile.PL TODO
App-Repository/t DBI-connect.t DBI-delete.t DBI-getset.t
DBI-insert.t DBI-metadata.t DBI-select.t
DBI-update.t
Log:
updated
Revision Changes Path
1.6 +2 -2 p5ee/App-Repository/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/Makefile.PL,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- Makefile.PL 18 Jun 2003 14:56:29 -0000 1.5
+++ Makefile.PL 2 Sep 2004 20:59:16 -0000 1.6
@@ -1,6 +1,6 @@
######################################################################
-## File: $Id: Makefile.PL,v 1.5 2003/06/18 14:56:29 spadkins Exp $
+## File: $Id: Makefile.PL,v 1.6 2004/09/02 20:59:16 spadkins Exp $
######################################################################
use ExtUtils::MakeMaker;
@@ -10,7 +10,7 @@
%opts = (
'NAME' => 'App-Repository',
'DISTNAME' => 'App-Repository',
- 'VERSION' => '0.01',
+ 'VERSION' => '0.90',
'PREREQ_PM' => { #'App::Context' => 0, # core services
'DBI' => 0, # database access
},
1.3 +1 -5 p5ee/App-Repository/TODO
Index: TODO
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/TODO,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- TODO 18 Nov 2003 21:38:09 -0000 1.2
+++ TODO 2 Sep 2004 20:59:16 -0000 1.3
@@ -1,5 +1,5 @@
######################################################################
-## File: $Id: TODO,v 1.2 2003/11/18 21:38:09 spadkins Exp $
+## File: $Id: TODO,v 1.3 2004/09/02 20:59:16 spadkins Exp $
######################################################################
o App::Repository - Multiple (delegated) repositories
@@ -8,10 +8,6 @@
o App::Repository - $rep->purge(...)
o App::Repository::MySQL - $rep->purge(...)
- x App::Repository - $rep->get_hash(...)
- x App::Repository - $rep->get_rows($tab, ..., undef)
- x App::Repository - $rep->get_rows($tab, ..., [])
- x App::Repository - $rep->get_rows($tab, undef)
o App::Repository - $rep->set_rows(...)
o App::Repository - $rep->maintain(...)
o App::Repository - $rep->export(...)
1.2 +2 -0 p5ee/App-Repository/t/DBI-connect.t
Index: DBI-connect.t
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/t/DBI-connect.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- DBI-connect.t 21 May 2003 15:43:35 -0000 1.1
+++ DBI-connect.t 2 Sep 2004 20:59:16 -0000 1.2
@@ -20,6 +20,7 @@
default => {
class => "App::Repository::MySQL",
dbidriver => "mysql",
+ dbhost => "frento",
dbname => "test",
dbuser => "dbuser",
dbpass => "dbuser7",
@@ -56,6 +57,7 @@
# get a repository (no need for config file)
my $rep = App::Repository::MySQL->new("test2",
dbidriver => "mysql",
+ dbhost => "frento",
dbname => "test",
dbuser => "dbuser",
dbpass => "dbuser7",
1.4 +1 -0 p5ee/App-Repository/t/DBI-delete.t
Index: DBI-delete.t
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/t/DBI-delete.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- DBI-delete.t 18 Jun 2003 20:43:26 -0000 1.3
+++ DBI-delete.t 2 Sep 2004 20:59:16 -0000 1.4
@@ -17,6 +17,7 @@
default => {
class => "App::Repository::MySQL",
dbidriver => "mysql",
+ dbhost => "frento",
dbname => "test",
dbuser => "dbuser",
dbpass => "dbuser7",
1.3 +1 -0 p5ee/App-Repository/t/DBI-getset.t
Index: DBI-getset.t
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/t/DBI-getset.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- DBI-getset.t 18 Nov 2003 21:38:10 -0000 1.2
+++ DBI-getset.t 2 Sep 2004 20:59:16 -0000 1.3
@@ -17,6 +17,7 @@
default => {
class => "App::Repository::MySQL",
dbidriver => "mysql",
+ dbhost => "frento",
dbname => "test",
dbuser => "dbuser",
dbpass => "dbuser7",
1.2 +1 -0 p5ee/App-Repository/t/DBI-insert.t
Index: DBI-insert.t
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/t/DBI-insert.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- DBI-insert.t 21 May 2003 15:43:35 -0000 1.1
+++ DBI-insert.t 2 Sep 2004 20:59:16 -0000 1.2
@@ -17,6 +17,7 @@
default => {
class => "App::Repository::MySQL",
dbidriver => "mysql",
+ dbhost => "frento",
dbname => "test",
dbuser => "dbuser",
dbpass => "dbuser7",
1.2 +24 -7 p5ee/App-Repository/t/DBI-metadata.t
Index: DBI-metadata.t
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/t/DBI-metadata.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- DBI-metadata.t 21 May 2003 15:43:35 -0000 1.1
+++ DBI-metadata.t 2 Sep 2004 20:59:16 -0000 1.2
@@ -17,11 +17,18 @@
default => {
class => "App::Repository::MySQL",
dbidriver => "mysql",
+ dbhost => "frento",
dbname => "test",
dbuser => "dbuser",
dbpass => "dbuser7",
table => {
- test_person => {
+ test_person2 => {
+ primary_key => "last_name,first_name",
+ },
+ test_person3 => {
+ primary_key => [ "person_id" ],
+ },
+ test_person4 => {
primary_key => "person_id",
},
},
@@ -55,20 +62,30 @@
index person_ie1 (last_name, first_name)
)
EOF
- $dbh->do($ddl);
+ my $success = $dbh->do($ddl);
+ #print "create table = [$success]\n";
}
###########################################################################
# METADATA TESTS
###########################################################################
my $table_names = $db->get_table_names();
+#print "[EMAIL PROTECTED]";
my %tables = ( map { $_ => 1 } @$table_names );
ok(defined $tables{test_person}, "get_table_names()");
-is($db->{table}{test_person}{primary_key}, "person_id", "primary_key set from
config");
-
-{
- eval { $db->{dbh}->do("drop table test_person"); };
-}
+$db->_load_rep_metadata();
+$db->_load_table_metadata("test_person");
+$db->_load_table_metadata("test_person2");
+$db->_load_table_metadata("test_person3");
+$db->_load_table_metadata("test_person4");
+is_deeply($db->{table}{test_person}{primary_key}, ["person_id"], "primary_key set
from db");
+is_deeply($db->{table}{test_person2}{primary_key}, ["last_name", "first_name"],
"primary_key set from config (comma-sep)");
+is_deeply($db->{table}{test_person3}{primary_key}, ["person_id"], "primary_key set
from config (scalar)");
+is_deeply($db->{table}{test_person4}{primary_key}, ["person_id"], "primary_key set
from config (scalar)");
+
+#{
+# eval { $db->{dbh}->do("drop table test_person"); };
+#}
exit 0;
1.6 +1 -0 p5ee/App-Repository/t/DBI-select.t
Index: DBI-select.t
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/t/DBI-select.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- DBI-select.t 18 Feb 2004 13:17:40 -0000 1.5
+++ DBI-select.t 2 Sep 2004 20:59:16 -0000 1.6
@@ -17,6 +17,7 @@
default => {
class => "App::Repository::MySQL",
dbidriver => "mysql",
+ dbhost => "frento",
dbname => "test",
dbuser => "dbuser",
dbpass => "dbuser7",
1.2 +1 -0 p5ee/App-Repository/t/DBI-update.t
Index: DBI-update.t
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/t/DBI-update.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- DBI-update.t 21 May 2003 15:43:35 -0000 1.1
+++ DBI-update.t 2 Sep 2004 20:59:16 -0000 1.2
@@ -17,6 +17,7 @@
default => {
class => "App::Repository::MySQL",
dbidriver => "mysql",
+ dbhost => "frento",
dbname => "test",
dbuser => "dbuser",
dbpass => "dbuser7",