Author: spadkins
Date: Mon Sep 4 12:00:52 2006
New Revision: 6848
Modified:
p5ee/trunk/App-Repository/CHANGES
p5ee/trunk/App-Repository/MANIFEST
p5ee/trunk/App-Repository/Makefile.PL
p5ee/trunk/App-Repository/TODO
p5ee/trunk/App-Repository/lib/App/Repository.pm
p5ee/trunk/App-Repository/lib/App/RepositoryObject.pm
p5ee/trunk/App-Repository/lib/App/SessionObject/RepositoryObjectDomain.pm
p5ee/trunk/App-Repository/lib/App/SessionObject/RepositoryObjectSet.pm
p5ee/trunk/App-Repository/lib/App/ValueDomain/Repository.pm
p5ee/trunk/App-Repository/lib/App/ValueDomain/RepositoryTableColumns.pm
p5ee/trunk/App-Repository/lib/App/ValueDomain/RepositoryTables.pm
Log:
freeze for 0.964
Modified: p5ee/trunk/App-Repository/CHANGES
==============================================================================
--- p5ee/trunk/App-Repository/CHANGES (original)
+++ p5ee/trunk/App-Repository/CHANGES Mon Sep 4 12:00:52 2006
@@ -2,6 +2,13 @@
# CHANGE LOG
#########################################
+0.964
+ x add bin/dbget
+ x add default params and params that don't relate to column names
+ x fix index hints.
+ x clean up MySQL explain
+ x change author email to [EMAIL PROTECTED]
+
0.963
x add support for qualified classes on a single table (i.e.
get_object("person",...)
may return an App::RepositoryObject::Man or an App::RepositoryObject::Woman
depending
Modified: p5ee/trunk/App-Repository/MANIFEST
==============================================================================
--- p5ee/trunk/App-Repository/MANIFEST (original)
+++ p5ee/trunk/App-Repository/MANIFEST Mon Sep 4 12:00:52 2006
@@ -11,6 +11,7 @@
lib/App/SessionObject/RepositoryObjectSet.pm
lib/App/SessionObject/RepositoryObjectDomain.pm
lib/App/ValueDomain/Repository.pm
+bin/dbget
t/DBI-connect.t
t/DBI-delete.t
t/DBI-getset.t
Modified: p5ee/trunk/App-Repository/Makefile.PL
==============================================================================
--- p5ee/trunk/App-Repository/Makefile.PL (original)
+++ p5ee/trunk/App-Repository/Makefile.PL Mon Sep 4 12:00:52 2006
@@ -7,15 +7,20 @@
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
+my @programs = (
+ "bin/dbget",
+);
+
%opts = (
- 'NAME' => 'App-Repository',
'DISTNAME' => 'App-Repository',
- 'VERSION' => '0.963',
- 'PREREQ_PM' => { #'App::Context' => 0, # core services
- 'DBI' => 0, # database access
+ 'VERSION' => '0.964',
+ 'EXE_FILES' => [ @programs ],
+ 'PREREQ_PM' => {
+ 'App::Options' => "0.01", # core services
+ 'App::Context' => "0.01", # core services
+ 'DBI' => "0.01", # database access
+ 'DBIx::Compat' => "0.01", # database compatibility
},
- 'dist' => {'COMPRESS'=>'gzip -9f', 'SUFFIX' => 'gz',
- 'ZIP'=>'/usr/bin/zip','ZIPFLAGS'=>'-rl'},
);
######################################################################
Modified: p5ee/trunk/App-Repository/TODO
==============================================================================
--- p5ee/trunk/App-Repository/TODO (original)
+++ p5ee/trunk/App-Repository/TODO Mon Sep 4 12:00:52 2006
@@ -9,6 +9,8 @@
o go over the documentation which is terrible and has been completely
neglected
o ensure it runs (and tests cleanly!) on MSWin32
o get it to run against Oracle
+ o create a metadata-producer utility
+ o remove dependence on DBIx::Compat (remove from Makefile.PL)
Other stuff
o caching rows by key
Modified: p5ee/trunk/App-Repository/lib/App/Repository.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/Repository.pm Mon Sep 4 12:00:52 2006
@@ -888,20 +888,30 @@
return($columns);
}
+# Called from get_rows()/get_row() in preparation for expression evaluation.
+# i.e. when there is at least one column in the selected list which is an
+# "expression" (i.e. {table}{foo}{column}{pi_2}{expr} => "{pi}/2").
+# If there are expressions defined in a get_rows() request, they may depend
+# on other columns which are not included in the columns requested. In that
+# case, we need to add them.
sub extend_columns {
&App::sub_entry if ($App::trace);
my ($self, $table, $cols) = @_;
my (%colidx, $expr_columns, $expr, $extended, $col);
+ # Take note of which columns are alread in the list of requested columns.
for (my $i = 0; $i <= $#$cols; $i++) {
$col = $cols->[$i];
$colidx{$col} = $i;
}
+ # Search each {expr} column for what other columns it depends on.
my $column_defs = $self->{table}{$table}{column};
for (my $i = 0; $i <= $#$cols; $i++) {
$col = $cols->[$i];
+ # The column may have an explicit definition of the columns it depends
on.
if ($column_defs->{$col}{expr_columns}) {
$expr_columns = $column_defs->{$col}{expr_columns};
}
+ # or we may have to parse the {expr} itself to determine them.
elsif ($column_defs->{$col}{expr}) {
$expr = $column_defs->{$col}{expr};
$expr =~ s/^[^\{\}]*\{//;
@@ -912,17 +922,22 @@
else {
next;
}
+ # Go through each column required for the expression and ensure it's
+ # included in the list of requested columns. If not, tack it on at
+ # the end.
foreach my $expr_col (@$expr_columns) {
if (! defined $colidx{$expr_col}) {
if (!$extended) {
$cols = [ @$cols ]; # make a copy. don't extend original.
$extended = 1;
}
- push(@$cols, $expr_col);
+ push(@$cols, $expr_col); # extend the column list.
$colidx{$expr_col} = $#$cols;
}
}
}
+ # Returns the column list which is suitably extended to satisfy any
+ # expressions there might be.
&App::sub_exit($cols) if ($App::trace);
return($cols);
}
@@ -3523,7 +3538,7 @@
=head1 ACKNOWLEDGEMENTS
- * Author: Stephen Adkins <[EMAIL PROTECTED]>
+ * Author: Stephen Adkins <[EMAIL PROTECTED]>
* License: This is free software. It is licensed under the same terms as Perl
itself.
=head1 SEE ALSO
Modified: p5ee/trunk/App-Repository/lib/App/RepositoryObject.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/RepositoryObject.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/RepositoryObject.pm Mon Sep 4
12:00:52 2006
@@ -212,7 +212,7 @@
=head1 ACKNOWLEDGEMENTS
- * Author: Stephen Adkins <[EMAIL PROTECTED]>
+ * Author: Stephen Adkins <[EMAIL PROTECTED]>
* License: This is free software. It is licensed under the same terms as Perl
itself.
=head1 SEE ALSO
Modified:
p5ee/trunk/App-Repository/lib/App/SessionObject/RepositoryObjectDomain.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/SessionObject/RepositoryObjectDomain.pm
(original)
+++ p5ee/trunk/App-Repository/lib/App/SessionObject/RepositoryObjectDomain.pm
Mon Sep 4 12:00:52 2006
@@ -153,7 +153,7 @@
=head1 ACKNOWLEDGEMENTS
- * Author: Stephen Adkins <[EMAIL PROTECTED]>
+ * Author: Stephen Adkins <[EMAIL PROTECTED]>
* License: This is free software. It is licensed under the same terms as Perl
itself.
=head1 SEE ALSO
Modified: p5ee/trunk/App-Repository/lib/App/SessionObject/RepositoryObjectSet.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/SessionObject/RepositoryObjectSet.pm
(original)
+++ p5ee/trunk/App-Repository/lib/App/SessionObject/RepositoryObjectSet.pm
Mon Sep 4 12:00:52 2006
@@ -415,7 +415,7 @@
=head1 ACKNOWLEDGEMENTS
- * Author: Stephen Adkins <[EMAIL PROTECTED]>
+ * Author: Stephen Adkins <[EMAIL PROTECTED]>
* License: This is free software. It is licensed under the same terms as Perl
itself.
=head1 SEE ALSO
Modified: p5ee/trunk/App-Repository/lib/App/ValueDomain/Repository.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/ValueDomain/Repository.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/ValueDomain/Repository.pm Mon Sep 4
12:00:52 2006
@@ -193,7 +193,7 @@
=head1 ACKNOWLEDGEMENTS
- * Author: Stephen Adkins <[EMAIL PROTECTED]>
+ * Author: Stephen Adkins <[EMAIL PROTECTED]>
* License: This is free software. It is licensed under the same terms as Perl
itself.
=head1 SEE ALSO
Modified:
p5ee/trunk/App-Repository/lib/App/ValueDomain/RepositoryTableColumns.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/ValueDomain/RepositoryTableColumns.pm
(original)
+++ p5ee/trunk/App-Repository/lib/App/ValueDomain/RepositoryTableColumns.pm
Mon Sep 4 12:00:52 2006
@@ -112,7 +112,7 @@
=head1 ACKNOWLEDGEMENTS
- * Author: Stephen Adkins <[EMAIL PROTECTED]>
+ * Author: Stephen Adkins <[EMAIL PROTECTED]>
* License: This is free software. It is licensed under the same terms as Perl
itself.
=head1 SEE ALSO
Modified: p5ee/trunk/App-Repository/lib/App/ValueDomain/RepositoryTables.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/ValueDomain/RepositoryTables.pm
(original)
+++ p5ee/trunk/App-Repository/lib/App/ValueDomain/RepositoryTables.pm Mon Sep
4 12:00:52 2006
@@ -95,7 +95,7 @@
=head1 ACKNOWLEDGEMENTS
- * Author: Stephen Adkins <[EMAIL PROTECTED]>
+ * Author: Stephen Adkins <[EMAIL PROTECTED]>
* License: This is free software. It is licensed under the same terms as Perl
itself.
=head1 SEE ALSO