Skip Menu |

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

Report information
The Basics
Id: 82626
Status: resolved
Priority: 0/
Queue: DBD-Mock

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

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



Subject: feature request: setup handle from fixture file
Date: Thu, 10 Jan 2013 16:13:43 -0600
To: bugs-dbd-mock [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
it'd be cool if the DSN could be something like 'DBI:Mock:db=My::Fixture' which would load My::Fixture from the lib. The fixture file could work in a few ways, possibly the best is for it to have a standard named subroutine that gets the $dbh before it is returned to the user, and so you can add whatever you need to from this file, without changing the way your program works at all, or needing to intercept the $dbh in your prorgram after it is created but before it's used. -- Caleb Cushing http://xenoterracide.com
On Thu Jan 10 17:13:56 2013, XENO wrote: Show quoted text
> it'd be cool if the DSN could be something like 'DBI:Mock:db=My::Fixture' > > which would load My::Fixture from the lib. The fixture file could work > in a few ways, possibly the best is for it to have a standard named > subroutine that gets the $dbh before it is returned to the user, and > so you can add whatever you need to from this file, without changing > the way your program works at all, or needing to intercept the $dbh in > your prorgram after it is created but before it's used. > > -- > Caleb Cushing > > http://xenoterracide.com
Hi, I've recently picked up support for DBD::Mock and was wondering if your use-case here would be better approached by using a callback feature I'm currently working on. The callback logic is that you assign one or more functions to the the list of DBD::Mock's callbacks and then these get functions will get called when DBI's connect method is called (with the database handle as their first parameter). Does this callback feature let you do what you were planning to use the fixture file for? Regards, Jason.
Subject: Re: [rt.cpan.org #82626] feature request: setup handle from fixture file
Date: Thu, 5 Sep 2019 13:25:38 -0500
To: bug-DBD-Mock [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
I have no idea, I reported this so long ago, and I quit programming Perl 5 years ago On Thu, Sep 5, 2019 at 1:44 AM Jason Cooper via RT <bug-DBD-Mock@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=82626 > > > On Thu Jan 10 17:13:56 2013, XENO wrote:
> > it'd be cool if the DSN could be something like 'DBI:Mock:db=My::Fixture' > > > > which would load My::Fixture from the lib. The fixture file could work > > in a few ways, possibly the best is for it to have a standard named > > subroutine that gets the $dbh before it is returned to the user, and > > so you can add whatever you need to from this file, without changing > > the way your program works at all, or needing to intercept the $dbh in > > your prorgram after it is created but before it's used. > > > > -- > > Caleb Cushing > > > > http://xenoterracide.com
> > Hi, > I've recently picked up support for DBD::Mock and was wondering if your > use-case here would be better approached by using a callback feature I'm > currently working on. > > The callback logic is that you assign one or more functions to the the > list of DBD::Mock's callbacks and then these get functions will get called > when DBI's connect method is called (with the database handle as their > first parameter). > > Does this callback feature let you do what you were planning to use the > fixture file for? > > Regards, > Jason. > >
-- Caleb Cushing http://xenoterracide.com
Hi, Thanks for letting me know. If anyone does want to do what you described in your original feature request then they should be able to achieve it through the new callback feature when it arrives. Thanks, Jason.