Skip Menu |
 

This queue is for tickets about the DBIx-DBH CPAN distribution.

Report information
The Basics
Id: 18053
Status: resolved
Worked: 10 min
Priority: 0/
Queue: DBIx-DBH

People
Owner: metaperl [...] gmail.com
Requestors: mark [...] summersault.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.09
Fixed in: (no value)



Subject: PATCH: add SQLite driver
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1141786288-26161-2"
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 500
Download (untitled) / with headers
text/plain 500b
Attached is a patch to add a SQLite driver, including code tests and docs. It's validated a bit different than the others. I didn't like the idea of hardcoded all the current SQLite or DBI attributes into the module, as this will require maintenance when those interfaces change. The provided design is helpful for the project I'm working on now where host => undef may be provided to SQLite driver. Although SQLite doesn't use the host option, I'd still like to accept it. Mark
Subject: sqlite.patch
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1141786288-26161-1"
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Type: text/x-diff; name="sqlite.patch"
Content-Disposition: inline; filename="sqlite.patch"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: ascii
Content-Length: 2496
Download sqlite.patch
text/x-diff 2.4k
Tue Mar 7 21:46:38 EST 2006 Mark Stosberg <mark@summersault.com> * Add SQLite driver diff -rN -u old-DBIx-DBH-0.09/ChangeLog new-DBIx-DBH-0.09/ChangeLog --- old-DBIx-DBH-0.09/ChangeLog 2006-03-07 21:47:25.000000000 -0500 +++ new-DBIx-DBH-0.09/ChangeLog 2006-03-07 21:47:25.000000000 -0500 @@ -1,4 +1,6 @@ + * Add SQLite driver (Mark Stosberg) + * Allow new drivers to published and used without modifying DBIx::DBH (Mark Stosberg) 2004-12-01 Terrence Brannon <terry@hcoop.net> diff -rN -u old-DBIx-DBH-0.09/lib/DBIx/DBH/SQLite.pm new-DBIx-DBH-0.09/lib/DBIx/DBH/SQLite.pm --- old-DBIx-DBH-0.09/lib/DBIx/DBH/SQLite.pm 1969-12-31 19:00:00.000000000 -0500 +++ new-DBIx-DBH-0.09/lib/DBIx/DBH/SQLite.pm 2006-03-07 21:47:25.000000000 -0500 @@ -0,0 +1,49 @@ +package DBIx::DBH::SQLite; + +use base qw(DBIx::DBH); +use Params::Validate qw( :all ); + +sub connect_data { + my $class = shift; + my %p = validate_with( + params => \@_, + spec => { + driver => { type => SCALAR }, + dbname => { type => SCALAR }, + attr => { type => SCALAR | UNDEF, optional => 1 }, + user => { type => SCALAR | UNDEF, optional => 1 }, + password => { type => SCALAR | UNDEF, optional => 1 }, + host => { type => SCALAR | UNDEF, optional => 1 }, + port => { type => SCALAR | UNDEF, optional => 1 }, + }, + # allow_extra => 1, + ); + + my $dsn = "DBI:$p{driver}:$p{dbname}"; + + return ($dsn, $p{user}, $p{password}, $p{attr}); + +} + + +1; + +=head1 NAME + + DBIx::DBH::SQLite - SQLite DBI database handle connection specifics. + +=head1 connect() + +dbname is probably the only one param you need. We pass through C<user>, C<password>, +and C<attr>, ignoring other attributes. + +=head1 SEE ALSO + +L<DBIx::DBH> +L<DBD::SQLite> + +=head1 AUTHOR + +Mark Stosberg, mark@summersault.com + +=cut diff -rN -u old-DBIx-DBH-0.09/t/SQLite.t new-DBIx-DBH-0.09/t/SQLite.t --- old-DBIx-DBH-0.09/t/SQLite.t 1969-12-31 19:00:00.000000000 -0500 +++ new-DBIx-DBH-0.09/t/SQLite.t 2006-03-07 21:47:25.000000000 -0500 @@ -0,0 +1,16 @@ +use Test::More qw/no_plan/; +use DBIx::DBH; + +my @dat = ( + driver => 'SQLite', + dbname => 'db_terry', + user => 'terry', + password => 'markso' , + host => 'foo', + port => 'zoo', +) ; + +sub make_data { return DBIx::DBH->form_dsn( @dat ); } + +is(make_data, 'DBI:SQLite:db_terry'); +
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.5.HEAD-4552-1141831760-1664.18053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: mark [...] summersault.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 183
Download (untitled) / with headers
text/plain 183b
Thanks for accepting this patch. It looks like the patch didn't update the MANIFEST, and in turn it wasn't included in the new release. So 0.10 doesn't have SQLite support. Mark
X-Scanned-BY: AMaViS-ng at bestpractical
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,SPF_PASS
In-Reply-To: <rt-3.5.HEAD-4552-1141831760-1664.18053-5-0 [...] rt.cpan.org>
Content-Disposition: inline
Received-SPF: pass (x1.develooper.com: domain of metaperl [...] gmail.com designates 64.233.162.199 as permitted sender)
References: <RT-Ticket-18053 [...] rt.cpan.org> <rt-3.5.HEAD-4552-1141831760-1664.18053-5-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: ISO-8859-1
Received: from localhost (localhost.localdomain [127.0.0.1]) by diesel.bestpractical.com (Postfix) with ESMTP id 0D0F74D80D8 for <cpan-bug+dbix-dbh [...] diesel.bestpractical.com>; Wed, 8 Mar 2006 10:33:24 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 8129D4D809F for <bug-DBIx-DBH [...] rt.cpan.org>; Wed, 8 Mar 2006 10:33:24 -0500 (EST)
Received: (qmail 22843 invoked by alias); 8 Mar 2006 15:33:22 -0000
Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.199) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 08 Mar 2006 07:33:19 -0800
Received: by zproxy.gmail.com with SMTP id v1so217371nzb for <bug-DBIx-DBH [...] rt.cpan.org>; Wed, 08 Mar 2006 07:33:14 -0800 (PST)
Received: by 10.65.122.5 with SMTP id z5mr422366qbm; Wed, 08 Mar 2006 07:33:14 -0800 (PST)
Received: by 10.65.160.11 with HTTP; Wed, 8 Mar 2006 07:33:14 -0800 (PST)
Delivered-To: cpan-bug+dbix-dbh [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #18053] PATCH: add SQLite driver
Domainkey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=et1Ks/aHPCVE3+C1r1wRgIujs6+tBguBeTRnjrjOyEeSRdhPG0AS4M0I4ricag/IE+Z+cTlLnnVKzKAYV3/7j3zsNSqu1F69e319hEmHnOv3eQEOGz3Aw/Xpme2l2wVGwwrzwEr26kVJU0MTTAxH8CiroATRCJHQeZaW4TgfU5c=
Return-Path: <metaperl [...] gmail.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+dbix-dbh [...] diesel.bestpractical.com
Date: Wed, 8 Mar 2006 07:33:14 -0800
Message-Id: <a8e52b650603080733u1121a1baw81f89bb42c5fba97 [...] mail.gmail.com>
To: bug-DBIx-DBH [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: "Terrence Brannon" <metaperl [...] gmail.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.5.HEAD-4567-1141832011-532.18053-0-0 [...] rt.cpan.org>
Content-Length: 339
Download (untitled) / with headers
text/plain 339b
Ack. 0.11 will have it. On 3/8/06, Guest via RT <bug-DBIx-DBH@rt.cpan.org> wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=18053 > > > Thanks for accepting this patch. > > It looks like the patch didn't update the MANIFEST, and in turn it > wasn't included in the new release. So 0.10 doesn't have SQLite support. > > Mark >
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-26541-1272315175-514.18053-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 38
Ok added. New OO API is now standard.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.