Skip to content

Commit

Permalink
updating files for 0.1.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed Apr 15, 2010
1 parent 7caf1b6 commit d7c146e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.1.3 (April 15th, 2010)
* added an EventMachine Deferrable API
* added an ActiveRecord connection adapter
** should be compatible with 2.3.5 and 3.0 (including Arel)

## 0.1.2 (April 9th, 2010)
* fix a bug (copy/paste fail) around checking for empty TIME values and returning nil (thanks @marius)

Expand Down
28 changes: 28 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,32 @@ NOTE: Because of the way MySQL's query API works, this method will block until t
So if you really need things to stay async, it's best to just monitor the socket with something like EventMachine.
If you need multiple query concurrency take a look at using a connection pool.

== ActiveRecord

To use the ActiveRecord driver, all you should need to do is have this gem installed and set the adapter in your database.yml to "mysql2".
That was easy right? :)

== EventMachine

The mysql2 EventMachine deferrable api allows you to make async queries using EventMachine,
while specifying callbacks for success for failure. Here's a simple example:

require 'mysql2/em'

EM.run do
client1 = Mysql2::EM::Client.new
defer1 = client1.query "SELECT sleep(3) as first_query"
defer1.callback do |result|
puts "Result: #{result.to_a.inspect}"
end

client2 = Mysql2::EM::Client.new
defer2 = client2.query "SELECT sleep(1) second_query"
defer2.callback do |result|
puts "Result: #{result.to_a.inspect}"
end
end

== Compatibility

The specs pass on my system (SL 10.6.3, x86_64) in these rubies:
Expand All @@ -85,6 +111,8 @@ The specs pass on my system (SL 10.6.3, x86_64) in these rubies:
* ruby-trunk
* rbx-head

The ActiveRecord driver should work on 2.3.5 and 3.0

== Yeah... but why?

Someone: Dude, the Mysql gem works fiiiiiine.
Expand Down
2 changes: 1 addition & 1 deletion lib/mysql2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
#
# A modern, simple and very fast Mysql library for Ruby - binding to libmysql
module Mysql2
VERSION = "0.1.2"
VERSION = "0.1.3"
end
18 changes: 14 additions & 4 deletions mysql2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

Gem::Specification.new do |s|
s.name = %q{mysql2}
s.version = "0.1.2"
s.version = "0.1.3"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brian Lopez"]
s.date = %q{2010-04-09}
s.date = %q{2010-04-15}
s.email = %q{[email protected]}
s.extensions = ["ext/extconf.rb"]
s.extra_rdoc_files = [
Expand All @@ -22,14 +22,21 @@ Gem::Specification.new do |s|
"README.rdoc",
"Rakefile",
"VERSION",
"benchmark/active_record.rb",
"benchmark/escape.rb",
"benchmark/query.rb",
"benchmark/setup_db.rb",
"examples/eventmachine.rb",
"ext/extconf.rb",
"ext/mysql2_ext.c",
"ext/mysql2_ext.h",
"lib/active_record/connection_adapters/mysql2_adapter.rb",
"lib/arel/engines/sql/compilers/mysql2_compiler.rb",
"lib/mysql2.rb",
"lib/mysql2/em.rb",
"mysql2.gemspec",
"spec/active_record/active_record_spec.rb",
"spec/em/em_spec.rb",
"spec/mysql2/client_spec.rb",
"spec/mysql2/result_spec.rb",
"spec/rcov.opts",
Expand All @@ -42,9 +49,12 @@ Gem::Specification.new do |s|
s.rubygems_version = %q{1.3.6}
s.summary = %q{A simple, fast Mysql library for Ruby, binding to libmysql}
s.test_files = [
"spec/mysql2/client_spec.rb",
"spec/active_record/active_record_spec.rb",
"spec/em/em_spec.rb",
"spec/mysql2/client_spec.rb",
"spec/mysql2/result_spec.rb",
"spec/spec_helper.rb"
"spec/spec_helper.rb",
"examples/eventmachine.rb"
]

if s.respond_to? :specification_version then
Expand Down

0 comments on commit d7c146e

Please sign in to comment.