Feature: implicitly require driver libs for unqualified driver specifications #30

Closed
pilcrow opened this Issue Mar 29, 2011 · 2 comments

Comments

Projects
None yet
1 participant
Owner

pilcrow commented Mar 29, 2011

Current behavior

Presently the RDBI requires the user explicitly to require a driver library when specifying the driver as a Symbol short-hand. For example, this will fail:

require 'rdbi'

RDBI.connect(:ArtifikaSQL, ...)  # Exception!  RDBI::Driver::ArtifikaSQL unknown

and this must be done instead:

require 'rdbi'
require 'rdbi/driver/artifikasql'

RDBI.connect(:ArtifikaSQL, ...)  # ok

which is inconvenient when the user desires to programmatically switch from one driver to another. In practice all drivers are politely installed, and their library name may be easily inferred from their short symbolic specifiers.

Desired behavior

Driver files ought to be required where obvious:

require 'rdbi'
RDBI.connect(:ArtifikaSQL, ...)  # ok, implicitly requires 'rdbi/driver/artifika'

But not where not needed:

require 'rdbi'
require 'alternate/lib/defining/RDBI/Driver/ArtifikaSQL'
RDBI.connect(:ArtifikaSQL, ...)  # ok, no implicit require, as class is found

See also

RDBI/rdbi-dbrc#2

@ghost ghost assigned pilcrow Mar 22, 2013

Owner

pilcrow commented Mar 22, 2013

Branch: implicit-load

Owner

pilcrow commented Jun 5, 2013

This is now in master as 1.2.0-pre0

@pilcrow pilcrow closed this Jun 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment