r26011 - in /trunk/liborlite-perl: Changes MANIFEST META.yml README debian/changelog debian/control lib/ORLite.pm t/06_create.t t/lib/Test.pm

gwolf at users.alioth.debian.org gwolf at users.alioth.debian.org
Tue Oct 14 05:01:22 UTC 2008


Author: gwolf
Date: Tue Oct 14 05:01:17 2008
New Revision: 26011

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26011
Log:
Preparing new upstream release

Added:
    trunk/liborlite-perl/t/06_create.t
      - copied unchanged from r26010, branches/upstream/liborlite-perl/current/t/06_create.t
Modified:
    trunk/liborlite-perl/Changes
    trunk/liborlite-perl/MANIFEST
    trunk/liborlite-perl/META.yml
    trunk/liborlite-perl/README
    trunk/liborlite-perl/debian/changelog
    trunk/liborlite-perl/debian/control
    trunk/liborlite-perl/lib/ORLite.pm
    trunk/liborlite-perl/t/lib/Test.pm

Modified: trunk/liborlite-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/Changes?rev=26011&op=diff
==============================================================================
--- trunk/liborlite-perl/Changes (original)
+++ trunk/liborlite-perl/Changes Tue Oct 14 05:01:17 2008
@@ -1,4 +1,12 @@
 Changes for Perl extension ORLite
+
+0.15 Wed 24 Sep 2008
+	- Adding support for writable pragmas
+	- Adding tests for pragmas, schema_version and user_version
+
+0.14 Tue 23 Sep 2008
+	- Removed the last remnants of %ORLite::DSN and %ORLite::DBH.
+	- Added support for the "create" param to allow database creation
 
 0.13 Fri 19 Sep 2008
 	- Fixed critical bug introduced in 0.10 or somewhere around there,

Modified: trunk/liborlite-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/MANIFEST?rev=26011&op=diff
==============================================================================
--- trunk/liborlite-perl/MANIFEST (original)
+++ trunk/liborlite-perl/MANIFEST Tue Oct 14 05:01:17 2008
@@ -21,6 +21,7 @@
 t/03_fk.t
 t/04_readonly.t
 t/05_notables.t
+t/06_create.t
 t/97_meta.t
 t/98_pod.t
 t/99_pmv.t

Modified: trunk/liborlite-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/META.yml?rev=26011&op=diff
==============================================================================
--- trunk/liborlite-perl/META.yml (original)
+++ trunk/liborlite-perl/META.yml Tue Oct 14 05:01:17 2008
@@ -25,4 +25,4 @@
   perl: 5.6.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.13
+version: 0.15

Modified: trunk/liborlite-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/README?rev=26011&op=diff
==============================================================================
--- trunk/liborlite-perl/README (original)
+++ trunk/liborlite-perl/README Tue Oct 14 05:01:17 2008
@@ -228,7 +228,7 @@
 
   pragma
       # Get the user_version for the schema
-      my $version = Foo::Bar->pragma('schema_version');
+      my $version = Foo::Bar->pragma('user_version');
 
     The "pragma" method provides a convenient method for fetching a pragma
     for a datase. See the SQLite documentation for more details.
@@ -241,6 +241,8 @@
 TO DO
     - Support for intuiting reverse relations from foreign keys
 
+    - Document the 'create' and 'table' params
+
 SUPPORT
     Bugs should be reported via the CPAN bug tracker at
 

Modified: trunk/liborlite-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/changelog?rev=26011&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/changelog (original)
+++ trunk/liborlite-perl/debian/changelog Tue Oct 14 05:01:17 2008
@@ -1,3 +1,10 @@
+liborlite-perl (0.15-1) unstable; urgency=low
+
+  * New upstream release
+  * Added myself as an uploader
+
+ -- Gunnar Wolf <gwolf at debian.org>  Mon, 13 Oct 2008 23:58:20 -0500
+
 liborlite-perl (0.13-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/liborlite-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/control?rev=26011&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/control (original)
+++ trunk/liborlite-perl/debian/control Tue Oct 14 05:01:17 2008
@@ -7,7 +7,7 @@
  libtest-cpan-meta-perl,
  libpod-simple-perl (>= 3.07), libtest-pod-perl, libtest-minimumversion-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Damyan Ivanov <dmn at debian.org>
+Uploaders: Damyan Ivanov <dmn at debian.org>, Gunnar Wolf <gwolf at debian.org>
 Standards-Version: 3.8.0
 Homepage: http://search.cpan.org/dist/ORLite/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liborlite-perl/

Modified: trunk/liborlite-perl/lib/ORLite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/lib/ORLite.pm?rev=26011&op=diff
==============================================================================
--- trunk/liborlite-perl/lib/ORLite.pm (original)
+++ trunk/liborlite-perl/lib/ORLite.pm Tue Oct 14 05:01:17 2008
@@ -18,11 +18,9 @@
 	require DBD::SQLite;
 }
 
