Class: DBI::DBD::SQLite3::Driver

Inherits:
BaseDriver
  • Object
show all
Defined in:
lib/dbd/SQLite3.rb

Overview

See DBI::BaseDriver.

Instance Method Summary collapse

Constructor Details

#initializeDriver

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

Raises:

  • (DBI::InterfaceError)


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_allObject



96
97
98
# File 'lib/dbd/SQLite3.rb', line 96

def disconnect_all()
    @dbs.each{|db| db.disconnect()}
end