Parent

Mysql2::Client

Constants

CHARSET_MAP
MYSQL_CHARSET_MAP

Attributes

query_options[R]

Public Class Methods

default_query_options() click to toggle source
    # File lib/mysql2/client.rb, line 40
40:     def self.default_query_options
41:       @@default_query_options
42:     end
encoding_from_charset(charset) click to toggle source
     # File lib/mysql2/client.rb, line 217
217:       def self.encoding_from_charset(charset)
218:         CHARSET_MAP[charset.to_s.downcase]
219:       end
encoding_from_charset_code(code) click to toggle source
     # File lib/mysql2/client.rb, line 221
221:       def self.encoding_from_charset_code(code)
222:         if mapping = MYSQL_CHARSET_MAP[code]
223:           encoding_from_charset(mapping[:name])
224:         else
225:           nil
226:         end
227:       end
new(opts = {}) click to toggle source
    # File lib/mysql2/client.rb, line 15
15:     def initialize(opts = {})
16:       @query_options = @@default_query_options.dup
17: 
18:       init_connection
19: 
20:       [:reconnect, :connect_timeout].each do |key|
21:         next unless opts.key?(key)
22:         send(:"#{key}=", opts[key])
23:       end
24:       # force the encoding to utf8
25:       self.charset_name = opts[:encoding] || 'utf8'
26: 
27:       ssl_set(*opts.values_at(:sslkey, :sslcert, :sslca, :sslcapath, :sslciper))
28: 
29:       user     = opts[:username]
30:       pass     = opts[:password]
31:       host     = opts[:host] || 'localhost'
32:       port     = opts[:port] || 3306
33:       database = opts[:database]
34:       socket   = opts[:socket]
35:       flags    = opts[:flags] ? opts[:flags] | @query_options[:connect_flags] : @query_options[:connect_flags]
36: 
37:       connect user, pass, host, port, database, socket, flags
38:     end

Private Class Methods

local_offset() click to toggle source
     # File lib/mysql2/client.rb, line 231
231:       def self.local_offset
232:         ::Time.local(2010).utc_offset.to_r / 86400
233:       end

Public Instance Methods

close() click to toggle source

Immediately disconnect from the server, normally the garbage collector will disconnect automatically when a connection is no longer needed. Explicitly closing this will free up server resources sooner than waiting for the garbage collector.

static VALUE rb_mysql_client_close(VALUE self) 

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.