Skip Menu |

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

Report information
The Basics
Id: 6040
Status: resolved
Priority: 0/
Queue: DBD-CSV

People
Owner: Nobody in particular
Requestors: trevor.schellhorn-perl [...] marketingtips.com
Cc:
AdminCc:

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



Subject: Implementing "Active" attribute for driver
I would like to suggest that the 'Active' flag be implemented for the DBD::CSV driver. When the driver gets connected, it would set the 'Active' flag to one and when the driver gets disconnected, it would set the 'Active' flag to zero. I do understand that once you create a DBD::CSV database handle, it is always connected until you exit the script. The reason that I am asking for this to be implemented is that we use DBD::CSV handles when doing local testing of the objects we create. We use different database drivers in production. The objects that we create test to make sure that the datasource handle passed into the object is valid and connected. When the script exits, some of our objects check to make sure that the developer disconnected from the datasource properly. To check this, we have implemented a 'ping' method for the objects that use the datasources. In this method, it checks to see if the datasource handle that is contained in the object has the 'Active' attribute set to true. If I understood how the DBI drivers were to be implemented, I would build a patch for your driver and submit it to you. Unfortunately, I don't have the time to read the documentation on writing DBI drivers.
Coincidently, I discovered that DBD::CSV needs to set Active because I was trying to get it to work with Class::DBI so your report came in just as I was finishing the patches. As of version 0.21, the module now sets Active on for connect and off for either disconnect or DESTROY. Thanks much for your report.