lib/vertica/connection.rb in vertica-0.9.0.beta6 vs lib/vertica/connection.rb in vertica-0.9.0.beta7
- old
+ new
@@ -127,10 +127,15 @@
elsif source.respond_to?(:read) && source.respond_to?(:eof?)
job.copy_handler = lambda { |data| io_copy_handler(source, data) }
end
return job.run
end
+
+ def inspect
+ safe_options = @options.reject{ |name, _| name == :password }
+ "#<Vertica::Connection:#{object_id} @parameters=#{@parameters.inspect} @backend_pid=#{@backend_pid}, @backend_key=#{@backend_key}, @transaction_status=#{@transaction_status}, @socket=#{@socket}, @options=#{safe_options.inspect}, @row_style=#{@row_style}>"
+ end
protected
def file_copy_handler(input_file, output)
File.open(input_file, 'r') do |input|
@@ -151,10 +156,10 @@
raise Vertica::Error::ConnectionError.new("Couldn't read #{n} characters from socket.") if bytes.nil? || bytes.size != n
return bytes
end
def startup_connection
- write Vertica::Messages::Startup.new(@options[:user], @options[:database])
+ write Vertica::Messages::Startup.new(@options[:user] || @options[:username], @options[:database])
message = nil
begin
case message = read_message
when Vertica::Messages::Authentication
if message.code != Vertica::Messages::Authentication::OK