为什么我在执行以下操作时无法获得选择查询的结果?
#!/usr/bin/ruby
require 'mysql2'
require 'awesome_print'
client = Mysql2::Client.new(:host => "example.com", :username => "x", :password => "x", :database => "hd")
r = client.query("select CLIENT_ID from CLIENT where EMAIL='x@x.com'")
ap r
输出
$ ./hd.rb
/usr/share/gems/gems/awesome_print-1.0.2/lib/awesome_print/formatter.rb:355: warning: constant ::Fixnum is deprecated
#<Mysql2::Result:0x55fab9bfd880
@query_options = {
:as => :hash,
:async => false,
:cast_booleans => false,
:symbolize_keys => false,
:database_timezone => :local,
:application_timezone => nil,
:cache_rows => true,
:connect_flags => 2147525124,
:cast => true,
:default_file => nil,
:default_group => nil,
:host => "example.com",
:username => "x",
:password => "x",
:database => "hd"
}