# File lib/dbd/sqlite/database.rb, line 14
14:     def initialize(dbname, user, auth, attr_hash)
15:         # FIXME why isn't this crap being done in DBI?
16:         unless dbname.kind_of? String
17:             raise DBI::InterfaceError, "Database Name must be a string"
18:         end
19: 
20:         unless dbname.length > 0
21:             raise DBI::InterfaceError, "Database Name needs to be length > 0"
22:         end
23: 
24:         unless attr_hash.kind_of? Hash
25:             raise DBI::InterfaceError, "Attributes should be a hash"
26:         end
27: 
28:         # FIXME handle busy_timeout in SQLite driver
29:         # FIXME handle SQLite pragmas in SQLite driver
30:         @attr_hash = attr_hash
31:         @open_handles = 0
32: 
33:         self["AutoCommit"] = true if self["AutoCommit"].nil?
34: 
35:         # open the database
36:         begin
37:             @db = ::SQLite::Database.new(dbname)
38:         rescue Exception => e
39:             raise DBI::OperationalError, "Couldn't open database #{dbname}: #{e.message}"
40:         end
41:     end