def to_h(convert_extra = true)
      ret = {
          adapter: adapter.to_s,
          database: database.to_s,
          pool: pool.to_s.to_i,
          timeout: timeout.to_s.to_i,
          reconnect: reconnect?,
          encoding: encoding ? encoding.to_s : nil,
          host: host.blank? ? nil : host.to_s,
          port: port.blank? ? nil : port.to_s.to_i,
          username: username.blank? ? nil : username.to_s,
          password: password.blank? ? nil : password.to_s,
          update_username: update_username.blank? ? nil : update_username.to_s,
          update_password: update_password.blank? ? nil : update_password.to_s,
      }
      VALID_EXTRA_KEY.each do |idx|
        if convert_extra
          unless extra_name(idx).blank?
            ret[extra_name(idx).to_sym] = extra_value(idx, true)
          end
        else
          ret[:"extra_#{idx}_name"] = send(:"extra_#{idx}_name")
          ret[:"extra_#{idx}_label"] = send(:"extra_#{idx}_label")
          ret[:"extra_#{idx}_type"] = send(:"extra_#{idx}_type")
          ret[:"extra_#{idx}_value"] = send(:"extra_#{idx}_value")
        end
      end
      ret
    end
def to_h(convert_extra = true)
      ret = {
          adapter: adapter.to_s,
          database: database.to_s,
          pool: pool.to_s.to_i,
          timeout: timeout.to_s.to_i,
          reconnect: reconnect?,
          encoding: encoding ? encoding.to_s : nil,
          host: host.blank? ? nil : host.to_s,
          port: port.blank? ? nil : port.to_s.to_i,
          username: username.blank? ? nil : username.to_s,
          password: password.blank? ? nil : password.to_s,
          update_username: update_username.blank? ? nil : update_username.to_s,
          update_password: update_password.blank? ? nil : update_password.to_s,
      }
      VALID_EXTRA_KEY.each do |idx|
        if convert_extra
          unless extra_name(idx).blank?
            ret[extra_name(idx).to_sym] = extra_value(idx, true)
          end
        else
          ret[:"extra_#{idx}_name"] = send(:"extra_#{idx}_name")
          ret[:"extra_#{idx}_label"] = send(:"extra_#{idx}_label")
          ret[:"extra_#{idx}_type"] = send(:"extra_#{idx}_type")
          ret[:"extra_#{idx}_value"] = send(:"extra_#{idx}_value")
        end
      end
      ret
    end
Converts this configuration into a hash.