def []=(attr, value)
case attr
when 'AutoCommit'
if value
@db.commit if @db.transaction_active?
else
@db.transaction unless @db.transaction_active?
end
@attr[attr] = value
when 'auto_vacuum', 'cache_size', 'count_changes',
'default_cache_size', 'encoding', 'full_column_names',
'page_size', 'short_column_names', 'synchronous',
'temp_store', 'temp_store_directory'
@db.__send__((attr+'='), value)
@attr[attr] = @db.__send__(attr)
when 'busy_timeout'
@db.busy_timeout(value)
@attr[attr] = value
when 'busy_handler'
@db.busy_timeout(&value)
@attr[attr] = value
when 'type_translation'
@db.type_translation = value
@attr[attr] = value
else
raise DBI::NotSupportedError
end
return value
end