Name

data_sources

Synopsis

@ary = DBI->data_sources($driver);
@ary = DBI->data_sources($driver, \%attr);

Returns a list of all data sources (databases) available via the named driver. The driver will be loaded if it hasn’t been already. If $driver is empty or undef, then the value of the DBI_DRIVER environment variable is used.

Data sources are returned in a form suitable for passing to the connect method (that is, they will include the dbi:$driver: prefix).

Note that many drivers have no way of knowing what data sources might be available. These drivers return an empty or incomplete list.

Get Programming the Perl DBI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.