Skip Menu |
 

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 44882
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: TIMB [...] cpan.org
Cc:
AdminCc:

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



Subject: Use of $h->func() should be deprecated and replaced with calls to driver-private 'installed methods'
Download (untitled) / with headers
text/plain 930b
The old $h->func(...) way of calling driver-private methods is problematic, not least because it doesn't honour RaiseError etc! Drivers should install driver-private methods into the DBI dispatcher using the install_method() method when the driver is initialized. See http://search.cpan.org/~timb/DBI/lib/DBI/DBD.pm#The_driver_constructor (and the following "Using install_method() to expose driver-private methods" section. The install_method() requires the method name being installed to being with the driver's registered prefix, but DBD::SQLite wasn't registered. I've registered 'sqlite_' as the prefix for DBD::SQLite in the next DBI release (1.608). So you'll need to only call install_method() if the DBI VERSION is >= 1.608. To avoid problems renaming the methods currently called via func() you can use the XS ALIAS directive to give each XS driver-private method that an extra name that begins with sqlite_.
Resolved in 1.26_02. On Wed Apr 08 18:04:24 2009, TIMB wrote: Show quoted text
> The old $h->func(...) way of calling driver-private methods is > problematic, not least > because it doesn't honour RaiseError etc! > > Drivers should install driver-private methods into the DBI dispatcher > using the > install_method() method when the driver is initialized. > > See > http://search.cpan.org/~timb/DBI/lib/DBI/DBD.pm#The_driver_constructor > (and the > following "Using install_method() to expose driver-private methods" > section. > > The install_method() requires the method name being installed to being > with the driver's > registered prefix, but DBD::SQLite wasn't registered. I've registered > 'sqlite_' as the prefix for > DBD::SQLite in the next DBI release (1.608). So you'll need to only > call install_method() if the > DBI VERSION is >= 1.608. > > To avoid problems renaming the methods currently called via func() you > can use the XS > ALIAS directive to give each XS driver-private method that an extra > name that begins with > sqlite_.
Subject: Re: [rt.cpan.org #44882] Use of $h->func() should be deprecated and replaced with calls to driver-private 'installed methods'
Date: Sat, 20 Jun 2009 01:00:20 +1000
To: bug-DBD-SQLite [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
Download (untitled) / with headers
text/plain 1.3k
Confirm we're just quietly deprecating right? Do we break existing ->func code? Adam K 2009/6/19 Kenichi Ishigaki via RT <bug-DBD-SQLite@rt.cpan.org> Show quoted text
> Queue: DBD-SQLite > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=44882 > > > Resolved in 1.26_02. > > On Wed Apr 08 18:04:24 2009, TIMB wrote:
> > The old $h->func(...) way of calling driver-private methods is > > problematic, not least > > because it doesn't honour RaiseError etc! > > > > Drivers should install driver-private methods into the DBI dispatcher > > using the > > install_method() method when the driver is initialized. > > > > See > > http://search.cpan.org/~timb/DBI/lib/DBI/DBD.pm#The_driver_constructor<http://search.cpan.org/%7Etimb/DBI/lib/DBI/DBD.pm#The_driver_constructor> > > (and the > > following "Using install_method() to expose driver-private methods" > > section. > > > > The install_method() requires the method name being installed to being > > with the driver's > > registered prefix, but DBD::SQLite wasn't registered. I've registered > > 'sqlite_' as the prefix for > > DBD::SQLite in the next DBI release (1.608). So you'll need to only > > call install_method() if the > > DBI VERSION is >= 1.608. > > > > To avoid problems renaming the methods currently called via func() you > > can use the XS > > ALIAS directive to give each XS driver-private method that an extra > > name that begins with > > sqlite_.
> > > >
Download (untitled) / with headers
text/plain 2.1k
We still have the func() method for the users of DBI < 1.608, and we're testing both features provided by installed methods and the ones by the func(). We should say it louder (in blogs etc) that now we recommend to use installed methods instead of using older func() as the former is a modern best practice, and I've already noted that in the pod, but we shouldn't remove the func() right now, as it surely breaks existing codes (as DBI that supports SQLite's installed method was released on the 5th May 2009, it's too early to deprecate our func()). Kenichi On Fri Jun 19 11:00:42 2009, adamkennedybackup@gmail.com wrote: Show quoted text
> Confirm we're just quietly deprecating right? > > Do we break existing ->func code? > > Adam K > > 2009/6/19 Kenichi Ishigaki via RT <bug-DBD-SQLite@rt.cpan.org> >
> > Queue: DBD-SQLite > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=44882 > > > > > Resolved in 1.26_02. > > > > On Wed Apr 08 18:04:24 2009, TIMB wrote:
> > > The old $h->func(...) way of calling driver-private methods is > > > problematic, not least > > > because it doesn't honour RaiseError etc! > > > > > > Drivers should install driver-private methods into the DBI
> dispatcher
> > > using the > > > install_method() method when the driver is initialized. > > > > > > See > > >
> http://search.cpan.org/~timb/DBI/lib/DBI/
DBD.pm#The_driver_constructor<http://search.cpan.org/%7Etimb/DBI/lib/ DBI/DBD.pm#The_driver_constructor> Show quoted text
> > > (and the > > > following "Using install_method() to expose driver-private
> methods"
> > > section. > > > > > > The install_method() requires the method name being installed to
> being
> > > with the driver's > > > registered prefix, but DBD::SQLite wasn't registered. I've
> registered
> > > 'sqlite_' as the prefix for > > > DBD::SQLite in the next DBI release (1.608). So you'll need to
> only
> > > call install_method() if the > > > DBI VERSION is >= 1.608. > > > > > > To avoid problems renaming the methods currently called via func()
> you
> > > can use the XS > > > ALIAS directive to give each XS driver-private method that an
> extra
> > > name that begins with > > > sqlite_.
> > > > > > > >


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.