Skip to content

Commit d7c146e

Browse files
committed
updating files for 0.1.3 release
1 parent 7caf1b6 commit d7c146e

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.1.3 (April 15th, 2010)
4+
* added an EventMachine Deferrable API
5+
* added an ActiveRecord connection adapter
6+
** should be compatible with 2.3.5 and 3.0 (including Arel)
7+
38
## 0.1.2 (April 9th, 2010)
49
* fix a bug (copy/paste fail) around checking for empty TIME values and returning nil (thanks @marius)
510

README.rdoc

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

78+
== ActiveRecord
79+
80+
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".
81+
That was easy right? :)
82+
83+
== EventMachine
84+
85+
The mysql2 EventMachine deferrable api allows you to make async queries using EventMachine,
86+
while specifying callbacks for success for failure. Here's a simple example:
87+
88+
require 'mysql2/em'
89+
90+
EM.run do
91+
client1 = Mysql2::EM::Client.new
92+
defer1 = client1.query "SELECT sleep(3) as first_query"
93+
defer1.callback do |result|
94+
puts "Result: #{result.to_a.inspect}"
95+
end
96+
97+
client2 = Mysql2::EM::Client.new
98+
defer2 = client2.query "SELECT sleep(1) second_query"
99+
defer2.callback do |result|
100+
puts "Result: #{result.to_a.inspect}"
101+
end
102+
end
103+
78104
== Compatibility
79105

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

114+
The ActiveRecord driver should work on 2.3.5 and 3.0
115+
88116
== Yeah... but why?
89117

90118
Someone: Dude, the Mysql gem works fiiiiiine.

lib/mysql2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
#
66
# A modern, simple and very fast Mysql library for Ruby - binding to libmysql
77
module Mysql2
8-
VERSION = "0.1.2"
8+
VERSION = "0.1.3"
99
end

mysql2.gemspec

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
Gem::Specification.new do |s|
77
s.name = %q{mysql2}
8-
s.version = "0.1.2"
8+
s.version = "0.1.3"
99

1010
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
1111
s.authors = ["Brian Lopez"]
12-
s.date = %q{2010-04-09}
12+
s.date = %q{2010-04-15}
1313
s.email = %q{[email protected]}
1414
s.extensions = ["ext/extconf.rb"]
1515
s.extra_rdoc_files = [
@@ -22,14 +22,21 @@ Gem::Specification.new do |s|
2222
"README.rdoc",
2323
"Rakefile",
2424
"VERSION",
25+
"benchmark/active_record.rb",
2526
"benchmark/escape.rb",
2627
"benchmark/query.rb",
2728
"benchmark/setup_db.rb",
29+
"examples/eventmachine.rb",
2830
"ext/extconf.rb",
2931
"ext/mysql2_ext.c",
3032
"ext/mysql2_ext.h",
33+
"lib/active_record/connection_adapters/mysql2_adapter.rb",
34+
"lib/arel/engines/sql/compilers/mysql2_compiler.rb",
3135
"lib/mysql2.rb",
36+
"lib/mysql2/em.rb",
3237
"mysql2.gemspec",
38+
"spec/active_record/active_record_spec.rb",
39+
"spec/em/em_spec.rb",
3340
"spec/mysql2/client_spec.rb",
3441
"spec/mysql2/result_spec.rb",
3542
"spec/rcov.opts",
@@ -42,9 +49,12 @@ Gem::Specification.new do |s|
4249
s.rubygems_version = %q{1.3.6}
4350
s.summary = %q{A simple, fast Mysql library for Ruby, binding to libmysql}
4451
s.test_files = [
45-
"spec/mysql2/client_spec.rb",
52+
"spec/active_record/active_record_spec.rb",
53+
"spec/em/em_spec.rb",
54+
"spec/mysql2/client_spec.rb",
4655
"spec/mysql2/result_spec.rb",
47-
"spec/spec_helper.rb"
56+
"spec/spec_helper.rb",
57+
"examples/eventmachine.rb"
4858
]
4959

5060
if s.respond_to? :specification_version then

0 commit comments

Comments
 (0)