RDO MySQL Driver
This is the MySQL driver for RDO—Ruby Data Objects.
Refer to the RDO project README for full usage information.
$ gem install rdo-mysql
Or add this line to your application's Gemfile:
And then execute:
require "rdo-mysql" conn = RDO.connect("mysql://user:pass@localhost/db_name?encoding=utf-8")
The following table lists the way MySQL types are mapped to Ruby types:
|MySQL Type||Ruby Type||Notes|
|INT, TINYINT, SMALLINT, MEDIUMINT, BIGINT, INT||Fixnum||Ruby may use a Bignum of required|
|CHAR, VARCHAR||String||The encoding specified on the connection is used|
|TEXT, TINYTEXT, MEDIUMTEXT, LONGTEXT||String||The encoding specified on the connection is used|
|BLOB, TINYBLOB, MEDIUMBLOB, LONGBLOB||String||The encoding is set to ASCII-8BIT/BINARY|
|BINARY, VARBINARY||String||The encoding is set to ASCII-8BIT/BINARY|
|DATETIME, TIMESTAMP||DateTime||MySQL does not store or return a time zone; the system time zone is used|
|SET||Set||MySQL does not allow values containing commas to be included in a SET|
MySQL, in theory supports prepared statements. But really you would not want to use them. There are still a number of known limitations with MySQL prepared statements, as outlined here:
rdo-mysql uses RDO's emulated prepared statement support instead. If people shout loud enough that they'd prefer to use MySQL's problematic prepared statements anyway, I'll implement them.
If you find any bugs, please send a pull request if you think you can fix it, or file in an issue in the issue tracker.
When sending pull requests, please use topic branches—don't send a pull request from the master branch of your fork.
Contributors will be credited in this README.
Copyright & Licensing
Written by Chris Corbyn.
Licensed under the MIT license. See the LICENSE file for full details.