Changeset 1540

Show
Ignore:
Timestamp:
04/16/05 05:37:47
Author:
miyagawa
Message:

0.09

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Class-DBI-SQLite/trunk/Changes

    r1521 r1540  
    11Revision history for Perl extension Class::DBI::SQLite 
     2 
     30.09  Sat Apr 16 05:35:45 JST 2005 
     4        - Fixed some bugs in Multi PK support 
     5          (Thanks to David Naughton) 
    26 
    370.08  Thu Mar 17 18:17:34 JST 2005 
  • Class-DBI-SQLite/trunk/MANIFEST

    r1499 r1540  
    22lib/Class/DBI/SQLite.pm 
    33Makefile.PL 
    4 MANIFEST 
    5 META.yml                       Module meta-data (added by MakeMaker) 
     4MANIFEST                       This list of files 
     5META.yml 
    66t/00_compile.t 
    77t/01_sqlite.t 
    88t/02_table.t 
     9t/03_multi_pk.t 
    910t/lib/Film.pm 
  • Class-DBI-SQLite/trunk/MANIFEST.SKIP

    r560 r1540  
    1010\.gz$ 
    1111\.cvsignore 
     12\.svn 
  • Class-DBI-SQLite/trunk/lib/Class/DBI/SQLite.pm

    r1521 r1540  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = "0.08"; 
     5$VERSION = "0.09"; 
    66 
    77require Class::DBI; 
     
    3333    $sth->finish; 
    3434    my ($primary) = $sql =~ m/ 
    35     (?:\(|\,) # either a ( to start the definition or a , for next  
    36     \s* # maybe some whitespace 
    37     (\w+) # the col name 
    38     [^,]* #anything but the end or a ',' for next column 
     35    (?:\(|\,) # either a ( to start the definition or a , for next 
     36    \s*       # maybe some whitespace 
     37    (\w+)     # the col name 
     38    [^,]*     # anything but the end or a ',' for next column 
    3939    PRIMARY\sKEY/sxi; 
    40     my @mpks; 
    41     unless ($primary) {  
    42         my ($mpks)= $sql =~ m/PRIMARY\s+KEY\s*\(\s*(.+)\s*\)/; 
    43         @mpks = split m/\s*\,\s*/,$mpks; 
     40    my @pks; 
     41    if ($primary) { 
     42        @pks = ($primary); 
     43    } else { 
     44        my ($pks)= $sql =~ m/PRIMARY\s+KEY\s*\(\s*([^)]+)\s*\)/; 
     45        @pks = split m/\s*\,\s*/, $pks; 
    4446    } 
    4547    $class->table($table); 
     48    $class->columns(Primary => @pks); 
    4649    $class->columns(All => @columns); 
    47     $class->columns(Primary => $primary || @mpks); 
    4850} 
    4951 
     
    7274=head1 DESCRIPTION 
    7375 
    74 Class::DBI::SQLite is an extension to Class::DBI for DBD::SQLite, 
    75 which allows you to populate auto incremented row id after insert. 
     76Class::DBI::SQLite is an extension to Class::DBI for DBD::SQLite. 
     77It allows you to populate an auto-incremented row id after insert. 
    7678 
    77 C<set_up_table> method allows you to automate the setup of columns and 
    78 primary key by using of SQLite PRAGMA statement  
     79The C<set_up_table> method automates the setup of columns and 
     80primary key(s) via the SQLite PRAGMA statement. 
    7981 
    8082=head1 AUTHOR