Skip to content

Commit 9210a9b

Browse files
committed
Merge pull request #441 from sodabrew/readme_rubies
README updates
2 parents 3f1b39e + 9e4cefc commit 9210a9b

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,26 @@ Mysql2::Client.new(
160160
:default_group = 'my.cfg section'
161161
)
162162
```
163+
164+
### SSL options
165+
166+
Setting any of the following options will enable an SSL connection, but only if
167+
your MySQL client library and server have been compiled with SSL support.
168+
MySQL client library defaults will be used for any parameters that are left out
169+
or set to nil. Relative paths are allowed, and may be required by managed
170+
hosting providers such as Heroku.
171+
172+
``` ruby
173+
Mysql2::Client.new(
174+
# ...options as above...,
175+
:sslkey => '/path/to/client-key.pem',
176+
:sslcert => '/path/to/client-cert.pem',
177+
:sslca => '/path/to/ca-cert.pem',
178+
:sslcapath => '/path/to/cacerts',
179+
:sslcipher => 'DHE-RSA-AES256-SHA'
180+
)
181+
```
182+
163183
### Multiple result sets
164184

165185
You can also retrieve multiple result sets. For this to work you need to connect with
@@ -186,7 +206,7 @@ The MySQL 5.6.5 client library may also refuse to attempt a connection if provid
186206
To bypass this restriction in the client, pass the option :secure_auth => false to Mysql2::Client.new().
187207
If using ActiveRecord, your database.yml might look something like this:
188208

189-
```
209+
``` yaml
190210
development:
191211
adapter: mysql2
192212
encoding: utf8
@@ -199,11 +219,12 @@ development:
199219
```
200220
201221
### Reading a MySQL config file
222+
202223
You may read configuration options from a MySQL configuration file by passing
203224
the `:default_file` and `:default_group` paramters. For example:
204225

205-
```
206-
client = Mysql2::Client.new(:default_file => '/user/.my.cnf', :default_group => 'client')
226+
``` ruby
227+
Mysql2::Client.new(:default_file => '/user/.my.cnf', :default_group => 'client')
207228
```
208229

209230

@@ -405,15 +426,15 @@ As for field values themselves, I'm workin on it - but expect that soon.
405426

406427
## Compatibility
407428

408-
The specs pass on my system (SL 10.6.3, x86_64) in these rubies:
429+
This gem is regularly tested against the following Ruby versions on Linux and Mac OS X:
409430

410-
* 1.8.7-p249
411-
* ree-1.8.7-2010.01
412-
* 1.9.1-p378
413-
* ruby-trunk
414-
* rbx-head - broken at the moment, working with the rbx team for a solution
431+
* Ruby MRI 1.8.7, 1.9.2, 1.9.3, 2.0.0 (ongoing patch releases).
432+
* Ruby Enterprise Edition (based on MRI 1.8.7).
433+
* Rubinius 2.0 in compatibility modes 1.8, 1.9, 2.0.
415434

416-
The Active Record driver should work on 2.3.5 and 3.0
435+
The mysql2 gem 0.2.x series includes an Active Record driver that works with AR
436+
2.3.x and 3.0.x. Starting in Active Record 3.1, a mysql2 driver is included in
437+
the Active Record codebase and no longer provided in mysql2 gem 0.3 and above.
417438

418439
## Yeah... but why?
419440

@@ -422,7 +443,6 @@ Someone: Dude, the Mysql gem works fiiiiiine.
422443
Me: It sure does, but it only hands you nil and strings for field values. Leaving you to convert
423444
them into proper Ruby types in Ruby-land - which is slow as balls.
424445

425-
426446
Someone: OK fine, but do_mysql can already give me back values with Ruby objects mapped to MySQL types.
427447

428448
Me: Yep, but it's API is considerably more complex *and* can be ~2x slower.

0 commit comments

Comments
 (0)