At 12:28 PM +0000 12/15/04, Jeff Zucker wrote:
I am thinking of extending the DBD::AnyData DSN in three ways and would appreciate comments. If these are good, there will be equivalent changes for DBD::DBM and DBD::CSV.

I can think of an additional change that would be useful while you're at it.

Update your implementation of DBI->data_sources() so that it is smarter. Currently, DBI::DBM returns a value for each physical sub-directory in the current directory regardless of whether it is a DBM database or not. Your module should have a superficial look inside each sub-directory and exclude those from the list that are not structured correctly inside.

More broadly speaking, with any DBD module, data_sources() should never return items that would fail a connect() due to being an invalid data source. Many do this already, such as 'mysql', but many others do not. The problem seems more common with file-based or directory-based storage types.

I admit that actually checking a source would make data_sources() slower, however I see this as acceptable since in normal use data_sources() wouldn't be invoked very often. Usually it would be invoked only as part of a batch job or in response to a user's manual query. In the latter case, the result would be more user friendly, as what they see is what they can open (privileges not withstanding).

-- Darren Duncan

Reply via email to