Class: DBI::DBD::SQLite3::Driver
- Inherits:
-
BaseDriver
- Object
- BaseDriver
- DBI::DBD::SQLite3::Driver
- Defined in:
- lib/dbd/SQLite3.rb
Overview
See DBI::BaseDriver.
Instance Method Summary collapse
- #connect(dbname, user, auth, attr) ⇒ Object
- #disconnect_all ⇒ Object
-
#initialize ⇒ Driver
constructor
A new instance of Driver.
Constructor Details
#initialize ⇒ Driver
Returns a new instance of Driver.
82 83 84 85 |
# File 'lib/dbd/SQLite3.rb', line 82 def initialize @dbs = [] super "0.4.0" end |
Instance Method Details
#connect(dbname, user, auth, attr) ⇒ Object
87 88 89 90 91 92 93 94 |
# File 'lib/dbd/SQLite3.rb', line 87 def connect(dbname, user, auth, attr) raise DBI::InterfaceError, "dbname must be a string" unless dbname.kind_of? String raise DBI::InterfaceError, "dbname must have some length" unless dbname.length > 0 raise DBI::InterfaceError, "attrs must be a hash" unless attr.kind_of? Hash db = DBI::DBD::SQLite3::Database.new(dbname, attr) @dbs.push(db) db end |
#disconnect_all ⇒ Object
96 97 98 |
# File 'lib/dbd/SQLite3.rb', line 96 def disconnect_all() @dbs.each{|db| db.disconnect()} end |