Project

rdo-mysql

0.0
No commit activity in last 3 years
No release in over 3 years
Provides access to MySQL using the RDO interface
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.1.0
 Project Readme

RDO MySQL Driver

This is the MySQL driver for RDO—Ruby Data Objects.

Build Status

Refer to the RDO project README for full usage information.

Installation

Via rubygems:

$ gem install rdo-mysql

Or add this line to your application's Gemfile:

gem "rdo-mysql"

And then execute:

$ bundle

Usage

require "rdo-mysql"

conn = RDO.connect("mysql://user:pass@localhost/db_name?encoding=utf-8")

Type support

The following table lists the way MySQL types are mapped to Ruby types:

MySQL Type Ruby Type Notes
NULL NilClass
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
FLOAT, DOUBLE Float
DECIMAL/NUMERIC BigDecimal
DATE Date
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

Prepared statements

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.

Contributing

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.