# File lib/dbi/handles/driver.rb, line 15
15:         def connect(db_args, user, auth, params)
16: 
17:             user = @handle.default_user[0] if user.nil?
18:             auth = @handle.default_user[1] if auth.nil?
19: 
20:             # TODO: what if only one of them is nil?
21:             #if user.nil? and auth.nil? then
22:             #  user, auth = @handle.default_user
23:             #end
24: 
25:             params ||= {}
26:             new_params = @handle.default_attributes
27:             params.each {|k,v| new_params[k] = v} 
28: 
29:             if params.has_key?(:_convert_types)
30:                 @convert_types = params[:_convert_types]
31:             end
32: 
33:             db = @handle.connect(db_args, user, auth, new_params)
34:             dbh = DatabaseHandle.new(db, @convert_types)
35:             # FIXME trace
36:             # dbh.trace(@trace_mode, @trace_output)
37:             dbh.driver_name = @driver_name
38: 
39:             if block_given?
40:                 begin
41:                     yield dbh
42:                 ensure  
43:                     dbh.disconnect if dbh.connected?
44:                 end  
45:             else
46:                 return dbh
47:             end
48:         end