-use vars qw{$VERSION %DSN %DBH};
+use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.13';
-	%DSN     = ();
-	%DBH     = ();
+	$VERSION = '0.15';
 }
 
 
@@ -57,11 +55,21 @@
 	} else {
 		Carp::croak("Missing, empty or invalid params HASH");
 	}
-	unless ( defined _STRING($params{file}) and -f $params{file} ) {
-		Carp::croak("Missing or invalid file param");	
+	unless ( defined $params{create} ) {
+		$params{create} = 0;
+	}
+	unless (
+		defined _STRING($params{file})
+		and (
+			$params{create}
+			or
+			-f $params{file}
+		)
+	) {
+		Carp::croak("Missing or invalid file param");
 	}
 	unless ( defined $params{readonly} ) {
-		$params{readonly} = ! -w $params{file};
+		$params{readonly} = $params{create} ? 0 : ! -w $params{file};
 	}
 	unless ( defined $params{tables} ) {
 		$params{tables} = 1;
@@ -77,9 +85,8 @@
 	my $file     = File::Spec->rel2abs($params{file});
 	my $pkg      = $params{package};
 	my $readonly = $params{readonly};
-	$DSN{$pkg}   = "dbi:SQLite:$file";
-	$DBH{$pkg}   = undef;
-	my $dbh      = DBI->connect($DSN{$pkg});
+	my $dsn      = "dbi:SQLite:$file";
+	my $dbh      = DBI->connect($dsn);
 
 	# Check the schema version before generating
 	my $version  = $dbh->selectrow_arrayref('pragma user_version')->[0];
@@ -93,12 +100,9 @@
 
 use strict;
 
-my \$DSN = 'dbi:SQLite:$file';
 my \$DBH = undef;
 
-sub dsn {
-	\$DSN;
-}
+sub dsn { '$dsn' }
 
 sub dbh {
 	\$DBH or
@@ -143,7 +147,8 @@
 }
 
 sub pragma {
-	shift->selectrow_arrayref('pragma ' . shift)->[0];
+	\$_[0]->do("pragma \$_[1] = \$_[2]") if \@_ > 2;
+	\$_[0]->selectrow_arrayref("pragma \$_[1]")->[0];
 }
 
 END_PERL
@@ -178,7 +183,7 @@
 	# Optionally generate the table classes
 	if ( $params{tables} ) {
 		# Capture the raw schema information
-		my $tables   = $dbh->selectall_arrayref(
+		my $tables = $dbh->selectall_arrayref(
 			'select * from sqlite_master where type = ?',
 			{ Slice => {} }, 'table',
 		);
@@ -601,7 +606,7 @@
 =head2 pragma
 
   # Get the user_version for the schema
-  my $version = Foo::Bar->pragma('schema_version');
+  my $version = Foo::Bar->pragma('user_version');
 
 The C<pragma> method provides a convenient method for fetching a pragma
 for a datase. See the SQLite documentation for more details.
@@ -616,6 +621,8 @@
 
 - Support for intuiting reverse relations from foreign keys
 
+- Document the 'create' and 'table' params
+
 =head1 SUPPORT
 
 Bugs should be reported via the CPAN bug tracker at

Modified: trunk/liborlite-perl/t/lib/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/lib/Test.pm?rev=26011&op=diff
==============================================================================
--- trunk/liborlite-perl/t/lib/Test.pm (original)
+++ trunk/liborlite-perl/t/lib/Test.pm Tue Oct 14 05:01:17 2008
@@ -8,7 +8,7 @@
 
 use vars qw{$VERSION @ISA @EXPORT};
 BEGIN {
-	$VERSION = '0.13';
+        $VERSION = '0.15';
 	@ISA     = qw{ Exporter };
 	@EXPORT  = qw{ test_db connect_ok create_ok };
 }




More information about the Pkg-perl-cvs-commits mailing list