cvs commit: p5ee/App-Repository/t DBI-select.t

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     05/04/05 11:50:36

  Modified:    App-Repository CHANGES MANIFEST TODO
               App-Repository/t DBI-select.t
  Log:
  sync up with distinct option
  
  Revision  Changes    Path
  1.2       +14 -0     p5ee/App-Repository/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Repository/CHANGES,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CHANGES	12 Oct 2002 03:03:48 -0000	1.1
  +++ CHANGES	5 Apr 2005 18:50:36 -0000	1.2
  @@ -2,3 +2,17 @@
   # CHANGE LOG
   #########################################
   
  +0.94
  + x add "distinct => 1" to options hash for get_rows()/get_row()
  + x recognize the following special cases in inferred-op params: '' (same as as 'ALL' in non-quoted/numeric params)
  + x recognize the following special cases in inferred-op params: 'ALL','NULL','NULL,value','@[db expr]'
  + x support set() with hash values. i.e. set($table,\@cols,\%values)
  +
  +0.93
  + x MySQL - auto_reconnect flag set
  + x DBI   - Reconnect on disconnect in _get_rows()/_get_row() (MySQL-specific?)
  + x MySQL - load primary key, alternate keys, indexes
  + x all   - Multiple (delegated) repositories
  +
  +0.90 First functional/supportable release
  +
  
  
  
  1.8       +11 -5     p5ee/App-Repository/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Repository/MANIFEST,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MANIFEST	27 Jun 2003 18:39:36 -0000	1.7
  +++ MANIFEST	5 Apr 2005 18:50:36 -0000	1.8
  @@ -1,18 +1,24 @@
  +CHANGES
  +MANIFEST
   Makefile.PL
   README
   TODO
  -CHANGES
  -MANIFEST
   lib/App/Repository.pm
   lib/App/Repository/DBI.pm
  -lib/App/Repository/MySQL.pm
   lib/App/Repository/File.pm
  +lib/App/Repository/FileSystem.pm
  +lib/App/Repository/MySQL.pm
   lib/App/RepositoryObject.pm
  +lib/App/SessionObject/RepositoryObjectSet.pm
  +lib/App/SessionObject/RepositoryObjectDomain.pm
   lib/App/ValueDomain/Repository.pm
   t/DBI-connect.t
  +t/DBI-delete.t
   t/DBI-getset.t
  +t/DBI-insert.t
   t/DBI-metadata.t
  +t/DBI-repobjects.t
  +t/DBI-repobjectset.t
   t/DBI-select.t
  -t/DBI-insert.t
   t/DBI-update.t
  -t/DBI-delete.t
  +t/FileSystem.t
  
  
  
  1.4       +33 -21    p5ee/App-Repository/TODO
  
  Index: TODO
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Repository/TODO,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TODO	2 Sep 2004 20:59:16 -0000	1.3
  +++ TODO	5 Apr 2005 18:50:36 -0000	1.4
  @@ -2,24 +2,36 @@
   ## File: $Id$
   ######################################################################
   
  - o App::Repository        - Multiple (delegated) repositories
  - o App::Repository::MySQL - Shared connections between repositories
  - o App::Repository::File
  - o App::Repository        - $rep->purge(...)
  - o App::Repository::MySQL - $rep->purge(...)
  -
  - o App::Repository        - $rep->set_rows(...)
  - o App::Repository        - $rep->maintain(...)
  - o App::Repository        - $rep->export(...)
  - o App::Repository        - $rep->import(...)
  - o App::Repository        - summaries
  - o App::Repository        - partitions
  - o App::Repository        - defaults
  - o App::Repository        - required cols
  - o App::Repository        - Read-only
  - o App::Repository        - read/write permissions
  - o App::Repository::MySQL - load primary key, alternate keys, indexes
  - o App::Repository        - ID generation
  - o App::Repository::DBI   - ID generation
  - o App::Repository::DBI   - cache, allows prepare/execute optimization
  + o RepositoryObjectSet
  +
  + o caching rows by key
  + o caching row-sets by set-key
  +
  + o DBI   - refactored/unified params/cols/values handling
  +           - arbitrarily complex where clauses
  +
  + o DBI   - auto-reconnect on all operations
  + o DBI   - bind variables on all operations
  + o all   - benchmarks
  + o Remote- make a remote repository work
  + o all   - get related rows (relationships)
  + o all   - $rep->set_rows(...)
  +
  + o MySQL - Shared connections between repositories
  + o File
  + o all   - $rep->purge(...)
  + o MySQL - $rep->purge(...)
  +
  + o all   - $rep->maintain(...)
  + o all   - $rep->export(...)
  + o all   - $rep->import(...)
  + o all   - summaries
  + o all   - partitions
  + o all   - defaults
  + o all   - required cols
  + o all   - Read-only
  + o all   - read/write permissions
  + o all   - ID generation
  + o DBI   - ID generation
  + o DBI   - "statement" cache, allows prepare/execute optimization
   
  
  
  
  1.10      +21 -2     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DBI-select.t	14 Mar 2005 16:42:15 -0000	1.9
  +++ DBI-select.t	5 Apr 2005 18:50:36 -0000	1.10
  @@ -75,13 +75,20 @@
   #ok(!$@, "set_rows() [test_person]");
   
   sub check_select {
  -    my ($sql, $expected_rows) = @_;
  +    my ($sql, $expected_rows, $debug) = @_;
   
       my ($rows, $reprows);
       eval {
           $rows = $dbh->selectall_arrayref($sql);
       };
       is($@,"","sql ok");
  +    if ($debug) {
  +        print $sql;
  +        print "ROWS [", ($#$rows + 1), "]\n";
  +        foreach my $row (@$rows) {
  +            print "ROW [", join("|", @$row), "]\n";
  +        }
  +    }
   
       if (defined $expected_rows) {
           is(($#$rows + 1), $expected_rows, "num rows $expected_rows");
  @@ -561,7 +568,19 @@
   $sql = $rep->_mk_select_sql("test_person",
                               {"age" => "ALL"},
                               ["first_name","last_name"]);
  -is($sql, $expect_sql, "_mk_select_sql(): NULL");
  +is($sql, $expect_sql, "_mk_select_sql(): explicit ALL");
  +&check_select($sql,0);
  +
  +$expect_sql = <<EOF;
  +select distinct
  +   gender
  +from test_person
  +EOF
  +$sql = $rep->_mk_select_sql("test_person",
  +                            {},
  +                            ["gender"],
  +                            {distinct => 1});
  +is($sql, $expect_sql, "_mk_select_sql(): distinct");
   &check_select($sql,0);
   
   ###########################################################################
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.