| Class | DBI::BaseDriver |
| In: |
lib/dbi/base_classes/driver.rb
|
| Parent: | Base |
Implements the basic functionality that constitutes a Driver
Drivers do not have a direct interface exposed to the user; these methods are mostly for DBD authors.
As with DBI::BaseDatabase, "DBD Required" and "DBD Optional" will be used to explain the same requirements.
# File lib/dbi/base_classes/driver.rb, line 12
12: def initialize(dbi_version)
13: major, minor = dbi_version.split(".").collect { |x| x.to_i }
14: dbi_major, dbi_minor = DBI::VERSION.split(".").collect { |x| x.to_i }
15: unless major == dbi_major and minor == dbi_minor
16: raise InterfaceError, "Wrong DBD API version used"
17: end
18: end
Connect to the database. DBD Required.
# File lib/dbi/base_classes/driver.rb, line 21
21: def connect(dbname, user, auth, attr)
22: raise NotImplementedError
23: end
Return the data sources available to this driver. Returns an empty array per default.
# File lib/dbi/base_classes/driver.rb, line 37
37: def data_sources
38: []
39: end
Default attributes to set on the DatabaseHandle.
# File lib/dbi/base_classes/driver.rb, line 31
31: def default_attributes
32: {}
33: end
Default u/p information in an array.
# File lib/dbi/base_classes/driver.rb, line 26
26: def default_user
27: ['', '']
28: end